Cleanup dead code

Cleanup dead code

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -320,7 +320,7 @@
                               {:title "Support"
                                :data-placement "right"
                                :data-trigger "hover"
-                               :data-bind "tooltip: {title: 'Support', placement: 'right', trigger: 'hover'}, click: $root.raiseIntercomDialog",})
+                               :data-bind "tooltip: {title: 'Support', placement: 'right', trigger: 'hover'}"})
          [:i.fa.fa-comments]]

         [:a.aside-item {:href "/add-projects",


Support fading to/from nothing.

Support fading to/from nothing.

And allow whatever was going on before this fade to shine through as we
approach "nothing".

--- src/afterglow/effects.clj
+++ src/afterglow/effects.clj
@@ -149,6 +149,7 @@
   the way Afterglow evaluates assigners, that means that if any
   constituent effects try to assign to the same target, the later ones
   will have a chance to override or blend with the earlier ones."
+  {:doc/format :markdown}
   [scene-name & effects]
   (let [active (atom effects)]
     (Effect. scene-name
@@ -159,6 +160,13 @@
              (fn [show snapshot]
                (swap! active (fn [fx] () (filterv #(not (end % show snapshot)) fx)))
                (empty? @active)))))
+
+(defn blank
+  "Create an effect which does nothing. This can be useful, for
+  example, when you want to use [[fade]] to fade into an effect from a
+  state where there was simply nothing happening."
+  []
+  (scene "Blank"))

 (defmulti fade-between-assignments
   "Calculates an intermediate value between two attribute assignments
@@ -280,6 +288,14 @@
                                       (assign assigner show snapshot target result))
                                     previous-assignment assigners)]
              (Assignment. kind target-id target assignment))))))
+
+(defn- with-default-assignment
+  "If the current assignment is empty, but there was a previous
+  assignment value, turn it into an actual assignment based on the
+  supplied template."
+  [assignment template previous-assignment]
+  (or assignment
+      (when previous-assignment (map->Assignment (assoc template :value previous-assignment)))))

 (defn fade
   "Create an effect which fades between two other effects as the value
@@ -318,10 +334,15 @@
                      (map (fn [k]
                             (let [from-assigners (get from-groups k)
                                   to-assigners (get to-groups k)
+                                  template (or (first from-assigners) (first to-assigners))
                                   f (fn [show snapshot target previous-assignment]
-                                      (let [from (run-assigners show snapshot from-assigners previous-assignment)
-                                            to (run-assigners show snapshot to-assigners previous-assignment)]
+                                      (let [from (with-default-assignment
+                                                   (run-assigners show snapshot from-assigners previous-assignment)
+                                                   template previous-assignment)
+                                            to (with-default-assignment
+                                                 (run-assigners show snapshot to-assigners previous-assignment)
+                                                 template previous-assignment)]
                                         (:value (fade-assignment from to v show snapshot))))]
-                              (map->Assigner (assoc (or (first from-assigners) (first to-assigners)) :f f))))
+                              (map->Assigner (assoc template :f f))))
                           keys)))))
              end-immediately)))


CMR-4920 Adds new ingest system int test for new DOI value.

--- system-int-test/test/cmr/system_int_test/ingest/collection_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_ingest_test.clj
@@ -742,3 +742,14 @@
           {:keys [status]} (ingest/ingest-concept
                             (ingest/concept :collection "PROV1" "foo" :dif coll-metadata))]
       (is (= 201 status)))))
+
+(deftest CMR-4920-DOI-test
+  (testing "Ingest echo10 collection with new DOI values"
+    (let [concept (data-umm-c/collection-concept {:EntryTitle "E1"
+                                                  :ShortName "S1"
+                                                  :DOI {:MissingReason "Not Applicable"
+                                                        :Explanation "Explanation String"}
+                                                  :concept-id "C1-PROV1"} :echo10)
+          response (ingest/ingest-concept concept {:raw? true})]
+      (is (= {:concept-id "C1-PROV1" :revision-id 1}
+             (select-keys (ingest/parse-ingest-body :xml response) [:concept-id :revision-id]))))))


Fix iplayer-download-command to return list not string.

--- src/beebster_clj/core.clj
+++ src/beebster_clj/core.clj
@@ -1,4 +1,5 @@
 (ns beebster-clj.core
+  (:import [java.lang.ProcessBuilder])
   (:require [compojure.route :as route]
             [compojure.handler :as handler]
             ;; [beebster-clj.views :as views]
@@ -19,7 +20,6 @@

 (def delete-string
   "These programmes should be deleted:")
-

 (defn get-info
@@ -63,7 +63,7 @@
 (defn iplayer-download-command
   "concatenate index and mode to download command"
    [index mode]
-  (apply str  "get_iplayer " mode "1" " -g  --nocopyright --output=\"$HOME/Videos\"" " " index))
+  (list "get-iplayer" (apply str "modes=" mode "1") "output=~/Videos" "-g" index))

 (defn get-url
   "return /info url string concatenated with index"


adding bouncer to check if a map has a valid format

--- src/bitfondue/handler.clj
+++ src/bitfondue/handler.clj
@@ -14,6 +14,8 @@
             [buddy.auth :refer [authenticated? throw-unauthorized]]
             [buddy.auth.backends.token :refer [jwe-backend]]
             [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
+            (bouncer [core :as b]
+                     [validators :as v])
             [bitfondue.config :as config]
             (bitfondue.models [users :as users]
                               [chunks :as chunks]))


No need for if.

No need for if.

--- src/cake/tasks/search.clj
+++ src/cake/tasks/search.clj
@@ -65,9 +65,7 @@
   {[term] :latest-version, repos :repos}
   (let [repos (select-repos repos)
         [group-id artifact-id] (.split term "/")
-        query (if artifact-id
-                (str "g:" group-id " AND a:" artifact-id)
-                (str "g:" group-id " AND a:" group-id))]
+        query (str "g:" group-id " AND a:" (or artifact-id group-id))]
     (doseq [[id url] repos] (download-index id url))
     (let [result (first (sort-by :version (comp unchecked-negate compare)
                                  (filter (comp #{term} identifier)


Added more utility functions

Added more utility functions

--- src/cljs/drawer/util.cljs
+++ src/cljs/drawer/util.cljs
@@ -1,5 +1,6 @@
 (ns drawer.util
-  (:require [tailrecursion.cljson :refer [clj->cljson cljson->clj]]))
+  (:require [goog.string :as gstring]
+            [tailrecursion.cljson :refer [clj->cljson cljson->clj]]))

 (defn update-values
   "Updates the values of given map using
@@ -27,6 +28,11 @@
   "Logs given text to the console."
   [x]
   (.log js/console x))
+
+(defn format
+  "Formats a string using goog.string.format."
+  [fmt & args]
+  (apply gstring/format fmt args))

 (def alert-map (atom {}))
 (defn alert-once [id val]
@@ -104,3 +110,11 @@
   (if-let [item (.getItem js/localStorage k)]
     (cljson->clj item)
     default))
+
+(def request-anim-frame
+  (or (.-requestAnimationFrame js/window)
+      (.-webkitRequestAnimationFrame js/window)
+      (.-mozRequestAnimationFrame js/window)
+      (.-oRequestAnimationFrame js/window)
+      (.-msRequestAnimationFrame js/window)
+      (fn [callback] (js/setTimeout callback 17))))


Add Home Title

Add Home Title

--- src/cljs/lens/navbar.cljs
+++ src/cljs/lens/navbar.cljs
@@ -96,6 +96,7 @@
       (d/div {:class "container-fluid"}
         (d/div {:class "navbar-header"}
           (d/a {:class "navbar-brand" :href "#"
+                :title "Home"
                 :on-click (h (bus/publish! owner :route {:handler :index}))}
             "Lens"))
         (om/build nav (:nav navbar))


Add `[]` to String instances

Add `[]` to String instances

--- src/clojure_ruby/core.clj
+++ src/clojure_ruby/core.clj
@@ -43,7 +43,10 @@
 (defn create-string [s]
   {:data s
    :methods {"size" (fn string-size [this]
-                      (create-number (count (:data this))))}
+                      (create-number (count (:data this))))
+             "[]" (fn string-bracket [this idx]
+                    (let [idx (host-send idx :number)]
+                      (create-string (subs (:data this) idx (inc idx)))))}
    :host-methods {:string (fn string-host-string [this] (:data this))}})

 (def Array


Store home pane in project-panes so it doesn't appear in the tab list

--- src/net/sekao/nightcode/projects.clj
+++ src/net/sekao/nightcode/projects.clj
@@ -124,9 +124,9 @@
       (getPath []
         path)
       (getPane [runtime-state-atom _]
-        (let [pane (or (get-in @runtime-state-atom [:editor-panes path])
+        (let [pane (or (get-in @runtime-state-atom [:project-panes path])
                        (home-pane @runtime-state-atom))]
-          (swap! runtime-state-atom update :editor-panes assoc path pane)
+          (swap! runtime-state-atom update :project-panes assoc path pane)
           pane)))))

 (defn root-node [pref-state]


deploy command working

deploy command working

--- kuzushi/src/gaeshi/kuzushi/commands/deploy.clj
+++ kuzushi/src/gaeshi/kuzushi/commands/deploy.clj
@@ -49,17 +49,18 @@
     (config-help)))

 (defn deploy [project options]
-  (apply println "Gaeshi:" (:environment options) "deployment requested...")
+  (println "Gaeshi:" (:environment options) "deployment requested...")
   (let [config (read-deploy-config project)
         _ (check-required-config config)
         windows? (re-find #"Windows" (System/getProperty "os.name"))
         deploy-exe (str/join (System/getProperty "file.separator") [(:appengine-sdk-dir config) "bin" (if windows? "appcfg.cmd" "appcfg.sh")])]
-    (apply prepare project options)
+    (prepare project options)
     (println "Gaeshi: Invoking deploy command")
     (exec [deploy-exe (str "--email=" (:appengine-email config)) "--passin" "update" "war"] (:appengine-password config))))

 (defn execute
   "Deploy the project to Google AppEngine"
   [options]
-  (let [project (load-lein-project)]
+  (let [project (load-lein-project)
+        options (assoc options :environment (or (:environment options) "development"))]
     (deploy project options)))


Fix route spec for key regex

Fix route spec for key regex

In 6d2eb698, the route parameter was named from ks to k, but the associated
regex validator wasn't updated. This applies the regex as expected.

--- src/poky/protocol/http/jdbc/text.clj
+++ src/poky/protocol/http/jdbc/text.clj
@@ -33,15 +33,15 @@
   [kvstore]
   (let [api-routes
         (routes
-          (GET ["/:k" :ks valid-key-regex] {{:keys [k] :as params} :params body :body headers :headers}
+          (GET ["/:k" :k valid-key-regex] {{:keys [k] :as params} :params body :body headers :headers}
                (wrap-get kvstore k params headers body))
-          (PUT ["/:k" :ks valid-key-regex] {{:keys [k] :as params} :params
-                                             body :body body-params :body-params headers :headers}
+          (PUT ["/:k" :k valid-key-regex] {{:keys [k] :as params} :params
+                                             body :body body-params :body-params headers :headers}
                (let [body (slurp body)
                      body (if (empty? body) body-params body)]
                  (wrap-put kvstore k params headers body)))
-          (POST ["/:k" :ks valid-key-regex] {{:keys [k] :as params} :params
-                                             body :body body-params :body-params headers :headers}
+          (POST ["/:k" :k valid-key-regex] {{:keys [k] :as params} :params
+                                             body :body body-params :body-params headers :headers}
                (let [body (slurp body)
                      body (if (empty? body) body-params body)]
                  (wrap-put kvstore k params headers body)))


Bugfix: possible-states generation

Bugfix: possible-states generation

--- src/connect5_ai/core.clj
+++ src/connect5_ai/core.clj
@@ -1,6 +1,7 @@
 (ns connect5-ai.core
   (:require [clojure.core.async :as async]
-            clojure.set)
+            clojure.set
+            clojure.data.priority-map)
   (:gen-class))

 ;(defn -main [& args])
@@ -81,7 +82,7 @@
   ""
   [state grid-width grid-height is-first-player]
   (let [possible-moves (gen-children-points state grid-width grid-height)
-        possible-states (map generate-world-from-position possible-moves is-first-player)]
+        possible-states (map #(generate-world-from-position state % is-first-player) possible-moves)]
     (reduce #(assoc %1 %2 (heuristic grid-width grid-height is-first-player %2))
             (clojure.data.priority-map/priority-map)
             possible-states)))


Hey kids, don't forget to push!

Hey kids, don't forget to push!

--- src/connect5_ai/core.clj
+++ src/connect5_ai/core.clj
@@ -25,7 +25,7 @@
         (= (.indexOf (rest list-to-check) :wall) -1))
     (let [count-in-list (reduce #(+ %1 (if (= %2 player) 1 0)) 0 list-to-check)]
       (if (< count-in-list 3)
-        count-in-list
+        (Math/pow 2 count-in-list)
         1000))
     0))

@@ -291,12 +291,10 @@
   (defn negamax
     ""
     [is-first-player state timeout grid-width grid-height]
-    ; Return if timeout
-    (let [[negamax-value move] (negamax-inner state Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY timeout is-first-player 1 grid-width grid-height)]
+    ; TODO Return if timeout
+    (let [[negamax-value move] (negamax-inner state Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY timeout is-first-player 4 grid-width grid-height)]
       (prn "Negamax-value" negamax-value)
-      (if is-first-player
-        move
-        (second (negamax-inner state Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY timeout is-first-player 1 grid-width grid-height))))) ; TODO: WTF
+        move))

   (defn -getNextMove
     "Gets the next best move"


Drawing lines.

Drawing lines.

--- src/constraint/core.cljs
+++ src/constraint/core.cljs
@@ -1,33 +1,40 @@
 (ns constraint.core
   (:require [dommy.core :as dommy]
-            [crate.core :as crate]))
+            [crate.core :as crate]
+            [clojure.string :as string]))
+
+(def triangle-marker
+  [:svg:marker
+   {:id "Triangle"
+    :viewBox "0 0 10 10"
+    :refX "1"
+    :refY "5"
+    :markerWidth "6"
+    :markerHeight "6"
+    :orient "auto"}
+   [:svg:path {:d "M0,0 L 10,5 L0,10 z"}]]
+  )
+
+(defn make-line-dirs [from to]
+  (let [middle (map (comp #(/ % 2) +) from to)
+        coords (map (partial string/join ",") [from middle to])]
+    (string/join " " (map str ["M" "L" "L"] coords))))
+
+
+(defn line [from to color]
+  [:svg:path
+   {:d (make-line-dirs from to)
+    :stroke color
+    :stroke-width "4px"
+    :fill "none"
+    :marker-mid "url(#Triangle)"}])
+

 (.appendChild (dommy.core/sel1 :.forsvg)
-              (crate/html [:svg:svg
-                           {:width 1000 :height 1000}
-                           [:svg:defs
-                            [:svg:marker
-                             {:id "Triangle"
-                              :viewBox "0 0 10 10"
-                              :refX "1"
-                              :refY "5"
-                              :markerWidth "6"
-                              :markerHeight "6"
-                              :orient "auto"}
-                             [:svg:path {:d "M0,0 L 10,5 L0,10 z"}]]
-                            ]
-                           [:svg:path
-                            {:d "M100,20 L150,20 L200,20"
-                             :stroke "#6666ff"
-                             :stroke-width "4px"
-                             :fill "none"
-                             :marker-mid "url(#Triangle)"}]
-                           [:svg:path
-                            {:d "M200,40 L150,60 L100,80"
-                             :stroke "#6666ff"
-                             :stroke-width "4px"
-                             :fill "none"
-                             :marker-mid "url(#Triangle)"}]
+              (crate/html [:svg:svg {:width 1000 :height 1000}
+                           [:svg:defs triangle-marker]
+                           (line [100, 20] [200, 40] "#6666ff")
+                           (line [200, 40] [100, 80] "red")
                            [:svg:circle {:id "button"
                                          :fill "yellow"
                                          :stroke "green"


deactivating load file when modifying ns. we might want to activate it again for cljc code...

--- src/clj/rksm/cloxp_cljs/compilation.clj
+++ src/clj/rksm/cloxp_cljs/compilation.clj
@@ -56,9 +56,9 @@

 (defn compile-cljs-in-project
   [changed-ns file project-dir new-source old-source & [compiler-env]]
-
-  (repl/load-file new-source (str file) {:old-source old-source})
-
+
+  ; (repl/load-file new-source (str file) {:old-source old-source})
+
   (let [build-opts (default-build-options project-dir)
         compiler-env (or compiler-env env/*compiler* (env/default-compiler-env))]
     (cljs.closure/build project-dir build-opts compiler-env)
@@ -67,8 +67,8 @@
        (rksm.system-files/file file)
        build-opts)
       #_(cljs.closure/compile-file
-       (rksm.system-files/file file)
-       build-opts))))
+         (rksm.system-files/file file)
+         build-opts))))

 (comment


More calc

More calc

--- src/clj_simple_chart/ssb/data/elbil.clj
+++ src/clj_simple_chart/ssb/data/elbil.clj
@@ -20,10 +20,12 @@
                ;(map #(update % :dato (fn [d] (str d "-12"))))
                (column-value->column :drivstoff)
                (contract-by-column :dato)
-               (div-by 1000)))
-               ;(add-sum-column)))
+               (div-by 1000)
+               ;(map #(assoc % :el-hybrid (+ (:elektrisk %) (:annet %))))
+               ;(drop-columns [:elektrisk :annet])
+               (add-sum-column)
                ;(add-relative-share)))
-               ;(yoy-change)))
+               (yoy-change)))

 (def fossil (->> (ssb/fetch 7849
                             {"Region" "Oslo"
@@ -36,8 +38,10 @@
                  (map #(update % :drivstoff (fn [d] (get drivstoff-translate d d))))
                  (column-value->column :drivstoff)
                  (contract-by-column :dato)
-                 (add-sum-column)))
+                 (add-sum-column)
                  ;(yoy-change)
+                 (drop-while #(not= "2013" (:dato %)))))
+                 ;(map :sum) (reduce + 0)))
                  ;(keep-columns [:dato :sum])))

 ;(yoy-change)))


add mobile menu foldout

add mobile menu foldout

--- src/cljs/daveconservatoire/site/ui.cljs
+++ src/cljs/daveconservatoire/site/ui.cljs
@@ -187,7 +187,7 @@
             (dom/div #js {:className "row"}
               (dom/div #js {:className "span6"}
                 (dom/div #js {:className "copyright" :style #js {:paddingTop 10}}
-                  "© Dave Conservatoire 2016. The videos and exercises on this site are available under a "
+                  "© Dave Conservatoire " (str (.getFullYear (js/Date.))) ". The videos and exercises on this site are available under a "
                   (dom/a #js {:href "http://creativecommons.org/licenses/by-nc-sa/3.0/", :target "_blank"}
                     "CC BY-NC-SA Licence") "."))
               (dom/div #js {:className "span6"}
@@ -282,10 +282,91 @@
                                                       :post-mutation-params {:ref (om/get-ident this)}}))
     400))

+(defn mobile-menu [this]
+  (let [{:keys    [user/score lesson/search lesson/search-swap]
+         :ui/keys [search-cursor search-text expanded?]
+         :as      props} (om/props this)]
+    (dom/div #js {:className "header visible-phone"}
+      (dom/div #js {:className "navbar"}
+        (dom/div #js {:className "navbar-inner"}
+          (dom/div #js {:className "container"}
+            (dom/a #js {:className "btn btn-navbar collapsed"
+                        :onClick   #(um/set-value! this :ui/expanded? (not expanded?))}
+              (dom/span #js {:className "icon-bar"})
+              (dom/span #js {:className "icon-bar"})
+              (dom/span #js {:className "icon-bar"}))
+            (dom/a #js {:className "brand mobilenav" :href "http://daveconservatoire.org"}
+              (dom/span #js {:className "mobiledc"} "Dave Conservatoire"))
+            (dom/div #js {:className "nav-collapse navbar-responsive-collapse collapse"
+                          :id        "mainfoldout"
+                          :style     (cond-> {:zindex 1000 :transition "all 500ms" :height "0px"}
+                                       expanded? (assoc :height "236px")
+                                       true clj->js)}
+              (dom/ul #js {:className "nav"}
+                (button-block {:react-key "btn-0" ::r/handler ::r/about, ::button-color "yellow"} "About")
+                (button-block {:react-key "btn-1" ::r/handler ::r/donate, ::button-color "orange"} "Donate")
+                (button-block {:react-key "btn-2" ::r/handler ::r/tuition, ::button-color "redorange"} "Personal Tuition")
+                (button-block {:react-key "btn-3" ::r/handler ::r/contact, ::button-color "red"} "Contact")
+                (dom/form #js {:className "navbar-form"
+                               :onSubmit  #(.preventDefault %)}
+                  (dom/button #js {:type "submit" :style #js {:display "none"}})
+                  (dom/div #js {:style #js {:width    "100%"
+                                            :position "relative"}}
+                    (dom/div #js {:style #js {:background "#fff"
+                                              :border     "1px solid #ccc"
+                                              :display    "flex"
+                                              :width      "100%"
+                                              :maxHeight  "600px"
+                                              :position   "absolute"
+                                              :boxSizing  "border-box"
+                                              :top        28
+                                              :zIndex     "10"}}
+                      (if (df/loading? (:ui/fetch-state search-swap))
+                        "Loading...")
+                      (if (> (count search) 0)
+                        (cursor/vertical-cursor
+                          (om/computed search-cursor
+                                       {::cursor/children search
+                                        ::cursor/factory  popup-search-result
+                                        ::l/target        #(gobj/get this "search-input")}))))
+
+                    (dom/input #js {:value       (or search-text "")
+                                    :style       #js {:boxSizing "border-box"
+                                                      :border    "1px solid #ccc"
+                                                      :width     "100%"}
+                                    :key         "search-input"
+                                    :ref         (fn [el]
+                                                   (when el
+                                                     (gobj/set this "search-input" (dom/node el))))
+                                    :placeholder "Search"
+                                    :onInput     #(do
+                                                    (um/set-string! this :ui/search-text :event %)
+                                                    (let [txt (.. % -target -value)]
+                                                      (if (> (count txt) 2)
+                                                        (update-search this txt)
+                                                        (um/set-value! this :lesson/search []))))})
+                    (l/simple-listener {::l/target     #(gobj/get this "search-input")
+                                        ::l/event      "keydown"
+                                        ::l/on-trigger (l/handle-key-events
+                                                         {:escape #(um/set-value! this :lesson/search [])})})))
+                (if (signed-in? props)
+                  (user-menu-status this)
+                  (if (> score 0)
+                    (button-block {:className  "btn btn-success loginbutton"
+                                   :react-key  "btn-4"
+                                   ::r/handler ::r/login}
+                                  (dom/i #js {:className "icon-exclamation-sign icon-white" :style #js {:marginRight 5}})
+                                  score " unclaimed points. Login to save your progress")
+                    (button-block {:react-key "btn-4" ::r/handler ::r/login :className "loginbutton", ::button-color "red"}
+                                  "Login")))))
+
+            ))))))
+
 (om/defui ^:once DesktopMenu
   static uc/InitialAppState
   (initial-state [_ _]
-    {:db/id (om/tempid) :db/table :user :ui/fetch-state {}})
+    {:db/id (om/tempid) :db/table :user :ui/fetch-state {}
+     :ui/expanded? false})

   static om/Ident
   (ident [_ props]
@@ -296,178 +377,89 @@
               {:lesson/search (om/get-query LessonCell)}
               {:lesson/search-swap [:ui/fetch-state]}
               {'[:ui/search-cursor _] (om/get-query cursor/VerticalCursor)}
-              :ui/search-text])
+              :ui/search-text :ui/expanded?])

   Object
   (render [this]
     (let [{:keys    [user/score lesson/search lesson/search-swap]
            :ui/keys [search-cursor search-text]
            :as      props} (om/props this)]
-      (dom/div #js {:className "header hidden-phone"}
-        (dom/div #js {:className "navbar"}
-          (dom/div #js {:className "navbar-inner"}
-            (dom/div #js {:className "container"}
-              (link {:id "desktopbrand", :className "brand", ::r/handler ::r/home}
-                (dom/img #js {:src "/img/dclogo3.png" :alt "Dave Conservatoire" :key "logo"}))
-              (dom/div #js {:className "navbar"}
-                (dom/div #js {:className "navbuttons"}
-                  (button {:react-key "btn-0" ::r/handler ::r/about, ::button-color "yellow"} "About")
-                  (button {:react-key "btn-1" ::r/handler ::r/donate, ::button-color "orange"} "Donate")
-                  (button {:react-key "btn-2" ::r/handler ::r/tuition, ::button-color "redorange"} "Personal Tuition")
-                  (button {:react-key "btn-3" ::r/handler ::r/contact, ::button-color "red"} "Contact")
-                  (dom/form #js {:className "navbar-form"
-                                 :onSubmit  #(.preventDefault %)}
-                    (dom/button #js {:type "submit" :style #js {:display "none"}})
-                    (dom/div #js {:style #js {:width    "80%"
-                                              :position "relative"}}
-                      (dom/div #js {:style #js {:background "#fff"
-                                                :border     "1px solid #ccc"
-                                                :display    "flex"
-                                                :width      "100%"
-                                                :maxHeight  "600px"
-                                                :position   "absolute"
-                                                :boxSizing  "border-box"
-                                                :top        28
-                                                :zIndex     "10"}}
-                        (if (df/loading? (:ui/fetch-state search-swap))
-                          "Loading...")
-                        (if (> (count search) 0)
-                          (cursor/vertical-cursor
-                            (om/computed search-cursor
-                                         {::cursor/children search
-                                          ::cursor/factory  popup-search-result
-                                          ::l/target        #(gobj/get this "search-input")}))))
-
-                      (dom/input #js {:value       (or search-text "")
-                                      :style       #js {:boxSizing "border-box"
-                                                        :border    "1px solid #ccc"
-                                                        :width     "100%"}
-                                      :key         "search-input"
-                                      :ref         (fn [el]
-                                                     (when el
-                                                       (gobj/set this "search-input" (dom/node el))))
-                                      :placeholder "Search"
-                                      :onInput     #(do
-                                                      (um/set-string! this :ui/search-text :event %)
-                                                      (let [txt (.. % -target -value)]
-                                                        (if (> (count txt) 2)
-                                                          (update-search this txt)
-                                                          (um/set-value! this :lesson/search []))))})
-                      (l/simple-listener {::l/target     #(gobj/get this "search-input")
-                                          ::l/event      "keydown"
-                                          ::l/on-trigger (l/handle-key-events
-                                                           {:escape #(um/set-value! this :lesson/search [])
-                                                            :return #(let [{:keys [ui/search-cursor lesson/search]} (om/props this)
-                                                                           {:keys [url/slug]} (nth search (:ui/selected-index search-cursor))
-                                                                           path (r/path-for {::r/handler ::r/lesson
-                                                                                ::r/params  {::r/slug slug}})]
-                                                                       (pushy/set-token! daveconservatoire.site.main/history path))})})))
-                  (if (signed-in? props)
-                    (user-menu-status this)
-                    (if (> score 0)
-                      (button {:className  "btn btn-success loginbutton"
-                               :react-key  "btn-4"
-                               ::r/handler ::r/login}
-                        (dom/i #js {:className "icon-exclamation-sign icon-white" :style #js {:marginRight 5}})
-                        score " unclaimed points. Login to save your progress")
-                      (button {:react-key "btn-4" ::r/handler ::r/login :className "loginbutton", ::button-color "red"}
-                        "Login"))))))))))))
+      (dom/div nil
+        (dom/div #js {:className "header hidden-phone"}
+         (dom/div #js {:className "navbar"}
+           (dom/div #js {:className "navbar-inner"}
+             (dom/div #js {:className "container"}
+               (link {:id "desktopbrand", :className "brand", ::r/handler ::r/home}
+                 (dom/img #js {:src "/img/dclogo3.png" :alt "Dave Conservatoire" :key "logo"}))
+               (dom/div #js {:className "navbar"}
+                 (dom/div #js {:className "navbuttons"}
+                   (button {:react-key "btn-0" ::r/handler ::r/about, ::button-color "yellow"} "About")
+                   (button {:react-key "btn-1" ::r/handler ::r/donate, ::button-color "orange"} "Donate")
+                   (button {:react-key "btn-2" ::r/handler ::r/tuition, ::button-color "redorange"} "Personal Tuition")
+                   (button {:react-key "btn-3" ::r/handler ::r/contact, ::button-color "red"} "Contact")
+                   (dom/form #js {:className "navbar-form"
+                                  :onSubmit  #(.preventDefault %)}
+                     (dom/button #js {:type "submit" :style #js {:display "none"}})
+                     (dom/div #js {:style #js {:width    "80%"
+                                               :position "relative"}}
+                       (dom/div #js {:style #js {:background "#fff"
+                                                 :border     "1px solid #ccc"
+                                                 :display    "flex"
+                                                 :width      "100%"
+                                                 :maxHeight  "600px"
+                                                 :position   "absolute"
+                                                 :boxSizing  "border-box"
+                                                 :top        28
+                                                 :zIndex     "10"}}
+                         (if (df/loading? (:ui/fetch-state search-swap))
+                           "Loading...")
+                         (if (> (count search) 0)
+                           (cursor/vertical-cursor
+                             (om/computed search-cursor
+                                          {::cursor/children search
+                                           ::cursor/factory  popup-search-result
+                                           ::l/target        #(gobj/get this "search-input")}))))
+
+                       (dom/input #js {:value       (or search-text "")
+                                       :style       #js {:boxSizing "border-box"
+                                                         :border    "1px solid #ccc"
+                                                         :width     "100%"}
+                                       :key         "search-input"
+                                       :ref         (fn [el]
+                                                      (when el
+                                                        (gobj/set this "search-input" (dom/node el))))
+                                       :placeholder "Search"
+                                       :onInput     #(do
+                                                       (um/set-string! this :ui/search-text :event %)
+                                                       (let [txt (.. % -target -value)]
+                                                         (if (> (count txt) 2)
+                                                           (update-search this txt)
+                                                           (um/set-value! this :lesson/search []))))})
+                       (l/simple-listener {::l/target     #(gobj/get this "search-input")
+                                           ::l/event      "keydown"
+                                           ::l/on-trigger (l/handle-key-events
+                                                            {:escape #(um/set-value! this :lesson/search [])
+                                                             :return #(let [{:keys [ui/search-cursor lesson/search]} (om/props this)
+                                                                            {:keys [url/slug]} (nth search (:ui/selected-index search-cursor))
+                                                                            path (r/path-for {::r/handler ::r/lesson
+                                                                                ::r/params  {::r/slug slug}})]
+                                                                        (pushy/set-token! daveconservatoire.site.main/history path))})})))
+                   (if (signed-in? props)
+                     (user-menu-status this)
+                     (if (> score 0)
+                       (button {:className  "btn btn-success loginbutton"
+                                :react-key  "btn-4"
+                                ::r/handler ::r/login}
+                         (dom/i #js {:className "icon-exclamation-sign icon-white" :style #js {:marginRight 5}})
+                         score " unclaimed points. Login to save your progress")
+                       (button {:react-key "btn-4" ::r/handler ::r/login :className "loginbutton", ::button-color "red"}
+                         "Login")))))))))
+
+        (mobile-menu this)))))

 (def desktop-menu (om/factory DesktopMenu))

-(om/defui ^:once MobileMenu
-  static uc/InitialAppState
-  (initial-state [_ _]
-    {:db/id (om/tempid) :db/table :user :ui/fetch-state {}})
-
-  static om/Ident
-  (ident [_ props]
-    (u/model-ident props))
-
-  static om/IQuery
-  (query [_] [:db/id :db/table :user/name :user/score
-              {:lesson/search (om/get-query LessonCell)}
-              {:lesson/search-swap [:ui/fetch-state]}
-              {'[:ui/search-cursor _] (om/get-query cursor/VerticalCursor)}
-              :ui/search-text])
-
-  Object
-  (render [this]
-    (let [{:keys    [user/score lesson/search lesson/search-swap]
-           :ui/keys [search-cursor search-text]
-           :as      props} (om/props this)]
-      (dom/div #js {:className "header visible-phone"}
-        (dom/div #js {:className "navbar"}
-          (dom/div #js {:className "navbar-inner"}
-            (dom/div #js {:className "container"}
-              (dom/a #js {:className "btn btn-navbar collapsed" :data-toggle "collapse" :data-target "#mainfoldout"}
-                (dom/span #js {:className "icon-bar"})
-                (dom/span #js {:className "icon-bar"})
-                (dom/span #js {:className "icon-bar"}))
-              (dom/a #js {:className "brand mobilenav" :href "http://daveconservatoire.org"}
-                (dom/span #js {:className "mobiledc"} "Dave Conservatoire"))
-              (dom/div #js {:className "nav-collapse navbar-responsive-collapse collapse" :id "mainfoldout" :style #js {:height "100%" :zindex 1000}}
-                (dom/ul #js {:className "nav"}
-                  (button-block {:react-key "btn-0" ::r/handler ::r/about, ::button-color "yellow"} "About")
-                  (button-block {:react-key "btn-1" ::r/handler ::r/donate, ::button-color "orange"} "Donate")
-                  (button-block {:react-key "btn-2" ::r/handler ::r/tuition, ::button-color "redorange"} "Personal Tuition")
-                  (button-block {:react-key "btn-3" ::r/handler ::r/contact, ::button-color "red"} "Contact")
-                  (dom/form #js {:className "navbar-form"
-                                 :onSubmit  #(.preventDefault %)}
-                    (dom/button #js {:type "submit" :style #js {:display "none"}})
-                    (dom/div #js {:style #js {:width    "100%"
-                                              :position "relative"}}
-                      (dom/div #js {:style #js {:background "#fff"
-                                                :border     "1px solid #ccc"
-                                                :display    "flex"
-                                                :width      "100%"
-                                                :maxHeight  "600px"
-                                                :position   "absolute"
-                                                :boxSizing  "border-box"
-                                                :top        28
-                                                :zIndex     "10"}}
-                        (if (df/loading? (:ui/fetch-state search-swap))
-                          "Loading...")
-                        (if (> (count search) 0)
-                          (cursor/vertical-cursor
-                            (om/computed search-cursor
-                                         {::cursor/children search
-                                          ::cursor/factory  popup-search-result
-                                          ::l/target        #(gobj/get this "search-input")}))))
-
-                      (dom/input #js {:value       (or search-text "")
-                                      :style       #js {:boxSizing "border-box"
-                                                        :border    "1px solid #ccc"
-                                                        :width     "100%"}
-                                      :key         "search-input"
-                                      :ref         (fn [el]
-                                                     (when el
-                                                       (gobj/set this "search-input" (dom/node el))))
-                                      :placeholder "Search"
-                                      :onInput     #(do
-                                                      (um/set-string! this :ui/search-text :event %)
-                                                      (let [txt (.. % -target -value)]
-                                                        (if (> (count txt) 2)
-                                                          (update-search this txt)
-                                                          (um/set-value! this :lesson/search []))))})
-                      (l/simple-listener {::l/target     #(gobj/get this "search-input")
-                                          ::l/event      "keydown"
-                                          ::l/on-trigger (l/handle-key-events
-                                                           {:escape #(um/set-value! this :lesson/search [])})})))
-                  (if (signed-in? props)
-                    (user-menu-status this)
-                    (if (> score 0)
-                      (button-block {:className  "btn btn-success loginbutton"
-                                     :react-key  "btn-4"
-                                     ::r/handler ::r/login}
-                                    (dom/i #js {:className "icon-exclamation-sign icon-white" :style #js {:marginRight 5}})
-                                    score " unclaimed points. Login to save your progress")
-                      (button-block {:react-key "btn-4" ::r/handler ::r/login :className "loginbutton", ::button-color "red"}
-                                    "Login")))))
-
-              )))))))
-
-(def mobile-menu (om/factory MobileMenu))
+

 (defn course-banner [{:keys [title intro]}]
   (dom/div #js {:className "banner"}
@@ -1563,7 +1555,6 @@
                    (contains? banner-routes (::r/handler route)))
           (banner))
         (desktop-menu (assoc me :react-key "desktop-menu"))
-        (mobile-menu (assoc me :react-key "mobile-menu"))
         (if route
           ((u/route->factory route) data))
         (footer {:react-key "footer"})))))


fullscreen function

fullscreen function

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -247,6 +247,33 @@
           expand-fn (fn [] (resize-fn (.-innerWidth js/window)
                                       (.-innerHeight js/window)))

+          ;; remember: fullscreen call will only work when
+          ;; its called from a gesture. Like an on-click.
+          fullscreen-fn (fn [fullscreen]
+                          (if fullscreen
+                            (cond
+                              (.-requestFullscreen canvas)
+                              (.requestFullscreen canvas)
+
+                              (.-webkitRequestFullscreen canvas)
+                              (.webkitRequestFullscreen canvas)
+
+                              (.-mozRequestFullScreen canvas)
+                              (.mozRequestFullScreen canvas))
+
+                            (cond
+                              (.-exitFullscreen document)
+                              (.exitFullscreen document)
+
+                              (.-webkitExitFullscreen document)
+                              (.webkitExitFullscreen document)
+
+                              (.-msExitFullscreen document)
+                              (.msExitFullscreen document)
+
+                              (.-mozCancelFullScreen document)
+                              (.mozCancelFullScreen document))))
+
           resizer-loop
           (when (:expand opts) (let [c (events/new-resize-chan)]
                                  (go (while true


add helper function for Kryo registration of classes which might not even be available.

This is required for Spark 1.2 classes in Spark 1.1 runtime for example.

--- src/clojure/sparkling/serialization.clj
+++ src/clojure/sparkling/serialization.clj
@@ -56,7 +56,12 @@
   (register kryo (Class/forName "[Z"))                      ;; boolean array
   )

-
+(defn register-optional [kryo classname]
+  (when-let [clazz (try (Class/forName classname)
+                        (catch Exception _
+                          ;ignore, because not finding this class is exactly what I'm up to!
+                          nil))]
+    (register kryo clazz)))

 (defn register-java-class-serializers [^Kryo kryo]
   (register kryo BigInteger)


removed unneccessary logging

removed unneccessary logging

--- src/clojure/sparkling/serialization.clj
+++ src/clojure/sparkling/serialization.clj
@@ -120,7 +120,7 @@
   (require 'carbonite.api)
   (require 'sparkling.serializers)

-  (log/info "Registering base classes for kryo")
+  ;(log/info "Registering base classes for kryo")
   (carbonite/default-registry kryo)
   (carbonite/register-serializers kryo (serializer/sorted-collections))
   (carbonite/register-serializers kryo (serializer/joda-serializers))
@@ -146,7 +146,7 @@
           (log/warn (str "Error registering serializer" this) e)
           (catch Exception e1
             ;(binding [*out* *err*]
-              (println "Failed to not log properly the expetion " e " while registering classes from " this " to " kryo ".\nLogging failure was " e1 ".")
+            (println "Failed to not log properly the expetion " e " while registering classes from " this " to " kryo ".\nLogging failure was " e1 ".")
             ;)
             (.printStackTrace e)
             ))


fold in additional lost changes: prog name print, error msgs

--- src/clojure/zensols/actioncli/parse.clj
+++ src/clojure/zensols/actioncli/parse.clj
@@ -34,6 +34,11 @@
   with [[multi-action-context]] or [[single-action-context]]"
   nil)

+(def ^:dynamic *include-program-in-errors*
+  "If non-nil add program name to error and warning messages
+  in [[handle-exception]] and [[error-message]] and [[print-error-message]]."
+  true)
+
 (defa- program-name-inst "prog")

 (defn program-name
@@ -43,7 +48,9 @@
   @program-name-inst)

 (defn- program-fmt []
-  (let [name (program-name)]
+  (let [name (if *include-program-in-errors*
+               (str (program-name) ": ")
+               "")]
     (if name
       (str name ": ")
       "")))
@@ -215,15 +222,20 @@
     (apply action opts args)))

 (defn handle-exception
-  "Handle exceptions thrown from CLI actions."
+  "Handle exceptions thrown from CLI actions.
+
+  See:
+
+  * [[*include-program-in-errors*]]
+  * [[*rethrow-error*]]
+  * [[*log-error*]]"
   [e]
   (log/debugf "handle exception: <%s>" e)
   (let [msg (.getMessage e)]
     (if *log-error* (log/error e "action line parse error"))
-    (if (instance? java.io.FileNotFoundException e)
-      (binding [*out* *err*]
-        (println (format "%sio error: %s" (program-fmt) msg)))
-      (binding [*out* *err*]
+    (binding [*out* *err*]
+      (if (instance? java.io.FileNotFoundException e)
+        (println (format "%sio error: %s" (program-fmt) msg))
         (println (format "%serror: %s"
                          (program-fmt)
                          (if ex-data
@@ -254,6 +266,12 @@
     (str (program-fmt) (first errors))
     (str "The following errors occurred while parsing your action:\n\n"
          (s/join \newline errors))))
+
+(defn print-error-message
+  "Print errors messages generated by [[error-message]]."
+  [errors]
+  (binding [*out* *err*]
+    (println (error-msg errors))))

 (defn- parse-single [action-context actions action action-key
                      arguments single-action-mode?


added gen-auth-url

added gen-auth-url

--- src/saved_for_reddit/reddit-api.cljs
+++ src/saved_for_reddit/reddit-api.cljs
@@ -1,11 +1,22 @@
 (ns saved-for-reddit.reddit-api
   (:require [reagent.core :as r]
             [cljs-http.client :as http]
-            [cljs.core.async :refer [<!]])
+            [cljs.core.async :refer [<!]]
+            [cemerick.url :as url])
   (:require-macros [cljs.core.async.macros :refer [go]]))

 (def client-id "ZZ370hqcmUVsRQ")
 (def redirect-uri "http://127.0.0.1:3449/")
+
+(defn gen-auth-url []
+  (let [cem-url (url/url "https://www.reddit.com/api/v1/authoriz"
+                         :query  {:client_id client-id
+                                  :response_type "code"
+                                  :state "abcdef"
+                                  :redirect_uri redirect-uri
+                                  :duration "temporary"
+                                  :scope "save"} )]
+    (str cem-url)))

 (defn make-remote-call [endpoint]
   (go (let [response (<! (http/get endpoint {:with-credentials? false}))]


latest subs with nested validations merging fix


closing #10. cljs is now supported in 0.1.6


Reformat project.clj

Reformat project.clj


make sure we use the datomic branch of navigator


updated project

updated project


Bump beta-11

Bump beta-11


Version bump.

Version bump.


Update version info and deploy to clojars.

--- project.clj
+++ project.clj
@@ -1,5 +1,5 @@
-;(defproject cli4clj "1.6.3"
-(defproject cli4clj "1.6.4-SNAPSHOT"
+(defproject cli4clj "1.7.0"
+;(defproject cli4clj "1.7.1-SNAPSHOT"
   :description "Create simple interactive CLIs for Clojure applications."
   :url "https://github.com/ruedigergad/cli4clj"
   :license {:name "Eclipse Public License"


added url and description

added url and description

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (defproject moomoo "0.1.0-SNAPSHOT"
-  :description "FIXME: write this!"
-  :url "http://example.com/FIXME"
+  :description "Listen to music with friends."
+  :url "https://github.com/vheuken/moomoo"

   :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.clojure/clojurescript "1.7.170"]
@@ -18,7 +18,7 @@
                        [hiredis "0.4.1"]
                        [socket.io-stream "0.9.0"]
                        [uuid "2.0.1"]
-                       [express "4.13"]
+                       [express "4.13.3"]
                        [jade "1.11"]
                        [musicmetadata "2.0"]
                        [base64-arraybuffer "0.1.2"]
@@ -27,7 +27,6 @@
                        [mhash "2.1.3"]
                        [toml "2.3.0"]
                        [watchr "2.4.13"]
-                       [mmmagic "0.4.1"]
                        [ws "0.8.0"]]}

   :plugins [[lein-cljsbuild "1.1.1"]


use new serversepc

use new serversepc

--- project.clj
+++ project.clj
@@ -8,7 +8,7 @@
                  [dda/dda-user-crate "1.0.5"]
                  [dda/dda-git-crate "1.1.3"]
                  [dda/dda-backup-crate "1.0.4"]
-                 [dda/dda-serverspec-crate "1.1.0"]]
+                 [dda/dda-serverspec-crate "1.1.1"]]
   :source-paths ["main/src"]
   :resource-paths ["main/resources"]
   :repositories [["snapshots" :clojars]


use react request animation frame

use react request animation frame

--- project.clj
+++ project.clj
@@ -2,9 +2,11 @@
   :description "A minimal, functional ClojureScript wrapper for ReactJS"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
+  :repositories [["snapshots" {:url "s3p://breezepackages/snapshots" :creds :gpg}]
+                 ["releases" {:url "s3p://breezepackages/releases" :creds :gpg}]]
   :dependencies [[org.clojure/clojure "1.5.1"]
                  [org.clojure/clojurescript "0.0-2173" :scope "provided"]
-                 [com.facebook/react "0.9.0.2"]]
+                 [com.facebook/react-raf "0.10.0"]]
   :source-paths ["src"]

   ;; development concerns


Version bump to release 0.3.0

Version bump to release 0.3.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject grafter/grafter "0.3.0-SNAPSHOT"
+(defproject grafter/grafter "0.3.0"
   :description "Tools for the hard graft of data processing"
   :url "http://grafter.org/"
   :license {:name "Eclipse Public License - v1.0"


Remove contrib

Remove contrib

--- project.clj
+++ project.clj
@@ -22,8 +22,6 @@
   :main omnibus.core
   :shell-wrapper true
   :dependencies [[org.clojure/clojure "1.2.0"]
-                 [org.clojure/clojure-contrib "1.2.0"]
-
                  [org.clojure/tools.cli "0.1.0"]
                  [org.clojure/data.json "0.1.1"]
                  [org.clojure/tools.logging "0.2.3"]


eddited top line

eddited top line

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.lighttable/clike "0.0.1"
+(defproject com.lighttable/java "0.0.1"
  :description "Java language plugin for Light Table"
  :dependencies [[org.clojure/clojure "1.5.1"]])


yuck!

yuck!

--- project.clj
+++ project.clj
@@ -6,6 +6,7 @@
                  [depot "0.1.3"]
                  [classlojure "0.5.2"]
                  [useful "0.4.0"]
-                 [org.clojure/tools.namespace "0.1.1"]
+                 [org.clojure/tools.namespace "0.1.1" :exclusions [org.clojure/java.classpath]]
+                 [org.clojars.ninjudd/java.classpath "0.1.2-SNAPSHOT"]
                  [com.jcraft/jsch "0.1.42"]]
   :copy-deps true)


link RDS to dev_sb profiles

link RDS to dev_sb profiles

--- project.clj
+++ project.clj
@@ -48,6 +48,10 @@
                                       :user     ~(System/getProperty "user.name")
                                       :password ""}
                        }
+             :dev_sb  {:jvm-opts ["-DLISTEN_PORT=8080"]
+                       :flyway   {:url      "jdbc:postgresql://modus-monolith-c63-dev.c8epalgxmd5k.eu-central-1.rds.amazonaws.com:5432/modus_dev"
+                                  :user     "modus_c63_dev"
+                                  :password "modus-c63-dev"}}
              :uberjar {:aot :all}
              }
   )


Remove main.

Remove main.

--- project.clj
+++ project.clj
@@ -22,13 +22,10 @@
   :dev-dependencies [[org.apache.hadoop/hadoop-core "0.20.2-dev"]
                      [incanter/incanter-charts "1.3.0-SNAPSHOT"]
                      [midje-cascalog "0.4.0"]]
-  :main forma.hadoop.cli
-  :aot [
-        forma.hadoop.pail
+  :aot [forma.hadoop.pail
         forma.hadoop.jobs.scatter
         forma.hadoop.jobs.preprocess
         forma.hadoop.jobs.modis
-        forma.hadoop.jobs.timeseries
-        ])
+        forma.hadoop.jobs.timeseries])


Release 0.25.3.

Release 0.25.3.

--- project.clj
+++ project.clj
@@ -6,7 +6,7 @@
 ;;   the terms of this license.
 ;;   You must not remove this notice, or any other, from this software.

-(defproject uncomplicate/neanderthal "0.25.3-SNAPSHOT"
+(defproject uncomplicate/neanderthal "0.25.3"
   :description "Neanderthal is a Clojure library for fast matrix and linear algebra computations."
   :url "https://github.com/uncomplicate/neanderthal"
   :scm {:name "git"


lein-release plugin: bumped version from 0.10 to 0.11-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject tyranitar "0.10"
+(defproject tyranitar "0.11-SNAPSHOT"
   :description "Tyranitar service"
   :url "http://wikis.in.nokia.com/NokiaMusicArchitecture/Tyranitar"


Fix a build error

Fix a build error

The key should be :target-version instead of :target-sdk. For some
Explicit JVM options make sure the resulting JAR can be DEXed.

--- project.clj
+++ project.clj
@@ -7,5 +7,6 @@
   :source-paths ["src" "src/clojure"]
   :java-source-paths ["src/java" "gen"]

+  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
   :android {:library true
-            :target-sdk :ics})
+            :target-version :ics})


Version 0.4.35-SNAPSHOT

Version 0.4.35-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject yetibot.core "0.4.34"
+(defproject yetibot.core "0.4.35-SNAPSHOT"
   :description "Core yetibot utilities, extracted for shared use among yetibot
                 and its various plugins"
   :url "https://github.com/yetibot/yetibot.core"


Released 0.5.2

Released 0.5.2

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject compojure "0.5.1"
+(defproject compojure "0.5.2"
   :description "A concise web framework for Clojure"
   :url "http://github/weavejester/compojure"
   :dependencies [[org.clojure/clojure "1.2.0"]


release 0.1.2

release 0.1.2

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject minhtuannguyen/cljocker "0.1.2-SNAPSHOT"
+(defproject minhtuannguyen/cljocker "0.1.2"
   :description "a dockerfile dsl written in clojure"
   :url ""
   :license {:name "Eclipse Public License"


lein-release plugin: preparing 0.118 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject maestro "0.118-SNAPSHOT"
+(defproject maestro "0.118"
   :description "Maestro service"
   :license  "https://github.com/mixradio/mr-maestro/blob/master/LICENSE"


Version 3.26.0-1-SNAPSHOT [ci skip]

Version 3.26.0-1-SNAPSHOT [ci skip]

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojush "3.26.0"
+(defproject clojush "3.26.0-1-SNAPSHOT"
   :description "The Push programming language and the PushGP genetic programming
                 system implemented in Clojure. See http://pushlanguage.com"
   :license {:name "Eclipse Public License"


Version 0.0.17-SNAPSHOT

Version 0.0.17-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject pe-fp-core "0.0.16"
+(defproject pe-fp-core "0.0.17-SNAPSHOT"
   :description "A Clojure library encapsulating the various domain objects associated with the fuel purchase application."
   :url "https://github.com/evanspa/pe-fp-core"
   :license {:name "MIT"


Bump dependencies

Bump dependencies

--- project.clj
+++ project.clj
@@ -12,7 +12,7 @@
             "profile" ["with-profile" "+profile" "run" "profile"]
             "h2" ["with-profile" "+h2-shell" "run" "-url" "jdbc:h2:./metabase.db" "-user" "" "-password" "" "-driver" "org.h2.Driver"]}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/core.async "0.2.395"]
+                 [org.clojure/core.async "0.3.442"]
                  [org.clojure/core.match "0.3.0-alpha4"]              ; optimized pattern matching library for Clojure
                  [org.clojure/core.memoize "0.5.9"]                   ; needed by core.match; has useful FIFO, LRU, etc. caching mechanisms
                  [org.clojure/data.csv "0.1.3"]                       ; CSV parsing / generation
@@ -25,7 +25,7 @@
                   :exclusions [org.clojure/clojure
                                org.clojure/clojurescript]]            ; fixed length queue implementation, used in log buffering
                  [amalloy/ring-gzip-middleware "0.1.3"]               ; Ring middleware to GZIP responses if client can handle it
-                 [aleph "0.4.1"]                                      ; Async HTTP library; WebSockets
+                 [aleph "0.4.3"]                                      ; Async HTTP library; WebSockets
                  [buddy/buddy-core "1.2.0"]                           ; various cryptograhpic functions
                  [buddy/buddy-sign "1.5.0"]                           ; JSON Web Tokens; High-Level message signing library
                  [cheshire "5.7.0"]                                   ; fast JSON encoding (used by Ring JSON middleware)
@@ -43,10 +43,10 @@
                                ring/ring-core]]
                  [com.draines/postal "2.0.2"]                         ; SMTP library
                  [com.google.apis/google-api-services-analytics       ; Google Analytics Java Client Library
-                  "v3-rev136-1.22.0"]
+                  "v3-rev139-1.22.0"]
                  [com.google.apis/google-api-services-bigquery        ; Google BigQuery Java Client Library
-                  "v2-rev334-1.22.0"]
-                 [com.h2database/h2 "1.4.193"]                        ; embedded SQL database
+                  "v2-rev342-1.22.0"]
+                 [com.h2database/h2 "1.4.194"]                        ; embedded SQL database
                  [com.mattbertolini/liquibase-slf4j "2.0.0"]          ; Java Migrations lib
                  [com.mchange/c3p0 "0.9.5.2"]                         ; connection pooling library
                  [com.novemberain/monger "3.1.0"]                     ; MongoDB Driver
@@ -67,20 +67,20 @@
                   :exclusions [org.slf4j/slf4j-api]]
                  [net.sourceforge.jtds/jtds "1.3.1"]                  ; Open Source SQL Server driver
                  [org.liquibase/liquibase-core "3.5.3"]               ; migration management (Java lib)
-                 [org.slf4j/slf4j-log4j12 "1.7.22"]                   ; abstraction for logging frameworks -- allows end user to plug in desired logging framework at deployment time
-                 [org.yaml/snakeyaml "1.17"]                          ; YAML parser (required by liquibase)
-                 [org.xerial/sqlite-jdbc "3.8.11.2"]                  ; SQLite driver !!! DO NOT UPGRADE THIS UNTIL UPSTREAM BUG IS FIXED -- SEE https://github.com/metabase/metabase/issues/3753 !!!
+                 [org.slf4j/slf4j-log4j12 "1.7.25"]                   ; abstraction for logging frameworks -- allows end user to plug in desired logging framework at deployment time
+                 [org.yaml/snakeyaml "1.18"]                          ; YAML parser (required by liquibase)
+                 [org.xerial/sqlite-jdbc "3.16.1"]                    ; SQLite driver
                  [postgresql "9.3-1102.jdbc41"]                       ; Postgres driver
                  [io.crate/crate-jdbc "2.1.6"]                        ; Crate JDBC driver
-                 [prismatic/schema "1.1.3"]                           ; Data schema declaration and validation library
+                 [prismatic/schema "1.1.5"]                           ; Data schema declaration and validation library
                  [ring/ring-jetty-adapter "1.5.1"]                    ; Ring adapter using Jetty webserver (used to run a Ring server for unit tests)
                  [ring/ring-json "0.4.0"]                             ; Ring middleware for reading/writing JSON automatically
                  [stencil "0.5.0"]                                    ; Mustache templates for Clojure
                  [toucan "1.0.2"                                      ; Model layer, hydration, and DB utilities
                   :exclusions [honeysql]]]
   :repositories [["bintray" "https://dl.bintray.com/crate/crate"]]    ; Repo for Crate JDBC driver
-  :plugins [[lein-environ "1.0.3"]                                    ; easy access to environment variables
-            [lein-ring "0.9.7"                                        ; start the HTTP server with 'lein ring server'
+  :plugins [[lein-environ "1.1.0"]                                    ; easy access to environment variables
+            [lein-ring "0.11.0"                                       ; start the HTTP server with 'lein ring server'
              :exclusions [org.clojure/clojure]]]                      ; TODO - should this be a dev dependency ?
   :main ^:skip-aot metabase.core
   :manifest {"Liquibase-Package" "liquibase.change,liquibase.changelog,liquibase.database,liquibase.parser,liquibase.precondition,liquibase.datatype,liquibase.serializer,liquibase.sqlgenerator,liquibase.executor,liquibase.snapshot,liquibase.logging,liquibase.diff,liquibase.structure,liquibase.structurecompare,liquibase.lockservice,liquibase.sdk,liquibase.ext"}
@@ -106,13 +106,12 @@
   :docstring-checker {:include [#"^metabase"]
                       :exclude [#"test"
                                 #"^metabase\.http-client$"]}
-  :profiles {:dev {:dependencies [[org.clojure/tools.nrepl "0.2.12"]  ; REPL <3
-                                  [expectations "2.1.9"]              ; unit tests
+  :profiles {:dev {:dependencies [[expectations "2.1.9"]              ; unit tests
                                   [ring/ring-mock "0.3.0"]]           ; Library to create mock Ring requests for unit tests
                    :plugins [[docstring-checker "1.0.0"]              ; Check that all public vars have docstrings. Run with 'lein docstring-checker'
                              [jonase/eastwood "0.2.3"
                               :exclusions [org.clojure/clojure]]      ; Linting
-                             [lein-bikeshed "0.3.0"]                  ; Linting
+                             [lein-bikeshed "0.4.1"]                  ; Linting
                              [lein-expectations "0.0.8"]              ; run unit tests with 'lein expectations'
                              [lein-instant-cheatsheet "2.2.1"         ; use awesome instant cheatsheet created by yours truly w/ 'lein instant-cheatsheet'
                               :exclusions [org.clojure/clojure


updates server deps

updates server deps

--- project.clj
+++ project.clj
@@ -1,14 +1,14 @@
 (defproject nevergreen "0.0.0"
   :description "A build monitor with attitude"
   :url "https://github.com/build-canaries/nevergreen"
-  :dependencies [[org.clojure/clojure "1.10.1"]
-                 [ring "1.8.2" :exclusions [org.eclipse.jetty/jetty-server]]
-                 [org.eclipse.jetty/jetty-server "9.4.35.v20201120"]
+  :dependencies [[org.clojure/clojure "1.10.2"]
+                 [ring "1.9.0" :exclusions [org.eclipse.jetty/jetty-server]]
+                 [org.eclipse.jetty/jetty-server "9.4.36.v20210114"]
                  [compojure "1.6.2" :exclusions [ring/ring-codec]]
                  [environ "1.2.0"]
                  [cheshire "5.10.0"]
                  [clj-cctray "2.0.0"]
-                 [clj-http "3.11.0"]
+                 [clj-http "3.12.1"]
                  [ring-curl "1.0.1"]
                  [ring/ring-json "0.5.0"]
                  [ring/ring-defaults "0.3.2"]
@@ -34,9 +34,9 @@
             "coverage"      ["with-profile" "+test" "cloverage"]
             "check-updates" ["ancient" ":all"]
             "audit"         ["nvd" "check"]}
-  :profiles {:dev  {:plugins [[lein-ancient "0.6.15"]
-                              [jonase/eastwood "0.3.11"]
-                              [lein-cloverage "1.2.1"]
+  :profiles {:dev  {:plugins [[lein-ancient "0.7.0"]
+                              [jonase/eastwood "0.3.13"]
+                              [lein-cloverage "1.2.2"]
                               [lein-nvd "1.4.1"]
                               [lein-eftest "0.5.9"]]}
              :test {:jvm-opts ["-Dlogback.configurationFile=./src/logback-tests.xml"]}}


Added lein ancient plugin.

Added lein ancient plugin.

--- project.clj
+++ project.clj
@@ -19,6 +19,7 @@
     ["https://github.com/clojure-liberator/liberator.git"] ; WebMachine (REST state machine) port to Clojure https://github.com/clojure-liberator/liberator
   ]
   :plugins [
+    [lein-ancient "0.4.0"] ; Check for outdated dependencies https://github.com/xsc/lein-ancient
     [lein-git-deps "0.0.1-SNAPSHOT"] ; dependencies from GitHub https://github.com/tobyhede/lein-git-deps
   	[lein-ring "0.8.3"] ; common ring tasks https://github.com/weavejester/lein-ring
     [lein-cucumber "1.0.2"] ; cucumber-jvm (BDD testing) tasks https://github.com/nilswloka/lein-cucumber


Second version of metadata reader

Second version of metadata reader

--- src/emender_jenkins/metadata_reader.clj
+++ src/emender_jenkins/metadata_reader.clj
@@ -29,9 +29,11 @@
     :xincludes-count                  "results.GuideStatistic.XiIncludes.cnt"
     :zpage-count                      "results.GuideStatistic.ZPageCount.cn"})

+(def metadata (atom nil))
+
 (defn read-and-parse-list-of-commiters
     [jenkins-url job-name]
-    (let [raw-data (jenkins-api/read-file-from-artifact jenkins-url job-name (:commiters-list GuideStatisticResultNames))]
+    (let [raw-data (jenkins-api/read-file-from-artifact jenkins-url job-name (:commiters-list GuideStatisticResultNames) nil)]
         (count raw-data)))

 (defn job-results->job-names
@@ -47,14 +49,14 @@

 (defn reload-tests-metadata
     [configuration job-results]
-    (let [jenkins-url   (-> configuration :jenkins :jenkins-url)
-          metadata      (->> (job-results->job-names job-results)
-                             (load-and-parse-metadata jenkins-url))]
-    (println metadata)
+    (let [jenkins-url     (-> configuration :jenkins :jenkins-url)
+          parsed-metadata (->> (job-results->job-names job-results)
+                               (load-and-parse-metadata jenkins-url))]
+    (reset! metadata parsed-metadata)
     nil))

 (defn metadata-count
     []
-    42)
+    @metadata)


cleanup; updated ui-radio

cleanup; updated ui-radio

--- src/main/untangled/ui/elements.cljc
+++ src/main/untangled/ui/elements.cljc
@@ -487,7 +487,6 @@

   className (optional): additional class stylings to apply to the top level of the checkbox
   id: Name of the checkbox
-     style (optional):  indeterminate
   disabled (optional: true/false"
   [{:keys [id style disabled] :or {id ""} :as attrs}]
   (let [user-classes (get attrs :className "")


Property completed-at for follow-ups is optional.

--- src/oc/storage/resources/common.clj
+++ src/oc/storage/resources/common.clj
@@ -95,7 +95,7 @@
   :assignee lib-schema/Author
   :author lib-schema/Author
   :completed? schema/Bool
-  :completed-at lib-schema/ISO8601})
+  (schema/optional-key :completed-at) (schema/maybe lib-schema/ISO8601)})

 (def Entry
   "An entry on a board."


Fix error

Fix error

--- src/org/spootnik/cyanite/config.clj
+++ src/org/spootnik/cyanite/config.clj
@@ -157,6 +157,16 @@
         (update-in [:store-cache] (partial merge settings))
         (update-in [:store-cache] get-instance :store-cache))))

+(defn config-store-middleware
+  [config]
+  (let [store (get config :store)
+        cache (get config :cache)
+        settings (merge default-store-middleware {:store store
+                                                  :cache cache})]
+    (-> config
+        (update-in [:store-middleware] (partial merge settings))
+        (update-in [:store-middleware] get-instance :store-middleware))))
+
 (defn init
   "Parse yaml then enhance config"
   [path quiet?]
@@ -169,9 +179,8 @@
         (update-in [:stats] (partial merge default-stats))
         (update-in [:store] (partial merge default-store))
         (update-in [:store] get-instance :store)
-        (update-in [:store-middleware] (partial merge default-store-middleware))
-        (update-in [:store-middleware] get-instance :store-middleware)
         (config-store-cache)
+        (config-store-middleware)
         (update-in [:carbon] (partial merge default-carbon))
         (update-in [:carbon :rollups] convert-shorthand-rollups)
         (update-in [:carbon :rollups] assoc-rollup-to)


Add default resolution.

Add default resolution.

--- src/org/spootnik/cyanite/rollup.clj
+++ src/org/spootnik/cyanite/rollup.clj
@@ -25,7 +25,7 @@

 (defn resolution-rollup-finder
   "Find most suitable rollup for given resolution"
-  [{:keys [rollups resolution]}]
+  [{:keys [rollups resolution] :or {resolution 800}}]
   (info "creating resolution rollup finder")
   (reify
     RollupFinder


Extended the bass.

Extended the bass.

--- src/overtunes/songs/variatio-12.clj
+++ src/overtunes/songs/variatio-12.clj
@@ -21,8 +21,9 @@
     (range a (inc b))
     (reverse (run b a))))

-(def pitches (flatten [0 0 (run -1 3) (run 2 0) 4 (run 1 8) (run 7 -1) 0 (run 0 -3) 4 4 (run 2 -3) -1]))
-(def durations (flatten [1/2 (repeat 2 1/4) 1/2 (repeat 6 1/4) (repeat 8 1/4) 3/2 (repeat 10 1/4) 1/2 (repeat 2 1/4) 9/4 3/4 (repeat 8 1/4)]))
+(def durations (flatten [(repeat 2 1/4) 1/2 (repeat 6 1/4) (repeat 8 1/4) 3/2 (repeat 10 1/4) 1/2 (repeat 2 1/4) 9/4 3/4 (repeat 8 1/4)]))
+(def pitches (flatten [0 (run -1 3) (run 2 0) 4 (run 1 8) (run 7 -1) 0 (run 0 -3) 4 4 (run 2 -3) -1]))
+(def bass (map #(- % 7) (flatten (map #(repeat 3 %) (concat (run 0 -3) (run -5 -3) [0])))))

 (defn melody# [timing notes]
   (let [note# #(at (timing %1) (piano (g-major %2)))]
@@ -33,7 +34,9 @@
         rhythm-from #(syncopate (translate timing % 0) durations)
         leader pitches
         follower (->> leader (map -) (map #(- % 4)))]
-    (melody# (rhythm-from 0) leader)
-    (melody# (rhythm-from 3) follower)))
+    (melody# timing bass)
+    (melody# (rhythm-from 1/2) leader)
+    (melody# (rhythm-from 7/2) follower)
+    ))

 (play#)


add group-aware-consensus

add group-aware-consensus

--- src/polismath/math/conversation.clj
+++ src/polismath/math/conversation.clj
@@ -267,7 +267,7 @@
        (int (/ (count (nm/rownames data)) 12)))))

 (defn group-votes
-  "Returns a map of group-clusters ids to {:A :D :S} maps."
+  "Returns a map of group-clusters ids to {:votes {<tid> {:A _ :D _ :S _}}} :n maps."
   [group-clusters base-clusters votes-base]
   (let [bid-to-index (zipmap (map :id base-clusters)
                              (range))]
@@ -554,17 +554,42 @@
       ;; downstream processing and data consumption. Will hvae to strike a balance here... For now, again, things are a
       ;; little verbose, but you can hopefully see some of the patters emerging for where these things may generalize.

-      ; {tid {gid {A _ D _ S}}}
+      ; {gid {:votes {<tid> {A _ D _ S}}}}
       :group-votes
       (plmb/fnk [group-clusters base-clusters votes-base]
         (group-votes group-clusters base-clusters votes-base))
-      ; {gid {tid {gid {A _ D _ S}}}}
+      ;; ?
       :subgroup-votes
       (plmb/fnk [subgroup-clusters base-clusters votes-base]
         (->> subgroup-clusters
              (plmb/map-vals
                (fn [subgroup-clusters']
                  (group-votes subgroup-clusters' base-clusters votes-base)))))
+
+
+      ; {gid {tid consensus}}
+      :group-aware-consensus
+           (plmb/fnk [group-votes]
+             (let [tid-gid-probs
+                   (reduce
+                     (fn [result [gid gid-stats]]
+                       (reduce
+                         (fn [result [tid {:keys [A S] :or {A 0 S 0}}]]
+                           (let [consensus (/ A (+ S 1.0))]
+                             (assoc-in result [tid gid] consensus)))
+                         result
+                         (:votes gid-stats)))
+                       ;; +1 acts as a dumb prior
+                     {}
+                     group-votes)
+                   tid-consensus
+                   (plmb/map-vals
+                     (fn [tid-stats]
+                       (->> tid-stats
+                            (map second)
+                            (reduce *)))
+                     tid-gid-probs)]
+               tid-gid-probs))

       :repness


Don't use a string for event type

Don't use a string for event type

--- secretary/src/cljs/secretary_example/core.cljs
+++ secretary/src/cljs/secretary_example/core.cljs
@@ -1,9 +1,11 @@
 (ns secretary-example.core
   (:require-macros [secretary.core :refer [defroute]])
   (:require [goog.events :as events]
+            [goog.History.EventType :as HistoryEventType]
             [goog.dom :as dom]
             [secretary.core :as secretary])
   (:import goog.History))
+

 (def app (dom/getElement "app"))

@@ -27,7 +29,7 @@

   ;; Configure history
   (let [history (History.)]
-    (events/listen history "navigate"
+    (events/listen history HistoryEventType/NAVIGATE
                    (fn [event]
                      (secretary/dispatch! (.-token event))))
     (.setEnabled history true)))


continue to isolate/encapsulate join internal rep

--- dada2-core/src/test/clojure/org/dada2/test_join_model.clj
+++ dada2-core/src/test/clojure/org/dada2/test_join_model.clj
@@ -97,13 +97,13 @@

 ;; TODO: return a pair - first is notification fn, second is new-indeces - use swap*! to apply

-(defn- rhs-upsert [old-indeces i lhs-key rhs-ks v join-fn joined-model]
-  (let [key (lhs-key v)
-	new-indeces (rhs-assoc old-indeces i key v)
+(defn- rhs-upsert [old-indeces i rhs-fk-key lhs-fk-keys rhs join-fn joined-model]
+  (let [fk (rhs-fk-key rhs)
+	new-indeces (rhs-assoc old-indeces i fk rhs)
 	lhs-indeces (first old-indeces)
-	lhses (lhses-get lhs-indeces i key)
+	lhses (lhses-get lhs-indeces i fk)
 	rhs-indeces (rest new-indeces)
-	joins (mapcat (fn [lhs] (derive-joins lhs rhs-indeces rhs-ks join-fn)) lhses)
+	joins (mapcat (fn [lhs] (derive-joins lhs rhs-indeces lhs-fk-keys join-fn)) lhses)
 	]
     [new-indeces (fn [_] (on-upserts joined-model joins))]
     ))
@@ -113,30 +113,30 @@
 (defn- rhs-upserts [old-indeces i ks vs join-fn])
 (defn- rhs-deletes [old-indeces i ks vs join-fn])

-(defn- rhs-view [indeces i key keys join-fn joined-model]
+(defn- rhs-view [indeces i rhs-fk-key lhs-fk-keys join-fn joined-model]
   (reify
    View
    ;; singleton changes
-   (on-upsert [_ upsertion] ((swap*! indeces rhs-upsert i key keys upsertion join-fn joined-model) []) nil) ;TODO: pass in views to notifier
-   (on-delete [_ deletion]  (swap! indeces rhs-delete i keys deletion join-fn) nil)
+   (on-upsert [_ upsertion] ((swap*! indeces rhs-upsert i rhs-fk-key lhs-fk-keys upsertion join-fn joined-model) []) nil) ;TODO: pass in views to notifier
+   (on-delete [_ deletion]  (swap! indeces rhs-delete i lhs-fk-keys deletion join-fn) nil)
    ;; batch changes
-   (on-upserts [_ upsertions] (swap! indeces rhs-upserts i keys upsertions join-fn) nil)
-   (on-deletes [_ deletions]  (swap! indeces rhs-deletes i keys deletions join-fn) nil)))
+   (on-upserts [_ upsertions] (swap! indeces rhs-upserts i lhs-fk-keys upsertions join-fn) nil)
+   (on-deletes [_ deletions]  (swap! indeces rhs-deletes i lhs-fk-keys deletions join-fn) nil)))

 ;;; attach lhs to all rhses such that any change to an rhs initiates an
 ;;; attempt to [re]join it to the lhs and vice versa.
-(defn- join-views [join-fn [lhs-model lhs-keys joined-model] & rhses]
+(defn- join-views [join-fn [lhs-model lhs-fk-keys joined-model] & rhses]
   (let [indeces (atom [(apply vector (repeat (count rhses) {}))])]
     ;; view lhs
-    (log2 :info (str " lhs: " lhs-model ", " lhs-keys))
-    (attach lhs-model (lhs-view indeces 0 lhs-keys join-fn joined-model))
+    (log2 :info (str " lhs: " lhs-model ", " lhs-fk-keys))
+    (attach lhs-model (lhs-view indeces 0 lhs-fk-keys join-fn joined-model))
     ;; view rhses
-    (doseq [[model key] rhses]
+    (doseq [[model rhs-fk-key] rhses]
 	(let [i (count @indeces)]   ; figure out offset for this index
-	  (log2 :info (str " rhs: " model ", " i ", " key))
+	  (log2 :info (str " rhs: " model ", " i ", " rhs-fk-key))
 	  (swap! indeces conj {})	; add index for this model
 	  ;; view rhs model
-	  (attach model (rhs-view indeces i key lhs-keys join-fn joined-model))))
+	  (attach model (rhs-view indeces i rhs-fk-key lhs-fk-keys join-fn joined-model))))
     indeces))

 (deftype JoinModel [^String name ^Atom state ^Atom views]


CMR-3780: Finished refactoring for access control

--- access-control-app/src/cmr/access_control/services/group_service.clj
+++ access-control-app/src/cmr/access_control/services/group_service.clj
@@ -253,19 +253,18 @@
 (defn update-group
   "Updates an existing group with the given concept id"
   [context concept-id updated-group]
-  (if (common-enabled/app-write-enabled? context)
-    (let [existing-concept (fetch-group-concept context concept-id)
-          existing-group (edn/read-string (:metadata existing-concept))]
-      (validate-update-group context existing-group updated-group)
-      (auth/verify-can-update-group context existing-group)
+  (common-enabled/validate-write-enabled context "access control")
+  (let [existing-concept (fetch-group-concept context concept-id)
+        existing-group (edn/read-string (:metadata existing-concept))]
+    (validate-update-group context existing-group updated-group)
+    (auth/verify-can-update-group context existing-group)
       ;; Avoid clobbering :members by merging the updated-group into existing-group. If updated-group
       ;; specifies :members then it will overwrite the existing value.
-      (let [updated-group (merge existing-group updated-group)
-            update-result (save-updated-group-concept context existing-concept updated-group)]
-        update-result))
-    (errors/throw-service-error :service-unavailable
-                                (common-enabled/service-write-disabled-message "access control"))))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (let [updated-group (merge existing-group updated-group)
+          update-result (save-updated-group-concept context existing-concept updated-group)]
+     update-result)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Search functions

 (defmethod cpv/params-config :access-group


restrcutre it a bit

restrcutre it a bit

--- src/epicea/typed/core.clj
+++ src/epicea/typed/core.clj
@@ -13,26 +13,20 @@
 (spec/def ::int #(or (instance? java.lang.Integer %)
                      (int? %)))

-(spec/def ::primitive-value
-  (spec/or
-   :bool ::bool
-   :float ::float
-   :double ::double
-   :long ::long
-   :int ::int))
-
-(spec/def ::primitive (spec/or
-                       :bool (partial = :bool)
-                       :float (partial = :float)
-                       :long (partial = :long)
-                       :double (partial = :double)
-                       :int (partial = :int)))
-
 (spec/def ::dynamic (partial = :dynamic))

-(spec/def ::number (spec/or :type #(or (= % :number)
-                                       (= % :double))
-                            :value number?))
+(defn value-or-type [type-tag value-tester?]
+  (spec/or :type (partial = type-tag)
+           :value value-tester?))
+
+(spec/def ::number (value-or-type :number number?))
+(spec/def ::double (value-or-type :double double?))
+(spec/def ::long (value-or-type :long #(instance? java.lang.Long %)))
+(spec/def ::float (value-or-type :float float?))
+(spec/def ::bool (value-or-type :boll boolean?))
+(spec/def ::int (value-or-type :int int?))
+
+
 (spec/def ::count number?)
 (spec/def ::key keyword?)

@@ -63,7 +57,12 @@
                     :tag (constantly true)
                     :data ::sized-type))

-(spec/def ::sized-type (spec/or :number ::number
+(spec/def ::sized-type (spec/or :double ::double
+                                :float ::float
+                                :long ::long
+                                :int ::int
+                                :bool ::bool
+                                :number ::number
                                 :record ::record
                                 :union ::union
                                 :unspecified ::unspecified ;; <-- a primitive building block
@@ -76,9 +75,7 @@
                    :header (spec/? ::sized-type)
                    :data ::sized-type))

-(spec/def ::type (spec/or :primitive ::primitive
-                          :primitive-value ::primitive-value
-                          :sized-type ::sized-type
+(spec/def ::type (spec/or :sized-type ::sized-type
                           :array ::array
                           :dynamic ::dynamic))

@@ -126,9 +123,9 @@

 ;;;; Compute the size of a ::sized-type
 (defmultiple compute-size get-pair-tag
+  (:default [x] 1)
   (:vec [x] (let [value (get-pair-value x)]
               (size-mul (:count value) (compute-size (:type value)))))
-  (:number [x] 1)
   (:tagged [x] (compute-size (:data (get-pair-value x))))
   (:union [x] (reduce size-max (map compute-size (-> x get-pair-value :alts))))
   (:record [x] (reduce size-add (map (comp compute-size :value)
@@ -183,6 +180,9 @@

+(defn expr-to-typed-value [expr]
+  (spec/conform ::type expr))
+
 ;;; OBS: Vi måste räkna referenserna till varje uttryck som vi kompilerar.
 ;;; Kanske i argmap? Om antalet referenser överskriver 1 binder vi uttrycket
 ;;; till en variabel.
@@ -190,7 +190,7 @@
                             (access/getx expr-type expr))
   (:default
    [argmap expr cb]
-   (cb argmap (spec/conform ::type (access/getx expr-value expr)))))
+   (cb argmap (expr-to-typed-value (access/getx expr-value expr)))))

 (def empty-argmap {})


Add an actual bot to the jumpbot example file.

--- src/examples/jumpbot.clj
+++ src/examples/jumpbot.clj
@@ -18,3 +18,7 @@
     (loops/add-loop bot #'jump 2000 :jump-loop)
     bot))

+
+(require '(clojurecraft [core :as core] [actions :as actions]))
+(def bot (make-jumpbot core/minecraft-local "jimmy"))
+(core/disconnect bot)


Whitespace

Whitespace

- Indentation of function was a little off
- One line got uncomfortably long; I added a linebreak

--- src/foreclojure/users.clj
+++ src/foreclojure/users.clj
@@ -31,13 +31,14 @@

 (defn get-user-with-ranking [username, users]
   (when username
-   (let [total (count users)
-         users-with-rankings (map-indexed
-                              (fn [idx itm]
-                                (assoc itm :rank (str (inc idx) " out of " total))) users) ]
-     (first
-      (filter #(= username (% :user)) users-with-rankings)))))
-
+    (let [total (count users)
+          users-with-rankings (map-indexed
+                               (fn [idx itm]
+                                 (assoc itm :rank
+                                        (str (inc idx) " out of " total)))
+                               users)]
+      (first
+       (filter #(= username (% :user)) users-with-rankings)))))

 (defn get-top-100-and-current-user [username]
   (let [users (get-users)


removed unnecessary functions

removed unnecessary functions

--- src/frontend/uploads.cljs
+++ src/frontend/uploads.cljs
@@ -18,31 +18,22 @@
 (defn stop-upload [upload]
   (assoc upload :started? false))

-(defn initialize-upload [upload]
-  (assoc upload :started? true))
-
 (defn append-upload [uploads upload]
   (conj uploads upload))

-(defn prepend-upload [uploads upload]
-  (into [upload] uploads))
+(defn active-uploads [uploads-order uploads]
+  (vec (remove #(not (:started? (uploads %1))) uploads-order)))

-(defn drop-first-upload [uploads]
-  (subvec uploads 1))
-
-(defn drop-last-upload [uploads]
-  (subvec uploads 0 (dec (count uploads))))
-
-(defn count-active-uploads [uploads-order uploads]
-  (let [active-uploads (vec (remove #(not (:started? (uploads %1))) uploads-order))]
-    (count active-uploads)))
+(defn inactive-uploads [uploads-order uploads]
+  (vec (remove #(:started? (uploads %1)) uploads-order)))

 (defn handle-upload-slots-change [old-state new-state]
   (let [old-upload-slots (:upload-slots old-state)
         new-upload-slots (:upload-slots new-state)
         uploads          (:uploads new-state)
-        active-uploads   (vec (remove #(not (:started? (uploads %1))) (:uploads-order new-state)))
-        inactive-uploads (vec (remove #(:started? (uploads %1)) (:uploads-order new-state)))]
+        uploads-order    (:uploads-order new-state)
+        active-uploads   (active-uploads   uploads-order uploads)
+        inactive-uploads (inactive-uploads uploads-order uploads)]
     (println "UPLOADS!" uploads)
     (cond
       (and (< old-upload-slots new-upload-slots)
@@ -69,7 +60,7 @@
     (if-not (empty? deleted-upload-ids)
       (let [uploads (:uploads new-state)
             uploads-order (vec (remove deleted-upload-ids (:uploads-order new-state)))
-            inactive-uploads (vec (remove #(:started? (uploads %1)) uploads-order))]
+            inactive-uploads (inactive-uploads uploads-order uploads)]
         (if (empty? inactive-uploads)
           (swap! app-state/app-state
                  merge
@@ -152,8 +143,8 @@
     (swap! app-state/app-state
            merge
            {:uploads (merge (:uploads @app-state/app-state)
-                            (if (< (count-active-uploads (:uploads-order @app-state/app-state)
-                                                         (:uploads @app-state/app-state))
+                            (if (< (count (active-uploads (:uploads-order @app-state/app-state)
+                                                          (:uploads @app-state/app-state)))
                                    (:upload-slots   @app-state/app-state))
                               {upload-id (start-upload new-upload)}
                               {upload-id new-upload}))


ported the defconstrainedfn macro.  This is much cleaner and compact

--- src/fogus/me/trammel.clj
+++ src/fogus/me/trammel.clj
@@ -150,22 +150,11 @@

     (defconstrainedfn sqr
       \"Squares a number\"
-      [n]
-      :requires
-      (number? n)
-      (not= 0 n)
-
-      :ensures
-      (pos? %)
-      (number? %)
-
-      :body
+      [n] [number? (not= 0 n) => pos? number?]
       (* n n))

-   The order of the `:requires`, `:ensures`, and `:body` sections are not relevant, but it's likely a
-   good idea to maintain consistency.  Like the `contract` macro, multiple arity functions can be defined
-   where each argument vector is followed by the relevent arity expectations.  The `:body` element is the
-   only required section for each defined function arity.
+   Like the `contract` macro, multiple arity functions can be defined where each argument vector
+   is immediately followed by the relevent arity expectations.
   "
   [name & body]
   (let [mdata (if (string? (first body))
@@ -174,13 +163,13 @@
         body  (if (:doc mdata)
                 (next body)
                 body)
-        body  (for [bd (build-forms-map body)]
-                (let [arg (first (keys bd))
-                      b   (first (vals bd))]
-                  (list* arg
-                         {:pre  (vec (b :requires))
-                          :post (vec (b :ensures))}
-                         (b :body))))]
+        body  (if (vector? (first body))
+                (list body)
+                body)
+        body  (for [[args cnstr & bd] body]
+                (list* args
+                       (second (build-constraints-map args cnstr))
+                       bd))]
     `(defn ~name
        ~(if (:doc mdata) (:doc mdata) "")
        ~@body)))


cleanup

cleanup

--- src/gif_to_html/repl.clj
+++ src/gif_to_html/repl.clj
@@ -1,34 +0,0 @@
-(ns gif-to-html.repl
-  (:use gif-to-html.handler
-        ring.server.standalone
-        [ring.middleware file-info file]))
-
-(defonce server (atom nil))
-
-(defn get-handler []
-  ;; #'app expands to (var app) so that when we reload our code,
-  ;; the server is forced to re-resolve the symbol in the var
-  ;; rather than having its own copy. When the root binding
-  ;; changes, the server picks it up without having to restart.
-  (-> #'app
-      ; Makes static assets in $PROJECT_DIR/resources/public/ available.
-      (wrap-file "resources")
-      ; Content-Type, Content-Length, and Last Modified headers for files in body
-      (wrap-file-info)))
-
-(defn start-server
-  "used for starting the server in development mode from REPL"
-  [& [port]]
-  (let [port (if port (Integer/parseInt port) 3000)]
-    (reset! server
-            (serve (get-handler)
-                   {:port port
-                    :init init
-                    :auto-reload? true
-                    :destroy destroy
-                    :join? false}))
-    (println (str "You can view the site at http://localhost:" port))))
-
-(defn stop-server []
-  (.stop @server)
-  (reset! server nil))


correct entity delete test

correct entity delete test

--- test/clj_money/api/entities_test.clj
+++ test/clj_money/api/entities_test.clj
@@ -78,9 +78,9 @@
         entity (find-entity context "Personal")
         user (find-user context "john@doe.com")
         response (with-authentication user
-                   (api/delete {:params {:entity-id (:id entity)}}))
+                   (api/delete {:params {:id (:id entity)}}))
         retrieved (entities/select storage-spec (:id user))]
-    (is (= 202 (:status response)) "The response is successful and empty")
+    (is (= 204 (:status response)) "The response is successful and empty")
     (is (= #{"Business"} (->> retrieved
                               (map :name)
                               (into #{})))


Refactor some async tests

Refactor some async tests

--- test/momentum/test/core/deferred.clj
+++ test/momentum/test/core/deferred.clj
@@ -183,31 +183,27 @@
   (let [ch  (channel)
         err (Exception.)
         res (atom nil)]
-    (abort ch err)
-    (receive (seq ch)
-             (fn [_] (reset! res :fail))
-             #(compare-and-set! res nil %)))
+    (abort ch (Exception. "BOOM"))
+    (is (thrown-with-msg? Exception #"BOOM"
+          @(seq ch))))

   (let [ch  (channel)
         err (Exception.)
         res (atom nil)]
-    (receive
-     (seq ch)
-     (fn [[val & more]]
-       (reset! res val)
-       (receive
-        more
-        (fn [_] (reset! res :fail))
-        (fn [e] (compare-and-set! res :hello e))))
-     identity)
+
+    (doasync (seq ch)
+      (fn [[v & more]]
+        (reset! res v)
+        more)
+      (fn [_] (reset! res :fail))
+      (catch Exception e
+        (compare-and-set! res :hello e)))

     (is (nil? @res))
     (put ch :hello)
     (is (= :hello @res))
     (abort ch err)
-    (is (= err @res))
-    ;; (is (nil? (seq ch)))
-    ))
+    (is (= err @res))))

 (deftest queuing-up-elements
   (let [ch  (channel)
@@ -244,6 +240,3 @@
   (let [ch (channel)]
     (close ch)
     (is (not (put ch :hello)))))
-
-;; TODO:
-;; * Add tests for AsyncSeq List interface implementation


The tests. They pass. TODO: Fix seq and split balance.

--- test/random_access_map/core_test.clj
+++ test/random_access_map/core_test.clj
@@ -210,31 +210,42 @@
     (let [rn-name (str "remove-nth on " name)
           rn-map (reduce rn first-map rmn-range)
           [removed-img removed-vect] (reduce vec-remove-build-image
-                                             [#{} (vec (sort first-img))] rmn-range)
+                                             ; first, we map kvp to them, so we
+                                             ; sort correctly by the keyword
+                                             ; version of the number, so that we
+                                             ; remove the correct elements from
+                                             ; first-img...
+                                             [#{} (vec (sort (map kvp first-img)))] rmn-range)
           removed-result (set (sort removed-vect))]
       (standard-tests rn-name rn-map)
-      (presence-tests rn-name rn-map removed-result)
-      (absence-tests rn-name rn-map removed-img)
+      ; Then, since the tests don't expect a key-value pair, rather only a
+      ; value, we unwrap the value from its k/v pair so that things
+      ; get tested properly here.
+      (presence-tests rn-name rn-map (map val removed-result))
+      (absence-tests rn-name rn-map (map val removed-img))
       (index-bound-tests rn-name rn-map))))
+
 (deftest small-tests
   "Testing the small maps."
   (test-ranges "increasing order, 0 through 9" (range 10) '(1 3 5 6) '(5 4 3 2 1))
   (test-ranges "decreasing order, 9 through 0" (range 9 -1 -1) '(0 3 2 4) (repeat 3 0)))
+
 (deftest pretty-small-tests
   "Testing the smallest of maps."
   (test-ranges "poquito" (range 3) '(1 2 3) '())
-  (test-ranges "little" (range 7) '() (range 7)))
+  (test-ranges "little" (range 7) '() '(3 3 2 2 1 1 0)))
+
 (deftest empty-tests
   "Testing the empty maps."
   (test-ranges "empty" '() '(1 2 3 4 5 :heyheyhey) '()))

-
-#_(deftest midsize-tests
+(deftest midsize-tests
   "A bit bigger, to find more errors."
   (test-ranges "increasing order, 10 to 30." (range 10 30) (range 10 30 4) (range 14 -1 -1))
   (test-ranges "increasing order, 20 to 30 and decreasing order, 70 to 90."
                (concat (range 20 30) (range 90 70 -1)) (range 90 70 -1) (repeat 5 4)))
-#_(deftest large-tests
+
+(deftest large-tests
   "Testing the large maps."
   (test-ranges "pretty big." (range 100) (range 0 50 2) (repeat 20 0))
   (test-ranges "reverse big." (range 99 -1 -1) (range 20 50 3) (range 89 58 -1)))


Remove class

Remove class

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -180,8 +180,7 @@
       (html
        [:div.refresh-repos
        [:button.btn.btn-primary.set-user
-        {:on-click #(raise! owner [:refreshed-user-orgs {}]) ;; TODO: spinner while working?
-         :class "active"}
+        {:on-click #(raise! owner [:refreshed-user-orgs {}])} ;; TODO: spinner while working?
         "Reload repositories"]]))))

 (defn repo-item [data owner]


cleanup

cleanup

--- src/district0x/server/emailer/sendgrid.cljs
+++ src/district0x/server/emailer/sendgrid.cljs
@@ -27,13 +27,14 @@
            :handler success-handler
            :error-handler error-handler})))

-(defn sendmail []
-  (district0x.server.emailer.sendgrid/send-notification-email {:from-email "test@test.com"
-                                                               :to-email "filip@district0x.io"
-                                                               :subject "Subject"
-                                                               :content (name-bazaar.server.emailer.templates/on-offering-bought "a1234" "bla.eth" 0.001)}
-                                                              {:header "was bought"
-                                                               :button-title "See offering details"
-                                                               :button-href "www.google.be"}
-                                                              #(prn "Success!")
-                                                              #(prn "Error: " %)))
+(comment
+  (defn sendmail []
+    (district0x.server.emailer.sendgrid/send-notification-email {:from-email "test@test.com"
+                                                                 :to-email "sharklaser@district0x.io"
+                                                                 :subject "Subject"
+                                                                 :content (name-bazaar.server.emailer.templates/on-offering-bought "a1234" "bla.eth" 0.001)}
+                                                                {:header "was bought"
+                                                                 :button-title "See offering details"
+                                                                 :button-href "www.google.be"}
+                                                                #(prn "Success!")
+                                                                #(prn "Error: " %))))