gh-25 -> fixing dom indentation

gh-25 -> fixing dom indentation

--- src/untangled_spec/reporters/browser.cljs
+++ src/untangled_spec/reporters/browser.cljs
@@ -21,16 +21,16 @@
           {:keys [render]} (om/props this)
           {:keys [title value classes]} (render folded?)]
       (dom/div nil
-               (dom/a #js {:href "javascript:void(0);"
-                           :className classes
-                           :onClick #(om/update-state! this update :folded? not)}
-                      (if folded? \u25BA \u25BC)
-                      (if folded?
-                        (str (apply str (take 40 title))
-                             (when (< 40 (count title)) "..."))
-                        (str title)))
-               (dom/div #js {:className (when folded? "hidden")}
-                        value)))))
+        (dom/a #js {:href "javascript:void(0);"
+                    :className classes
+                    :onClick #(om/update-state! this update :folded? not)}
+          (if folded? \u25BA \u25BC)
+          (if folded?
+            (str (apply str (take 40 title))
+              (when (< 40 (count title)) "..."))
+            (str title)))
+        (dom/div #js {:className (when folded? "hidden")}
+          value)))))
 (def ui-foldable (om/factory Foldable {:keyfn (let [c (atom 0)]
                                                 #(str "foldable-" (swap! c inc)))}))

@@ -39,19 +39,19 @@
   (render [this]
     (let [{:keys [title value stack] type- :type} (om/props this)]
       (dom/tr nil
-              (dom/td #js {:className (str "test-result-title "
-                                           (name type-))}
-                      title)
-              (dom/td #js {:className "test-result"}
-                      (dom/code nil
-                                (ui-foldable
-                                  {:render (fn [folded?]
-                                             {:title (if stack (str value)
-                                                       (if folded? (str value) title))
-                                              :value (if stack stack (if-not folded? (html-edn value)))
-                                              :classes (if stack "stack")})})))))))
+        (dom/td #js {:className (str "test-result-title "
+                                  (name type-))}
+          title)
+        (dom/td #js {:className "test-result"}
+          (dom/code nil
+            (ui-foldable
+              {:render (fn [folded?]
+                         {:title (if stack (str value)
+                                   (if folded? (str value) title))
+                          :value (if stack stack (if-not folded? (html-edn value)))
+                          :classes (if stack "stack")})})))))))
 (def ui-result-line (om/factory ResultLine {:keyfn (let [c (atom 0)]
-                                                #(str "result-line-" (swap! c inc)))}))
+                                                     #(str "result-line-" (swap! c inc)))}))

 (defui HumanDiffLines
   Object
@@ -59,17 +59,17 @@
     (let [d (om/props this)
           {:keys [exp got path]} (diff/extract d)]
       (dom/table #js {:className "human-diff-lines"}
-                 (dom/tbody nil
-                            (when (seq path)
-                              (dom/tr #js {:className "path"}
-                                      (dom/td nil "at: ")
-                                      (dom/td nil (str path))))
-                            (dom/tr #js {:className "expected"}
-                                    (dom/td nil "exp: ")
-                                    (dom/td nil (html-edn exp)))
-                            (dom/tr #js {:className "actual"}
-                                    (dom/td nil "got: ")
-                                    (dom/td nil (html-edn got))))))))
+        (dom/tbody nil
+          (when (seq path)
+            (dom/tr #js {:className "path"}
+              (dom/td nil "at: ")
+              (dom/td nil (str path))))
+          (dom/tr #js {:className "expected"}
+            (dom/td nil "exp: ")
+            (dom/td nil (html-edn exp)))
+          (dom/tr #js {:className "actual"}
+            (dom/td nil "got: ")
+            (dom/td nil (html-edn got))))))))
 (def ui-human-diff-lines (om/factory HumanDiffLines {:keyfn (let [c (atom 0)]
                                                               #(swap! c inc))}))

@@ -79,20 +79,20 @@
     (let [{:keys [diff actual]} (om/props this)
           [fst rst] (split-at 2 diff)]
       (->> (dom/div nil
-                    (when (associative? actual)
-                      (ui-foldable {:render (fn [folded?]
-                                              {:title "DIFF"
-                                               :value (html-edn actual diff)})}))
-                    (mapv ui-human-diff-lines fst)
-                    (if (seq rst)
-                      (ui-foldable {:render
-                                    (fn [folded?]
-                                      {:title "& more"
-                                       :value (mapv ui-human-diff-lines rst)
-                                       :classes ""})})))
+             (when (associative? actual)
+               (ui-foldable {:render (fn [folded?]
+                                       {:title "DIFF"
+                                        :value (html-edn actual diff)})}))
+             (mapv ui-human-diff-lines fst)
+             (if (seq rst)
+               (ui-foldable {:render
+                             (fn [folded?]
+                               {:title "& more"
+                                :value (mapv ui-human-diff-lines rst)
+                                :classes ""})})))
         (dom/td nil)
         (dom/tr #js {:className "human-diff"}
-                (dom/td nil "DIFFS:"))))))
+          (dom/td nil "DIFFS:"))))))
 (def ui-human-diff (om/factory HumanDiff {:keyfn (let [c (atom 0)]
                                                    #(str "human-diff-" (swap! c inc)))}))

@@ -101,30 +101,30 @@
   (render [this]
     (let [{:keys [where message extra actual expected stack diff]} (om/props this)]
       (->> (dom/tbody nil
-                      (dom/tr nil
-                              (dom/td #js {:className "test-result-title"}
-                                      "Where: ")
-                              (dom/td #js {:className "test-result"}
-                                      (s/replace (str where)
-                                                 #"G__\d+" "")))
-                      (when message
-                        (ui-result-line {:type :normal
-                                         :title "ASSERTION: "
-                                         :value message}))
-                      (ui-result-line {:type :normal
-                                       :title "Actual: "
-                                       :value actual
-                                       :stack stack})
-                      (ui-result-line {:type :normal
-                                       :title "Expected: "
-                                       :value (or expected "")})
-                      (when extra
-                        (ui-result-line {:type :normal
-                                         :title "Message: "
-                                         :value extra}))
-                      (when diff
-                        (ui-human-diff {:actual actual
-                                        :diff diff})))
+             (dom/tr nil
+               (dom/td #js {:className "test-result-title"}
+                 "Where: ")
+               (dom/td #js {:className "test-result"}
+                 (s/replace (str where)
+                   #"G__\d+" "")))
+             (when message
+               (ui-result-line {:type :normal
+                                :title "ASSERTION: "
+                                :value message}))
+             (ui-result-line {:type :normal
+                              :title "Actual: "
+                              :value actual
+                              :stack stack})
+             (ui-result-line {:type :normal
+                              :title "Expected: "
+                              :value (or expected "")})
+             (when extra
+               (ui-result-line {:type :normal
+                                :title "Message: "
+                                :value extra}))
+             (when diff
+               (ui-human-diff {:actual actual
+                               :diff diff})))
         (dom/table nil)
         (dom/li nil)))))
 (def ui-test-result (om/factory TestResult {:keyfn :id}))
@@ -137,15 +137,15 @@
     (let [test-item-data (om/props this)
           filter (:report/filter test-item-data) ]
       (dom/li #js {:className "test-item "}
-              (dom/div #js {:className (impl/filter-class test-item-data)}
-                       (dom/span #js {:className (impl/itemclass (:status test-item-data))}
-                                 (:name test-item-data))
-                       (dom/ul #js {:className "test-list"}
-                               (mapv ui-test-result
-                                     (:test-results test-item-data)))
-                       (dom/ul #js {:className "test-list"}
-                               (mapv (comp ui-test-item #(assoc % :report/filter filter))
-                                     (:test-items test-item-data))))))))
+        (dom/div #js {:className (impl/filter-class test-item-data)}
+          (dom/span #js {:className (impl/itemclass (:status test-item-data))}
+            (:name test-item-data))
+          (dom/ul #js {:className "test-list"}
+            (mapv ui-test-result
+              (:test-results test-item-data)))
+          (dom/ul #js {:className "test-list"}
+            (mapv (comp ui-test-item #(assoc % :report/filter filter))
+              (:test-items test-item-data))))))))
 (def ui-test-item (om/factory TestItem {:keyfn :id}))

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

 (defui FilterSelector
@@ -176,7 +176,7 @@
       (dom/a #js {:href (str "#" this-filter)
                   :className (if (= (name current-filter) this-filter)
                                "selected" "")}
-             (str this-filter)))))
+        (str this-filter)))))
 (def ui-filter-selector (om/factory FilterSelector {:keyfn :this-filter}))

 (defui Filters
@@ -184,11 +184,11 @@
   (render [this]
     (let [{:current-filter :report/filter} (om/props this)]
       (dom/div #js {:name "filters" :className "filter-controls"}
-               (dom/label #js {:htmlFor "filters"} "Filter: ")
-               (mapv (comp #(ui-filter-selector {:current-filter current-filter
-                                                 :this-filter %})
-                           name)
-                     [:all :manual :failed])))))
+        (dom/label #js {:htmlFor "filters"} "Filter: ")
+        (mapv (comp #(ui-filter-selector {:current-filter current-filter
+                                          :this-filter %})
+                name)
+          [:all :manual :failed])))))
 (def ui-filters (om/factory Filters {:keyfn :current-filter}))

 (defui TestCount
@@ -200,12 +200,12 @@
         (impl/change-favicon-to-color "#d00")
         (impl/change-favicon-to-color "#0d0"))
       (dom/div #js {:className "test-count"}
-               (dom/h2 nil
-                       (str "Tested " (count namespaces) " namespaces containing "
-                            total  " assertions. "
-                            passed " passed "
-                            failed " failed "
-                            error  " errors"))))))
+        (dom/h2 nil
+          (str "Tested " (count namespaces) " namespaces containing "
+            total  " assertions. "
+            passed " passed "
+            failed " failed "
+            error  " errors"))))))
 (def ui-test-count (om/factory TestCount))

 (defui TestReport
@@ -217,11 +217,11 @@
           test-report-data (-> props :top)
           current-filter (-> props :report/filter)]
       (dom/section #js {:className "test-report"}
-                   (ui-filters {:report/filter current-filter})
-                   (dom/ul #js {:className "test-list"}
-                           (->> (:namespaces test-report-data)
-                             (remove #(when (= :failed current-filter)
-                                        (not (#{:failed :error} (:status %)))))
-                             (mapv (comp ui-test-namespace
-                                         #(assoc % :report/filter current-filter)))))
-                   (ui-test-count test-report-data)))))
+        (ui-filters {:report/filter current-filter})
+        (dom/ul #js {:className "test-list"}
+          (->> (:namespaces test-report-data)
+            (remove #(when (= :failed current-filter)
+                       (not (#{:failed :error} (:status %)))))
+            (mapv (comp ui-test-namespace
+                    #(assoc % :report/filter current-filter)))))
+        (ui-test-count test-report-data)))))


Prevent instrumentation or profiling in deployed version

--- frontend/src/faceboard/env.cljs
+++ frontend/src/faceboard/env.cljs
@@ -14,8 +14,8 @@
 (def local? (not (defined? (:production env))))
 (def firebase-db (get env :firebase-db "blinding-heat-4410"))
 (def domain (.-host js/location))
-(def instrument? false)
-(def simple-profile? true)
+(def instrument? (and local? false))
+(def simple-profile? (and local? true))

 (defn init! []
   (enable-console-print!)


Make blank names editable

Make blank names editable

Can click on the text on the right too now to edit a name

--- idecode/myappshare/mainapp.cljs
+++ idecode/myappshare/mainapp.cljs
@@ -184,10 +184,10 @@
                         ; show the name of the app
                         :else
                         (do
-                          (span nil
-                          (div {:onClick     #(go  (write-ui app [:submode] "editappname")
+                          (span {:onClick     #(go  (write-ui app [:submode] "editappname")
                                                    (write-ui app [:app-id] (<-- :id))
-                                                   )
+                                                   )}
+                          (div {

                                 :style {:display "inline-block" :fontFamily "Ubuntu" :fontWeight "700" :fontSize "1.3em"  :marginLeft "20px"}}
                                (str (<-- :application_name)))
@@ -261,7 +261,7 @@
                                                        (write-ui app [:app-id] (<-- :id))
                                                        (evalapp (<-- :id))
                                                        )
-                               }
+                                 }
                               (span {

                                     :style {:display "inline-block" :fontFamily "Ubuntu" :fontWeight "700" :fontSize "1.3em" :marginTop "0.7em" :marginLeft "0.7em"}}


fix collapse aside link

fix collapse aside link

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -149,8 +149,7 @@
                            :data-bind "tooltip: {title: 'Logout', placement: 'right', trigger: 'hover'}"}
             [:i.fa.fa-sign-out]
             [:span "Logout"]]
-           [:a.aside-item {:href "#"
-                           :data-bind "tooltip: {title: 'Expand', placement: 'right', trigger: 'hover'}"
+           [:a.aside-item {:data-bind "tooltip: {title: 'Expand', placement: 'right', trigger: 'hover'}"
                            :on-click #(put! controls-ch [:slim-aside-toggled])}
             (if (:slim-aside? settings)
               [:i.fa.fa-long-arrow-right]


remove outdated todo [ci skip]

remove outdated todo [ci skip]

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -109,7 +109,6 @@
             show-all-branches? (get-in app state/show-all-branches-path)
             user (:current-user app)]
         (html/html
-         ;; XXX: browser settings
          [:nav.aside-left-nav {:class (when slim-aside? "slim")}
           [:a.aside-item.logo  {:data-bind "tooltip: {title: 'Home', placement: 'right', trigger: 'hover'}"
                                 ;; XXX: tooltips


Rename complete => completed to match the README

--- src/bltool/data/backloggery.clj
+++ src/bltool/data/backloggery.clj
@@ -63,7 +63,7 @@

 ; {:tag :a, :attrs {:href update.php?user=toxicfrog&gameid=4160408}
 (defn- gamebox-to-game [gamebox]
-  (let [progress-map { "(M)" "mastered" "(C)" "complete" "(B)" "beaten" "(U)" "unfinished" "(u)" "unplayed" "(-)" "null" }
+  (let [progress-map { "(M)" "mastered" "(C)" "completed" "(B)" "beaten" "(U)" "unfinished" "(u)" "unplayed" "(-)" "null" }
         bold (->> gamebox (tag-seq :b) (map :content) (map #(apply str %)) (map clojure.string/trim))
         id (-> (tag-seq :a gamebox) first :attrs :href (split #"gameid=") last)
         name (first bold)
@@ -120,7 +120,7 @@
   ({"unplayed" "1"
     "unfinished" "1"
     "beaten" "2"
-    "complete" "3"
+    "completed" "3"
     "mastered" "4"
     "null" "5"}
    desc))
@@ -196,56 +196,56 @@

 ; function bl:details(game)
 ;     assert(type(game) == "number", 'invalid argument to bl:details')
-
+
 ;     game = assert(self:games()[game], 'no game with id '..game)
-
+
 ;     if game._details then return game end
-
+
 ;     local body = assert(request(self, { user = self.user, gameid = game.id }, "GET", "http://backloggery.com/update.php"))
-
+
 ;     local function set(key, value)
 ;         if not game[key] then
 ;             game[key] = value
 ;         end
 ;     end
-
+
 ;     -- name, console, complete, note, wishlist, and playing were already
 ;     -- filled in by the initial loading of the game list
 ;     -- FIXME own should be as well
-
+
 ;     -- this leaves: comp, orig_console, region
 ;     -- achieve1, achieve2, online
 ;     -- rating, comments
-
+
 ;     set("comp", body:Find("input", "name", "comp").value)
-
+
 ;     set("orig_console", body:Find("select", "name", "orig_console"):Find("option", "selected", true).value)
 ;     set("_orig_console_str", bl.platforms[game.orig_console])
-
+
 ;     set("region", tonumber(body:Find("select", "name", "region"):Find("option", "selected", true).value))
 ;     set("_region_str", bl.regions[game.region])
-
+
 ;     set("achieve1", tonumber(body:Find("input", "name", "achieve1").value) or "")
 ;     set("achieve2", tonumber(body:Find("input", "name", "achieve2").value) or "")
-
+
 ;     set("online", body:Find("input", "name", "online").value)
 ;     set("comments", body:Find("textarea", "name", "comments"):Content())

 ;     -- set the "details" flag on this game, recording that all fields are filled in
 ;     set("_details", true)
-
+
 ;     return game
 ; end

 ; -- upload the changes we've made to a game structure to the server
 ; function bl:editgame(game)
 ;     assert(type(game) == "number", 'invalid argument to bl:editgame')
-
+
 ;     game = assert(self:games()[game], 'no game with id '..game)
-
+
 ;     -- fill in any missing fields
 ;     self:details(game.id)
-
+
 ;     -- the _ derived fields override the original ones
 ;     game.console = bl.rplatforms[game._console_str]
 ;     game.orig_console = bl.rplatforms[game._orig_console_str]
@@ -253,13 +253,13 @@
 ;     game.rating = game._stars - 1; if game.rating < 0 then game.rating = 8 end
 ;     game.complete = bl.completecode(game._complete_str)
 ;     game.submit2 = "Stealth Save"
-
+
 ;     -- create request
 ;     local r,e = request(self, game, "POST", "http://backloggery.com/update.php?user="..self.user.."&gameid="..game.id)
-
+
 ;     -- update internal structures
 ;     self:games()[game.id] = game
-
+
 ;     return game
 ; end


remove pretend

remove pretend

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/runtime/ui.cljs
+++ src/aurora/runtime/ui.cljs
@@ -211,14 +211,14 @@
         real-args (dissoc args "id" :id :style :events :event_key :entity)
         ]
     (when parent
-      (.push facts ["pretend" "ui/child" #js [parent pos id]]))
-    (.push facts ["pretend" "ui/elem" #js [id (name|sym el)]])
+      (.push facts ["know" "ui/child" #js [parent pos id]]))
+    (.push facts ["know" "ui/elem" #js [id (name|sym el)]])
     (doseq [[k v] real-args]
-      (.push facts ["pretend" "ui/attr" #js [id (name|sym k) v]]))
+      (.push facts ["know" "ui/attr" #js [id (name|sym k) v]]))
     (doseq [[k v] (:style args)]
-      (.push facts ["pretend" "ui/style" #js [id (name|sym k) v]]))
+      (.push facts ["know" "ui/style" #js [id (name|sym k) v]]))
     (doseq [ev (:events args)]
-      (.push facts ["pretend" "ui/event-listener" #js [id (name|sym ev) (or key "") (or entity "")]]))
+      (.push facts ["know" "ui/event-listener" #js [id (name|sym ev) (or key "") (or entity "")]]))
     (doseq [[i child] (map-indexed vector children)]
       (if (vector? child)
         (fact-walk-eve child facts [id i])
@@ -228,8 +228,8 @@
                            (str id "-" i))]
             (when (symbol? id)
               (.push facts ["when" "eve/compute" #js [child-id (str id " + " i)]]))
-            (.push facts ["pretend" "ui/text" #js [child-id child]])
-            (.push facts ["pretend" "ui/child" #js [id i child-id]]))
+            (.push facts ["know" "ui/text" #js [child-id child]])
+            (.push facts ["know" "ui/child" #js [id i child-id]]))
           )))))

 (defn hiccup->facts-eve [& hic]


cast first argument to Integer

cast first argument to Integer

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -75,7 +75,7 @@

 (defn sentences [ & [count spec model]]
-  (let [count (or count 100)
+  (let [count (or (Integer. count) 100)
         model (or model (medium))
         spec (or (and spec
                       (unifyc spec {:modified false}))
@@ -95,7 +95,7 @@
                         (str (string/capitalize (nth fo 0))
                              (string/join "" (rest (vec fo)))
                              "."))]
-                  (println (str num ". " to-print)))))
+                  (println (str (+ 1 num) ". " to-print)))))
             (range 0 count)))))


Refer history and scrolling vars

Refer history and scrolling vars

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -3,8 +3,10 @@
             [comic-reader.handlers :refer [init-handlers!]]
             [comic-reader.subscriptions
              :refer [init-subscriptions!]]
-            [comic-reader.history :as history]
-            [comic-reader.scrolling :as scrolling]
+            [comic-reader.history
+             :refer [hook-browser-navigation!]]
+            [comic-reader.scrolling
+             :refer [setup-scrolling-events!]]
             [reagent.core :as reagent :refer [atom]]
             [re-frame.core :as rf]
             [secretary.core :as secretary
@@ -105,9 +107,9 @@
 (defn ^:export run []
   (init-handlers!)
   (init-subscriptions!)
-  (scrolling/setup-scrolling-events!)
+  (setup-scrolling-events!)
   (try
-    (history/hook-browser-navigation!)
+    (hook-browser-navigation!)
     (catch js/Error e
       nil))
   (reagent/render [comic-reader]


Configure things for running the ring server

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -5,7 +5,7 @@

 (fw/start {
            ;; configure a websocket url if you are using your own server
-           ;; :websocket-url "ws://localhost:3449/figwheel-ws"
+           :websocket-url "ws://localhost:3449/figwheel-ws"

            ;; optional callback
            :on-jsload (fn [] (print "reloaded"))


::async/pipe-up plug recipe

::async/pipe-up plug recipe

--- src/cljs/reagent_plug/core.cljs
+++ src/cljs/reagent_plug/core.cljs
@@ -19,7 +19,6 @@
   (cleanup! [this]))

 (defmulti make-plug ^IPlug (fn [spec arg] (first spec)))
-

 (defn pluggable
   "Uses specs (a seq of clauses, which are vectors starting with a keyword) to transform a stateful Reagent component into a 'plugged' component.
@@ -83,6 +82,10 @@
   (let [curs (r/cursor ratom path)]
     (->Plug curs #(do nil) #(reset! curs nil))))

+(defmethod make-plug ::async/pipe-up [[_] parent-chan]
+  (let [local-chan (async/chan)]
+    (->Plug local-chan #(async/pipe local-chan parent-chan false) #(async/close! local-chan))))
+
 ;; you could also imagine implementations for EventTargets, bacon.js streams etc.


Add missing variable conexp-namespaces for c.c.doc

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

--- src/conexp/contrib/doc.clj
+++ src/conexp/contrib/doc.clj
@@ -30,6 +30,8 @@
                        (ns-map ns))))))

 ;;; Documentation Coverage
+
+(def- conexp-namespaces '[conexp.base conexp.fca conexp.io conexp.layouts])

 (defn conexp-fns-needing-doc
   "Returns function in public conexp-clj API not having documentation."


Hooked up moderation update fn in conv actor


clean up create-webhook

clean up create-webhook

--- src/gh_waiting_room/service.clj
+++ src/gh_waiting_room/service.clj
@@ -36,10 +36,20 @@
   []
   (merge {:filter "all" :all-pages true} (gh-auth)))

-(defn create-webhook []
-  (create-hook "cldwalker" "gh-waiting-room" "web"
-               {:url "http://localhost:8080/webhook" :content_type "json"}
+; TODO: can this come from url-for?
+(defn- full-url-for [path]
+  (str (or (System/getenv "APP_DOMAIN") "http://localhost:8080") path))
+
+(defn create-webhook [user name]
+  (create-hook user name "web"
+               {:url (full-url-for "/webhook") :content_type "json"}
                (assoc (gh-auth) :events ["issues"])))
+
+(defn get-in! [m ks]
+  (or (get-in m ks) (throw (ex-info "No value found for nested keys in map" {:map m :keys ks}))))
+
+(defn get! [m k]
+  (or (get m k) (throw (ex-info "No value found for key in map" {:map m :key k}))))

 (defn- issue-filter
   [issue]
@@ -55,12 +65,6 @@
 (defn- fetch-gh-issues
   []
   (swap! db assoc :issues (my-issues (api-options))))
-
-(defn get! [m k]
-  (or (get m k) (throw (ex-info "No value found for key in map" {:map m :key k}))))
-
-(defn get-in! [m ks]
-  (or (get-in m ks) (throw (ex-info "No value found for nested keys in map" {:map m :keys ks}))))

 (defn- ->issue [issue]
   {:name (format "%s#%s"
@@ -94,10 +98,6 @@
    (render-resource "public/index.mustache"
                     {:github-user (gh-user)
                      :issues (viewable-issues)})))
-
-; TODO: can this come from url-for?
-(defn- full-url-for [path]
-  (str (or (System/getenv "APP_DOMAIN") "http://localhost:8080") path))

 (defn- comment-body [issue]
   (str


Fix ex-info

Fix ex-info

--- modules/aleph/src/modular/aleph.clj
+++ modules/aleph/src/modular/aleph.clj
@@ -20,7 +20,7 @@
      (request-handler provider))

    ;; Or an exception is thrown
-   (throw (ex-info (format "aleph http server requires a handler, or a dependency that satisfies %s" WebRequestHandler)))))
+   (throw (ex-info (format "aleph http server requires a handler, or a dependency that satisfies %s" WebRequestHandler) {}))))

 (defrecord Webserver [handler]
   Lifecycle


RNA to DNA.

RNA to DNA.

--- clojure/rna-transcription/dna.clj
+++ clojure/rna-transcription/dna.clj
@@ -1,6 +1,21 @@
-(ns dna)
+(ns dna
+  (:use [clojure.string :only [join]]))
+
+(def dna-to-rna {"G" "C", "C" "G", "T" "A", "A" "U"})
+
+(defn- valid-dna-strand? [strand]
+  (contains? dna-to-rna strand))
+
+(defn- validate-dna-seq [strand]
+  ;; clojure.contrib.except/throw-if-not would be suitable
+  (when-not (valid-dna-strand? strand)
+    (throw (AssertionError.
+            (format "Unknown DNA strand: %s" strand)))))
+
+(defn- validate-and-transcribe [strand-as-char]
+  (let [strand (str strand-as-char)]
+    (validate-dna-seq strand)
+    (dna-to-rna strand)))

 (defn to-rna [dna-seq]
-  (let
-      [dna-to-rna {"G" "C", "C" "G", "T" "A", "A" "U"}]
-    (dna-to-rna dna-seq)))
+  (join "" (map validate-and-transcribe dna-seq)))


Disabling logging of stacktrace errors with color codes

--- common-lib/src/cmr/common/log.clj
+++ common-lib/src/cmr/common/log.clj
@@ -12,7 +12,6 @@
   a UUID so it's easy to search for. If request id is not set the thread name or id will be used."
   nil)

-;; TODO test logging by running an application
 ;; Checkout the config before and after
 (defn- setup-logging
   "Configures logging using Timbre."
@@ -28,7 +27,6 @@
       (.. (io/file file) getParentFile mkdirs)
       (t/merge-config! {:appenders {:spit (a/spit-appender {:fname file})}})))

-
   ;; Set the format for logging.
   (t/merge-config! {:output-fn
                     (fn [{:keys [level ?err_ msg_ timestamp_ hostname_ ?ns-str] :as data}]
@@ -41,7 +39,7 @@
                               (or ?ns-str "?ns")
                               (force msg_)
                               (if-let [err (force ?err_)]
-                                (str "\n" (t/stacktrace err))
+                                (str "\n" (t/stacktrace err {:stacktrace-fonts {}}))
                                 "")))
                     :appenders {:println {:enabled? stdout-enabled?}}}))

@@ -82,8 +80,8 @@
    ;; The path to the file to log to
    file
    ;;
-   stdout-enabled?
-   ]
+   stdout-enabled?]
+

   lifecycle/Lifecycle


added missing integration test for deleting projects on an api level

--- src/integration/clojure/com/xebia/visualreview/itest/integration_test.clj
+++ src/integration/clojure/com/xebia/visualreview/itest/integration_test.clj
@@ -58,4 +58,14 @@
     (testing "Project name can not be empty"
       (let [response (api/put-project! {:name ""})]
         (is (= 422 (:status response)) "Unprocessable entity status code")
-        (is (re-find #"can not be empty" (:body response)) "Return error message")))))+        (is (re-find #"can not be empty" (:body response)) "Return error message"))))
+
+  (testing "Deleting projects"
+    (testing "Project can be deleted and returns true"
+      (let [created-project (:body (api/put-project! {:name "my soon-to-be-deleted project"}))
+            project-before-deletion (:body (api/get-project (:id created-project)))
+            response-status (:status (api/delete-project! (:id project-before-deletion)))
+            project-after-deletion-status (:status (api/get-project (:id project-before-deletion)))]
+        (is (not(nil? project-before-deletion)))
+        (is (= response-status 204))
+        (is (= project-after-deletion-status 404))))))


Fixed issue #1

Fixed issue #1

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -200,7 +200,7 @@
         repository-url   (-> gitlab-info :repository :url)
         repository-name  (-> gitlab-info :repository :name)
         repository-group (-> gitlab-info :project :namespace)
-        branch           (get-branch (-> gitlab-info :ref))
+        branch           (get-branch (:ref gitlab-info))
         before           (-> gitlab-info :before)
         after            (-> gitlab-info :after)
         operation        (get-operation before after)]


Fixed db-selection bug reported by Yu-Xi Lim.

--- src/carmine/connections.clj
+++ src/carmine/connections.clj
@@ -61,7 +61,7 @@
     (when password (carmine.protocol/with-context conn
                      (carmine.core/auth password)))
     (when (not (zero? db)) (carmine.protocol/with-context conn
-                             (carmine.core/select db)))
+                             (carmine.core/select (str db))))
     conn))

 (defrecord NonPooledConnectionPool []


We need this ability to setup toplevel defs to test protocols and named fns

--- test/cljs/go_test.clj
+++ test/cljs/go_test.clj
@@ -63,6 +63,17 @@
   (clojure.pprint/pprint ast)
   (println"*/"))

+(defn test-setup [setup]
+  (let [ast (-> [setup] cljs->ast)]
+    (test-comment setup ast)
+    (printf "\t%s\n" (ast->go ast))))
+
+(defn test-setup-toplevel [setup]
+  (binding [cljs.analyzer/*cljs-file* (.getAbsolutePath (io/file (io/resource "cljs/go_test.clj")))
+            cljs.compiler/*go-line-numbers* true]
+    (with-out-str
+      (test-setup setup))))
+
 (defn testify [test & assertions]
   (binding [cljs.analyzer/*cljs-file* (.getAbsolutePath (io/file (io/resource "cljs/go_test.clj")))
             cljs.compiler/*go-line-numbers* true]
@@ -72,9 +83,7 @@
               :let [ast (-> [actual] (cljs->ast (assoc (cljs.analyzer/empty-env) :context :expr)))]]
         (when setup
           (printf "{\n")
-          (let [ast (-> [setup] cljs->ast)]
-            (test-comment setup ast)
-            (printf "\t%s\n" (ast->go ast))))
+          (test-setup setup))
         (test-comment actual (first ast))
         (printf "\tassert.Equal(t%s, %s%s)\n"
                 (if (nil? expected) "" (str ", \n" expected))
@@ -185,8 +194,10 @@
                      (recur (inc y))))])
     (testify "Do"
              [3 '(do 1 2 3)])
+    (test-setup-toplevel
+     '(def x 2))
     (testify "Def"
-             [2 'x '(def x 2)])
+             [2 'x])
     (testify "New"
              ["&js.Date{Millis: 0}" '(js/Date. 0)])
     (testify "Dot"


Fix for login as admin

Fix for login as admin

--- src/clj/salava/admin/db.clj
+++ src/clj/salava/admin/db.clj
@@ -1,5 +1,5 @@
 (ns salava.admin.db
- (:require [yesql.core :refer [defqueries]]
+  (:require [yesql.core :refer [defqueries]]
             [clojure.set :refer [rename-keys]]
             [clojure.java.jdbc :as jdbc]
             [salava.core.helper :refer [dump]]
@@ -24,14 +24,12 @@
 (defn get-owners [ctx]
   (select-admin-users-id {} (get-db ctx)))

-
 (defn get-user-admin-events [ctx user_id]
   (select-admin-events {:user_id user_id} (get-db ctx)))

 (defn get-admin-events [ctx user_id]
   (let [events (get-user-admin-events ctx user_id)]
-   events))
-
+    events))

 (defn register-users-count
   "Get count from all active and registered users"
@@ -84,16 +82,13 @@
    (catch Object _
      "error")))

-
 (defn private-badges! [ctx badge_id]
   (try+
-   (update-user-badge-visibility-by-badge-id!{ :badge_id badge_id} (get-db ctx))
+   (update-user-badge-visibility-by-badge-id! {:badge_id badge_id} (get-db ctx))
    (update-badge-visibility-by-badge-id! {:badge_id badge_id} (get-db ctx))
    "success"
    (catch Object _
      "error")))
-
-

 (defn private-page! [ctx id]
   (try+
@@ -134,7 +129,7 @@

 (defn delete-badge! [ctx id  user-id subject message]
   (try+
-   (let [user-id (select-user-id-by-badge-id {:id id}(into {:result-set-fn first :row-fn :user_id} (get-db ctx)))
+   (let [user-id (select-user-id-by-badge-id {:id id} (into {:result-set-fn first :row-fn :user_id} (get-db ctx)))
          user (select-user-and-email {:id user-id} (into {:result-set-fn first} (get-db ctx)))]
      (m/send-mail ctx subject message [(:email user)])
      (update-badge-deleted! {:id id} (get-db ctx)))
@@ -144,7 +139,7 @@

 (defn delete-badges! [ctx badge-id subject message]
   (try+
-   (let [user-ids (select-users-id-by-badge-id {:badge_id badge-id}(into {:row-fn :user_id} (get-db ctx)))
+   (let [user-ids (select-users-id-by-badge-id {:badge_id badge-id} (into {:row-fn :user_id} (get-db ctx)))
          users-email (select-users-email {:user_id user-ids} (into {:result-set-fn vec :row-fn :email} (get-db ctx)))]
      (if (and (< 1 (count subject)) (< 1 (count message)))
        (m/send-mail ctx subject message users-email))
@@ -168,10 +163,10 @@
   (try+
    (if (and (< 1 (count subject)) (< 1 (count message)))
      (m/send-mail ctx subject message [email]))
-   (update-user-pages-set-private! {:user_id user-id}(get-db ctx))
-   (update-user-badges-set-private! {:user_id user-id}(get-db ctx))
-   (delete-user-badge-congratulations! {:user_id user-id}(get-db ctx))
-   (delete-user-badge-views! {:user_id user-id}(get-db ctx))
+   (update-user-pages-set-private! {:user_id user-id} (get-db ctx))
+   (update-user-badges-set-private! {:user_id user-id} (get-db ctx))
+   (delete-user-badge-congratulations! {:user_id user-id} (get-db ctx))
+   (delete-user-badge-views! {:user_id user-id} (get-db ctx))
    (update-user-deleted! {:id user-id} (get-db ctx))
    "success"
    (catch Object _
@@ -200,18 +195,15 @@
    "success"
    (catch Object _
      "error")))
-

 (defn get-user-name-and-primary-email [ctx user_id]
   (let [user (select-user-and-email {:id user_id} (into {:result-set-fn first} (get-db ctx)))]
     (hash-map :name (str (:first_name user) " " (:last_name user))
               :email (:email user))))

-
 (defn get-oauth-user-services [ctx user_id]
   (let [fun (first (plugin-fun (get-plugins ctx) "block" "user-information"))]
-    (fun ctx user_id))
-  )
+    (fun ctx user_id)))

 (defn get-user [ctx user_id]
   (let [user (u/user-information-with-registered-and-last-login ctx user_id)
@@ -229,7 +221,6 @@
                      :activated (:activated user)
                      :has_password? (:has_password user)
                      :service user-services})))
-

 (defn get-badge-modal [ctx badgeid]
   (let [badge  (b/get-badge ctx badgeid nil)
@@ -252,9 +243,9 @@
 (defn get-public-badge-content-modal [ctx badge-id user-id]
   (let [badge (g/public-multilanguage-badge-content ctx badge-id user-id)
                                         ;badge (g/select-common-badge-content {:id badge-id} (into {:result-set-fn first} (get-db ctx)))
-        badge-content (first (filter #(= (:language_code %) (:default_language_code %)) (get-in badge [:badge :content]))) ;(g/select-badge-criteria-issuer-by-date {:badge_id badge-id} (into {:result-set-fn first} (get-db ctx)))
+        badge-content (first (filter #(= (:language_code %) (:default_language_code %)) (get-in badge [:badge :content])))] ;(g/select-badge-criteria-issuer-by-date {:badge_id badge-id} (into {:result-set-fn first} (get-db ctx)))
         ;recipients (g/select-badge-recipients {:badge_id badge-id} (get-db ctx))
-        ]
+
     (hash-map :name (:name badge-content)
               :image_file (:image_file badge-content)
               :item_owner_id  (vec (map :id (:public_users badge)))
@@ -268,7 +259,6 @@
                      :creator_email       (:creator_email badge-content)
                      :creator_image       (:creator_image badge-content)})))

-
 (defn get-page-modal [ctx pageid]
   (let [page  (p/page-with-blocks ctx pageid)
         user (u/user-information ctx (:user_id page))
@@ -286,7 +276,6 @@
         (select-keys (conj countries current-country))
         (sort-countries)
         (seq))))
-

 (defn all-profiles
   "Search all user profiles by user's name, email and country"
@@ -321,13 +310,12 @@
                    order
                    " LIMIT 50")
         profiles (jdbc/with-db-connection
-                   [conn (:connection (get-db ctx))]
-                   (jdbc/query conn (into [query] params)))]
+                  [conn (:connection (get-db ctx))]
+                  (jdbc/query conn (into [query] params)))]

     (->> profiles
          (take 50))))

-
 (defn delete-no-verified-adress [ctx user-id email]
   (try+
    (delete-email-no-verified-address! {:user_id user-id :email email} (get-db ctx))
@@ -342,8 +330,6 @@
    "success"
    (catch Object _
      "error")))
-
-

 (defn send-user-activation-message
   "Send activation message to user"
@@ -359,10 +345,10 @@
     (try+
      (if (not (:activated user))
        (m/send-activation-message ctx site-url (u/activation-link site-url base-path user-id activation_code language) (u/login-link site-url base-path) (str first-name " " last-name) email language)
-      (throw+ "error") )
+       (throw+ "error"))
      "success"
      (catch Object _
-     "error"))))
+       "error"))))

 (defn user-information
   "Get user data by user-id"
@@ -373,25 +359,22 @@
     user))

 (defn set-fake-session [ctx ok-status user-id real-user-id]
-  (let [{:keys [role id private activated]} (user-information ctx user-id)]
+  (let [{:keys [role id private activated]} (user-information ctx user-id)
+        expires (+ (long (/ (System/currentTimeMillis) 1000)) (get-in ctx [:config :core :session :max-age]))]
     (log/info "admin-id: " real-user-id " is login as user-id: " user-id)
-    (assoc-in ok-status [:session :identity] {:id id :role role :private private :activated activated :real-id real-user-id})
-
-    )
-  )
+    (assoc-in ok-status [:session :identity] {:id id :role role :private private :activated activated :real-id real-user-id :expires expires})))

 (defn set-session [ctx ok-status user-id]
-  (let [{:keys [role id private activated]} (user-information ctx user-id)]
+  (let [{:keys [role id private activated]} (user-information ctx user-id)
+        expires (+ (long (/ (System/currentTimeMillis) 1000)) (get-in ctx [:config :core :session :max-age]))]
     (log/info "admin-id: " user-id " logged out from user")
-    (assoc-in ok-status [:session :identity] {:id id :role role :private private :activated activated})))
+    (assoc-in ok-status [:session :identity] {:id id :role role :private private :activated activated :expires expires})))

 (defn update-user-to-admin [ctx user-id]
   (log/info "admin set user-id: " user-id "to admin.")
   (update-user-to-admin! {:id user-id} (get-db ctx))
-  "success"
-  )
+  "success")

 (defn update-admin-to-user [ctx user-id]
   (log/info "admin set user-id:" user-id "to admin.")
-  (update-admin-to-user! {:id user-id} (get-db ctx))
-  )
+  (update-admin-to-user! {:id user-id} (get-db ctx)))


Reserialize queries for better comparability

--- src/clj/sparqlab/sparql.clj
+++ src/clj/sparqlab/sparql.clj
@@ -91,7 +91,7 @@
   [^String query]
   (let [parsed-query (QueryFactory/create query)]
     {:query parsed-query
-     :query-string query
+     :query-string (serialize-query parsed-query)
      :query-type (get-query-type parsed-query)}))

 (defn equal-query?


add profile to config map

add profile to config map

--- src/clj/starcity/config.clj
+++ src/clj/starcity/config.clj
@@ -39,7 +39,8 @@
   (assert (#{:production :development} profile)
           (format "Profile must be one of #{:production :development}, not %s!" profile))
   (let [defaults (read-config (config-file "config.edn"))]
-    (merge-with merge
-                defaults
-                (read-config (config-for-profile profile))
-                (read-secrets +secrets-file+))))
+    (-> (merge-with merge
+                    defaults
+                    (read-config (config-for-profile profile))
+                    (read-secrets +secrets-file+))
+        (assoc :profile profile))))


WIP added new applyTo for multi-arity lambdas

--- src/clj/wombat/compiler.clj
+++ src/clj/wombat/compiler.clj
@@ -5,7 +5,7 @@
             [wombat.printer :refer :all]
             [wombat.datatypes :refer :all])
   (:import [org.objectweb.asm ClassWriter ClassVisitor Opcodes Type Handle]
-           [org.objectweb.asm.commons GeneratorAdapter Method]
+           [org.objectweb.asm.commons GeneratorAdapter Method TableSwitchGenerator]
            [clojure.lang DynamicClassLoader Compiler RT LineNumberingPushbackReader
             Keyword Symbol Numbers BigInt Ratio]
            [java.lang.invoke MethodType MethodHandle MethodHandles MethodHandles$Lookup
@@ -151,7 +151,7 @@

 (defn validate-rest-token!
   [params]
-  (when-let [rest (seq (drop-while (complement special-token?) variadic))]
+  (when-let [rest (seq (drop-while (complement special-token?) params))]
     (when (not= (count rest) 2)
       (throw (IllegalArgumentException. "invalid placement of #!rest token")))))

@@ -192,8 +192,9 @@

 (defn sanitize-case-lambda
   [env [_ methods :as form]]
-  (for [[params & body] (validate-arities methods)]
-    ))
+  (cons 'case-lambda
+        (for [[params & body] (validate-arities methods)]
+          (sanitize-method env params body))))

 (defn named-let
   [[_ name bindings & body]]
@@ -292,6 +293,12 @@

      (['lambda params & body] :seq)
      (apply disj (free-vars body) (cons *lambda-name* (remove special-token? params)))
+
+     (['case-lambda & methods] :seq)
+     (reduce into (sorted-set)
+             (map #(apply disj (free-vars (second %))
+                          (cons *lambda-name* (remove special-token? (first %))))
+                  methods))

      ([(:or 'let 'letrec) bindings & body] :seq)
      (let [[name bindings & body] (if (symbol? bindings)
@@ -423,7 +430,7 @@
     (. gen endMethod)))

 (defn emit-arity-exception
-  [^GeneratorAdapter gen proper-arity restarg given-arity-fn]
+  [^GeneratorAdapter gen ^Type thistype given-arity-fn]
   (. gen newInstance (asmtype IllegalArgumentException))
   (. gen dup)
   (. gen newInstance (asmtype StringBuilder))
@@ -433,7 +440,7 @@
   (. gen invokeVirtual (asmtype StringBuilder) (Method/getMethod "StringBuilder append(String)"))
   (given-arity-fn)
   (. gen invokeVirtual (asmtype StringBuilder) (Method/getMethod "StringBuilder append(int)"))
-  (. gen push (str " for " proper-arity (when restarg "+") ")"))
+  (. gen push (str ") passed to: " (.getClassName thistype)))
   (. gen invokeVirtual (asmtype StringBuilder) (Method/getMethod "StringBuilder append(String)"))
   (. gen invokeVirtual (asmtype StringBuilder) (Method/getMethod "String toString()"))
   (. gen invokeConstructor (asmtype IllegalArgumentException) (Method/getMethod "void <init>(String)"))
@@ -463,17 +470,18 @@
   (. gen pop))

 (defn gen-applier
-  [^ClassWriter cw {:keys [params restarg ^Type thistype] :as env}]
+  [^ClassWriter cw ^Type thistype arglists]
   (let [gen (GeneratorAdapter. Opcodes/ACC_PUBLIC (Method/getMethod "Object applyTo(Object)") nil nil cw)
         bad-arity (. gen newLabel)
         invoke-label (. gen newLabel)
-        loop-start (. gen newLabel)
         list-local (. gen newLocal (asmtype wombat.datatypes.List))
-        positional-args (repeat (count params) object-type)
-        sig (into-array Type (if restarg
-                               (conj (vec positional-args) (asmtype object-array-class))
-                               positional-args))
-        method (Method. "invoke" object-type sig)
+        fixed-arities (sort (map count (remove #((set %) rest-token) arglists)))
+        variadic (if-let [varg (some #(and ((set %) rest-token) %) arglists)]
+                   (dec (count varg)))
+        min-varg-arity (when variadic
+                         (if (= (last fixed-arities) (dec variadic))
+                           variadic
+                           (dec variadic)))
         emit-list-cnt (fn []
                         (let [is-null (. gen newLabel)
                               end (. gen newLabel)]
@@ -485,39 +493,54 @@
                           (. gen mark is-null)
                           (. gen pop)
                           (AsmUtil/pushInt gen 0)
-                          (. gen mark end)))]
+                          (. gen mark end)))
+        unroll-list (fn [n]
+                      (dotimes [_ n]
+                        (. gen dup)
+                        (. gen getField (asmtype wombat.datatypes.List) "head" object-type)
+                        (. gen swap)
+                        (. gen getField (asmtype wombat.datatypes.List) "tail" object-type)
+                        (. gen checkCast (asmtype wombat.datatypes.List))))]
     (. gen visitCode)
-
+
     (. gen loadArg 0)
     (. gen checkCast (asmtype wombat.datatypes.List))
     (. gen storeLocal list-local)

-    (emit-list-cnt)
-    (AsmUtil/pushInt gen (count params))
-    (if restarg
-      (. gen ifCmp Type/INT_TYPE GeneratorAdapter/LT bad-arity)
-      (. gen ifCmp Type/INT_TYPE GeneratorAdapter/NE bad-arity))
-
-    (. gen loadThis)
-    (. gen loadLocal list-local)
-    (dotimes [_ (count params)]
-      (. gen dup)
-      (. gen getField (asmtype wombat.datatypes.List) "head" object-type)
-      (. gen swap)
-      (. gen getField (asmtype wombat.datatypes.List) "tail" object-type)
-      (. gen checkCast (asmtype wombat.datatypes.List)))
-
-    (if restarg
-      (. gen invokeStatic (asmtype RT) (Method/getMethod "Object[] seqToArray(clojure.lang.ISeq)"))
-      (. gen pop))
-
-    (. gen goTo invoke-label)
-
-    (. gen mark bad-arity)
-    (emit-arity-exception gen (count params) restarg emit-list-cnt)
-    (. gen mark invoke-label)
-
-    (. gen invokeVirtual thistype method)
+    (let [switch-label (. gen newLabel)
+          end-switch-label (. gen newLabel)
+          switch-generator (reify TableSwitchGenerator
+                             (generateCase [this key end]
+                               (let [method (Method. "invoke" object-type (into-array Type (repeat key object-type)))]
+                                 (. gen loadThis)
+                                 (. gen loadLocal list-local)
+                                 (unroll-list key)
+                                 (. gen storeLocal list-local) ; should be null
+                                 (. gen invokeVirtual thistype method)
+                                 (. gen goTo end)))
+                             (generateDefault [this]
+                               (emit-arity-exception gen thistype emit-list-cnt)))]
+      (emit-list-cnt)
+      (if variadic
+        (. gen dup)
+        (AsmUtil/pushInt gen min-varg-arity)
+        (. gen ifCmp Type/INT_TYPE GeneratorAdapter/LT switch-label)
+        (. gen pop) ; pop list count
+        (. gen loadThis)
+        (. gen loadLocal list-local)
+        (unroll-list (dec variadic))
+        (. gen invokeStatic (asmtype RT) (Method/getMethod "Object[] seqToArray(clojure.lang.ISeq)"))
+        (. gen visitInsn Opcodes/ACONST_NULL)
+        (. gen storeLocal list-local)
+        (. gen invokeVirtual thistype (Method. "invoke" object-type (into-array Type (concat (repeat (dec variadic) object-type)
+                                                                                (list object-array-type)))))
+        (. gen goTo end-switch-label))
+
+      (. gen mark switch-label)
+      ;; list count is on stack
+      (. gen switchTable (int-array fixed-arities) end-switch-label)
+      (. gen mark end-switch-label))
+
     (. gen returnValue)
     (. gen endMethod)))

@@ -604,12 +627,6 @@
       (. gen returnValue)
       (. gen endMethod))))

-(defn validate-params!
-  [params]
-  (when (and (some #{rest-token} params)
-             (not= (count (drop-while (complement #{rest-token}) params)) 2))
-    (throw (IllegalArgumentException. "#!rest may only be followed by one symbol!"))))
-
 (def ^:dynamic *compiled-lambdas*)

 (defmulti compile
@@ -622,27 +639,48 @@
   <closed-overs>"

   first)
+
+(defn gen-methods
+  [^ClassWriter cw {:keys [thistype] :as env} methods]
+  (let [before-rest (complement #{rest-token})
+        arglists (map first methods)]
+    (doseq [[params & body] methods]
+      (let [env (assoc env
+                  :params (take-while before-rest params)
+                  :restarg (second (drop-while before-rest params)))]
+        (gen-body cw env body)))
+    (gen-applier cw thistype arglists)
+    (gen-handle cw thistype arglists)))
+
+(defn compile-lambda
+  [[_ & methods :as form]]
+  (let [fv (vec (free-vars form))
+        cw (ClassWriter. ClassWriter/COMPUTE_FRAMES)
+        lname (str (dotmunge (str (or *top-level* *lambda-name* 'lambda))) "_" (next-id))
+        fqname (str "wombat/" lname)
+        _ (debug "fqname:" fqname)
+        dotname (.replace fqname "/" ".")
+        ifaces (into-array String ["wombat/ILambda"])
+        env {:closed-overs fv
+             :locals {}
+             :recur-sym *lambda-name*
+             :thistype (Type/getObjectType fqname)}]
+    (. cw visit Opcodes/V1_7 Opcodes/ACC_PUBLIC fqname nil "java/lang/Object" ifaces)
+    (gen-closure-fields cw fv)
+    (gen-ctor cw fqname fv)
+    (binding [*lambda-name* (if *top-level* *lambda-name* nil)]
+      (gen-methods cw env methods))
+    (. cw visitEnd)))

 (defmethod compile 'lambda
   [[_ params & body :as lambda]]
   (when-not (get @*compiled-lambdas* lambda)
     (validate-params! params)
     (debug "Compiling:" lambda)
-    (let [fv (vec (free-vars lambda))
-          cw (ClassWriter. ClassWriter/COMPUTE_FRAMES)
-          lname (str (dotmunge (str (or *lambda-name* 'lambda))) "_" (next-id))
-          fqname (str "wombat/" lname)
-          _ (debug "fqname:" fqname)
-          dotname (.replace fqname "/" ".")
-          ifaces (into-array String ["wombat/ILambda"])
+    (let [
           before-rest (complement #{rest-token})
           restarg (second (drop-while before-rest params))
-          env {:params (take-while before-rest params)
-               :closed-overs fv
-               :locals {}
-               :recur-sym *lambda-name* ;; TODO: Enable named lambdas
-               :thistype (Type/getObjectType fqname)
-               :restarg restarg}]
+]
       (binding [*lambda-name* (if *top-level* *lambda-name* nil)]
         (. cw visit Opcodes/V1_7 Opcodes/ACC_PUBLIC fqname nil "java/lang/Object" ifaces)
         (gen-closure-fields cw fv)
@@ -654,6 +692,16 @@
       (swap! *compiled-lambdas* conj lambda)
       [dotname (.toByteArray cw) fv])))

+(defmethod compile 'case-lambda
+  [[_ & methods :as case-lambda]]
+  (debug "Compiling:" case-lambda)
+  (let [fv (vec (free-vars case-lambda))
+        cw (ClassWriter. ClassWriter/COMPUTE_FRAMES)
+        lname (str (dotmunge (str (or *lambda-name* 'lambda))) "_" (next-id))
+        fqname (str "wombat/" lname)
+        dotname (.replace fqname "/" ".")
+        ifaces (into-array String ["wombat/ILambda"])]))
+
 (defn emit
   [env context gen form]
   (cond
@@ -853,7 +901,7 @@
 (defmethod emit-seq 'lambda
   [env context ^GeneratorAdapter gen [_ params & body :as lambda]]
   (when-not (= context :context/statement)
-    (let [[dotname bytecode closed-overs] (binding [*top-level* false]
+    (let [[dotname bytecode closed-overs] (binding [*top-level* nil]
                                             (compile lambda))]
       (. *class-loader* defineClass dotname bytecode lambda)
       (let [slashname (.replace dotname "." "/")]
@@ -1183,7 +1231,7 @@
 (defn compile-and-load
   ^Class [form]
   (debug "COMPILE-AND-LOAD: " form)
-  (binding [*top-level* true]
+  (binding [*top-level* 'eval]
     (let [[name bytecode] (compile form)]
       (.defineClass *class-loader* name bytecode form)
       (Class/forName name true *class-loader*))))


app-view needed to be an Om component - thank you Dave Della Costa!

--- src/cljs/om_sente/core.cljs
+++ src/cljs/om_sente/core.cljs
@@ -55,10 +55,13 @@
       (dom/div nil text))))

 (defn app-view [app owner]
-  (dom/div nil
-           (dom/h1 nil "Test Sente")
-           (om/build field-view app {})
-           (om/build data-view app {})))
+  (reify
+    om/IRender
+    (render [this]
+      (dom/div nil
+               (dom/h1 nil "Test Sente")
+               (om/build field-view app {})
+               (om/build data-view app {})))))

 (om/root app-view
          app-state


Dispatch uri only on navigation event

Dispatch uri only on navigation event

--- src/cljs/subman/routes.cljs
+++ src/cljs/subman/routes.cljs
@@ -28,7 +28,8 @@
     (secretary/set-config! :state state)
     (secretary/dispatch! (.getToken @d/history))
     (gevents/listen @d/history history-event/NAVIGATE
-                    #(secretary/dispatch! (.-token %)))))
+                    #(when (.-isNavigation %)
+                      secretary/dispatch! (.-token %)))))

 (defroute main-page "/" []
           (set-search-query ""))


Enhance types

Enhance types

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -35,10 +35,10 @@

 (defn move? [m]
   (and
-    (:move m)
+    (coord? (:move m))
     (every? coord? (:taken m))
-    (:winner m)
-    (:looser m)))
+    (player? (:winner m))
+    (cell? (:looser m))))

 ;; -----------------------------------------


Conditional views implemented

Conditional views implemented

--- src/cljs/zhcljsom/core.cljs
+++ src/cljs/zhcljsom/core.cljs
@@ -9,7 +9,7 @@

 (defn some-stories []
 [
-  {:Title "The title 1" :Introduction "The introduction 1" :Published "04/27/2016 - 18:38" :Reference "aHR0cDovL3d3dy56ZXJvaGVkZ2UuY29tL25ld3MvMjAxNi0wNC0yNy9lbmQtdmVuZXp1ZWxhLXJ1bnMtb3V0LW1vbmV5LXByaW50LW5ldy1tb25leQ=="}
+  {:Title "The title 1" :Introduction "The introduction 1" :Published "04/27/2016 - 18:38" :Reference "aHR0cDovL3d3dy56ZXJvaGVkZ2UuY29tL25ld3MvMjAxNi0wNC0yNy9lbmQtdmVuZXp1ZWxhLXJ1bnMtb3V0LW1vbmV5LXByaW50LW5ldy1tb25leQ==" :Body "The story body" }
   {:Title "The title 2" :Introduction "The introduction 2" :Published "04/27/2017 - 18:38" :Reference "R0cDovL3d3dy56ZXJvaGVkZ2UuY29tL25ld3MvMjAxNi0wNC0yNy9lbmQtdmVuZXp1ZWxhLXJ1bnMtb3V0LW1vbmV5LXByaW50LW5ldy1tb25leQ=="}
   {:Title "The title 3" :Introduction "The introduction 3" :Published "04/27/2016 - 18:38" :Reference "HR0cDovL3d3dy56ZXJvaGVkZ2UuY29tL25ld3MvMjAxNi0wNC0yNy9lbmQtdmVuZXp1ZWxhLXJ1bnMtb3V0LW1vbmV5LXByaW50LW5ldy1tb25leQ=="}
 ;  "Lion" "Zebra" "Buffalo" "Antelope"
@@ -18,16 +18,54 @@
 )

-
-
-(defonce app-state (atom {:stories  (some-stories)}))
+(defonce app-state
+  ;; View = 0 corresponds to the items list view
+  ;; View = 1 corresponds to the single item view
+  (atom {:stories (some-stories) :view 0 })
+)

 (defn display-title [{:keys [Title Introduction] :as story}]
   (str Title)
 )

-
+(defn error-handler [{:keys [status status-text]}]
+  (.log js/console (str "something bad happened: " status " " status-text)))
+
+
+
+(defn OnDownloadStory [response]
+  (
+    let [
+      ;;newdata (js->clj response)
+      newdata (vector {:Title (get response "Title")  :Introduction (get response "Introduction")
+         :Reference (get response "Reference") :Body (get response "Body")}
+     )
+
+
+;;[{:Title (get (first response) "Title") :Introduction  (get (first response) "Introduction") :Reference  (get (first response) "Reference") :Updated  (get (first response) "Updated") :Published (get (first response) "Pub;ished")}]
+    ]
+
+    (.log js/console (str newdata))
+    ;;(.log js/console (str (select-keys (js->clj response) [:Title :Reference :Introduction])  ))
+    ;(swap! app-state assoc-in pageid newdata )
+    (swap! app-state assoc-in [:stories] newdata )
+    (swap! app-state assoc-in [:view] 1 )
+  )
+
+  ;;(.log js/console (str  (response) ))
+  ;;(.log js/console (str  (get (first response)  "Title") ))
+
+
+
+)
+
+
+(defn downloadstory [href]
+  (GET (str "http://localhost:8083/api/story/" href)  {:handler OnDownloadStory
+                                              :error-handler error-handler})
+
+)

 (defn story-view [story owner]
@@ -37,9 +75,9 @@
       (dom/div #js  {:className "panel-primary"}
         (dom/div #js {:className "panel-heading"}
           (dom/h3 #js {:className "panel-title"}
-            (dom/a #js {:href (str "../story" (get story :Reference))}
-              (dom/div #js {:dangerouslySetInnerHTML #js {:__html (get story :Title)}} nil)
-            nil )
+            (dom/a #js {:href "#" :onClick (fn [e] (downloadstory (get story :Reference)))}
+               (dom/div #js {:dangerouslySetInnerHTML #js {:__html (get story :Title)}} nil)
+            )
           nil )
         )
         (dom/div #js {:className "panel-body"}
@@ -50,8 +88,6 @@
   )
 )

-(defn error-handler [{:keys [status status-text]}]
-  (.log js/console (str "something bad happened: " status " " status-text)))

 (defn handler [response]
   (
@@ -62,15 +98,9 @@
       (map
         (fn [story]
           (assoc story
-           :Title (get story "Title") :Introduction (get story "Introduction") :Reference (get story "Reference") ))
+           :Title (get story "Title") :Introduction (get story "Introduction") :Reference (get story "Reference") :view 0))
               (get response "Data")
       ))
-
-
-
-
-
-;;[{:Title (get (first response) "Title") :Introduction  (get (first response) "Introduction") :Reference  (get (first response) "Reference") :Updated  (get (first response) "Updated") :Published (get (first response) "Pub;ished")}]
     ]

     (.log js/console (str pageid))
@@ -86,6 +116,10 @@

 )

+
+
+
+
 (defn downloadpage [pageid]
   (GET (str "http://localhost:8083/api/page/" pageid)  {:handler handler
                                               :error-handler error-handler})
@@ -93,11 +127,31 @@
 )

-(defn stripe [story bgc]0
-  (let [st #js {:backgroundColor bgc}]
-    (dom/li #js {:style st} (get story :Title))))
-
-(defn stories-view [app owner]
+
+(defn single-story-view [data]
+  (dom/div #js  {:className "panel-primary"}
+    (dom/div #js {:className "panel-heading"}
+      (dom/h3 #js {:className "panel-title"}
+        (dom/div #js {:dangerouslySetInnerHTML #js {:__html (get (first (:stories data))  :Title)  }}
+         nil)
+       nil )
+    )
+    (dom/div #js {:className "panel-body"}
+      (dom/div #js {:dangerouslySetInnerHTML #js {:__html  (get (first (:stories data))  :Body)}} nil)
+    )
+  )
+)
+
+(defn item-view [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (single-story-view data)
+    )
+  )
+)
+
+(defn list-view [app owner]
   (reify
     om/IRender
     (render [_]
@@ -147,19 +201,49 @@
           )
         )
       )
-      ;(apply dom/ul #js {:className "animals"}
-        ;(map story-view (:stories app) )
-      ;)
-
-    )
-  )
-)
-
-
+    )
+  )
+)
+
+(defmulti website-view (fn [data _] (:view data)))
+
+(defmethod website-view 0
+  [data owner]
+  (list-view data owner)
+)
+
+(defmethod website-view 1
+  [data owner]
+  (item-view data owner)
+)
+
+
+(defn changeview [data]
+  (->> data
+    :stories
+    (mapv (fn [x]
+            (if (:view data)
+              x)
+      )
+    )
+  )
+)
+
+(defn main-view [app owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div nil
+        ;(apply dom/ul nil      )
+        (om/build website-view app {:key :Reference} )
+      )
+    )
+  )
+)

 (om/root
- stories-view
+ main-view
  app-state
  {:target (js/document.getElementById "app")})


Make construct-pending-intent public

Make construct-pending-intent public

--- src/clojure/neko/notify.clj
+++ src/clojure/neko/notify.clj
@@ -33,7 +33,7 @@
   []
   (.getSystemService app/context Context/NOTIFICATION_SERVICE))

-(defn- construct-pending-intent
+(defn construct-pending-intent
   "Creates a PendingIntent instance from a vector where the first
   element is a keyword representing the action type, and the second
   element is a action string to create an Intent from."


cleanup

cleanup


Expand a Clojure example

Expand a Clojure example

--- clojure/count_and_conj.clj
+++ clojure/count_and_conj.clj
@@ -1,9 +1,9 @@
 (use 'clojure.test)
 (let [a-list '(1 2 3) a-vec [1 2 3] a-set #{1 2 3} a-map {1 2 3 4}]
-  (is (= (count a-list) 3))
-  (is (= (count a-vec) 3))
-  (is (= (count a-set) 3))
-  (is (= (count a-map) 2))                   ; num of key-val pairs
+  (is (= (empty? a-set)) false)
+  (is (not-empty a-vec))
+  (is (= (map count [a-list a-vec a-set]) [3 3 3]))
+  (is (= (count a-map) 2))
   (is (= (conj a-list 4) '(4 1 2 3)))        ; list: conj to front
   (is (= (conj a-vec 4) [1 2 3 4]))          ; vec: conj adds to end
   (is (= (conj a-set 4) #{3 2 1 4}))         ; order is irrelevant


Make Subvecs viewable in the inspector

Make Subvecs viewable in the inspector

--- src-cljs/frontend/components/inspector.cljs
+++ src-cljs/frontend/components/inspector.cljs
@@ -20,7 +20,10 @@

   PersistentHashMap
   (-inspect [this]
-    (ankha/coll-view this "{" "}" "map persistent-hash-map" sort-map-by-pr)))
+    (ankha/coll-view this "{" "}" "map persistent-hash-map" sort-map-by-pr))
+
+  Subvec
+  (-inspect [this] (ankha/-inspect (vec this))))

 (defui ^:once Inspector
   Object


Fix remove-morph: filter returned tuple instead of vec

--- src-cljs/cljs_workspace/om_morph.cljs
+++ src-cljs/cljs_workspace/om_morph.cljs
@@ -94,8 +94,7 @@
 (defn remove-morph [model id morph-id]
   (let [prop-path (get-prop-path model id [:submorphs])
         submorphs (get-in @model prop-path)]
-    (prn "after removal: " (filter #(not= (% :id) morph-id) submorphs))
-    (swap! model assoc-in prop-path (filter #(not= (% :id) morph-id) submorphs))))
+    (swap! model assoc-in prop-path (into [] (filter #(not= (% :id) morph-id) submorphs)))))

 (defn set-fill [model id color]
   (let [prop-path (get-prop-path model id [:shape :Fill])]


Fix radial menu hover issue

Fix radial menu hover issue

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -70,28 +70,32 @@
                  (when (get-in app [:menu :open?])
                    [:div.radial-menu {:style {:top  (- (get-in app [:menu :y]) 128)
                                               :left (- (get-in app [:menu :x]) 128)}}
-                    [:button {:on-mouse-up #(cast! :tool-selected [:text])
+                    [:button {:on-mouse-up #(do (cast! :tool-selected [:text])
+                                                (om/set-state! owner :hovered-tool false))
                               :on-mouse-enter #(om/set-state! owner :hovered-tool true)
                               :on-mouse-leave #(om/set-state! owner :hovered-tool false)
                               :class (when hovered-tool? "hover")}
                      [:object
                       (common/icon :tool-text)
                       [:span "Text"]]]
-                    [:button {:on-mouse-up #(cast! :tool-selected [:select])
+                    [:button {:on-mouse-up  #(do (cast! :tool-selected [:select])
+                                                 (om/set-state! owner :hovered-tool-select false))
                               :on-mouse-enter #(om/set-state! owner :hovered-tool-select true)
                               :on-mouse-leave #(om/set-state! owner :hovered-tool-select false)
                               :class (when hovered-tool-select? "hover")}
                      [:object
                       (common/icon :cursor)
                       [:span "Select"]]]
-                    [:button {:on-mouse-up #(cast! :tool-selected [:shape])
+                    [:button {:on-mouse-up #(do (cast! :tool-selected [:shape])
+                                                (om/set-state! owner :hovered-tool-shape false))
                               :on-mouse-enter #(om/set-state! owner :hovered-tool-shape true)
                               :on-mouse-leave #(om/set-state! owner :hovered-tool-shape false)
                               :class (when hovered-tool-shape? "hover")}
                      [:object
                       (common/icon :tool-square)
                       [:span "Shape"]]]
-                    [:button {:on-mouse-up #(cast! :tool-selected [:line])
+                    [:button {:on-mouse-up #(do (cast! :tool-selected [:line])
+                                                (om/set-state! owner :hovered-tool-line false))
                               :on-mouse-enter #(om/set-state! owner :hovered-tool-line true)
                               :on-mouse-leave #(om/set-state! owner :hovered-tool-line false)
                               :class (when hovered-tool-line? "hover")}


Go back on cancel.

Go back on cancel.

--- src-cljs/kixi/hecuba/new_profile.cljs
+++ src-cljs/kixi/hecuba/new_profile.cljs
@@ -83,7 +83,7 @@
              "Save"]
             [:button {:type "button"
                       :class "btn btn-danger"
-                      :onClick (fn [_] (set! (.-location js/window) "/app"))}
+                      :onClick (fn [_] (.back js/history))}
              "Cancel"]]]

           [:div.col-md-12 {:id "alert-div" :style {:padding-top "10px"}}


simplify do-assocs

simplify do-assocs


Handle ongoing builds when accumulating

Handle ongoing builds when accumulating

--- src/buildviz/gosync.clj
+++ src/buildviz/gosync.clj
@@ -84,15 +84,21 @@
   (let [build (get-json "/jobStatus.json?pipelineName=&stageName=&jobId=%s" jobId)]
     (parse-build-info build)))

+(defn accumulate-build-times [builds]
+  (let [start-times (map :start builds)
+        end-times (map :end builds)]
+    (if (empty? (filter nil? end-times))
+      {:start (apply min start-times)
+       :end (apply max end-times)}
+      {})))
+
 (defn accumulate-builds [builds]
   (let [outcomes (map :outcome builds)
-        start-times (map :start builds)
-        end-times (map :end builds)]
-    {:start (apply min start-times)
-     :end (apply max end-times)
-     :outcome (if (every? #(= "pass" %) outcomes)
-                "pass"
-                "fail")}))
+        accumulated-outcome (if (every? #(= "pass" %) outcomes)
+                              "pass"
+                              "fail")]
+    (assoc (accumulate-build-times builds)
+           :outcome accumulated-outcome)))

 (defn build-for-job [job-instance]
   (if-let [jobs-for-accumulation (:jobs-for-accumulation job-instance)]


cljfmt fix

cljfmt fix


good so far

good so far

--- src/epicea/utils/access.clj
+++ src/epicea/utils/access.clj
@@ -62,8 +62,18 @@
         (accessor-error "missing value"
                         accessor x nil)))))

+(defn make-valid-output? [accessor]
+  (:valid-value? accessor))
+
+(defn make-valid-input? [accessor]
+  (let [c? (:can-set accessor)
+        v? (:valid-value? accessor)]
+    (fn [obj x]
+      (and (v? x)
+           (c? obj x)))))
+
 (defn make-validate-value [accessor]
-  (let [v? (:valid-value? accessor)]
+  (let [v? (:valid-output? accessor)]
     (fn [x]
       (if (v? x)
         x
@@ -102,7 +112,6 @@
       (b (s (b obj) (v x))))))

 (defn make-checked-remove [accessor]
-  (debug/dout accessor)
   (let [b (:validate-base accessor)
         r (:remove accessor)
         r? (:can-remove? accessor)]
@@ -138,6 +147,8 @@

 (def decorators [[:validate-base make-validate-base]
                  [:validate-has make-validate-has]
+                 [:valid-output? make-valid-output?]
+                 [:valid-input? make-valid-input?]
                  [:validate-value make-validate-value]
                  [:get-optional-unchecked make-get-optional-unchecked]
                  [:get-optional make-get-optional]
@@ -175,7 +186,9 @@
 (defn vector-methods [index]
   {:can-get? #(< index (count %))
    :get #(nth % index)
-   :set (fn [obj x] (assoc obj index x))})
+   :set (fn [obj x] (assoc obj index x))
+   :can-remove? (constantly false)
+   :remove identity})

 (defn vector-accessor
   ([index extra-opts]


CMR-4254: Fixed metadata-db int-test.

CMR-4254: Fixed metadata-db int-test.


Fix test max-80-characters-length-in-docstrings.


Adapt `display-filter`, `image-filter` and `ellipse-mode` for use with p5js. Issue #255.

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -1454,7 +1454,7 @@
              corners of the ellipse's bounding box."
   [mode]
   (let [mode (u/resolve-constant-key mode ellipse-modes)]
-    (.ellipseMode (current-graphics) (int mode))))
+    (.ellipseMode (current-graphics) mode)))

 #?(:clj
    (defn
@@ -1626,9 +1626,9 @@
                colors specified as the level parameter. The parameter can
                be set to values between 2 and 255, but results are most
                noticeable in the lower ranges.
-  :blur      - executes a Guassian blur with the level parameter
+  :blur      - executes a Gaussian blur with the level parameter
                specifying the extent of the blurring. If no level
-               parameter is used, the blur is equivalent to Guassian
+               parameter is used, the blur is equivalent to Gaussian
                blur of radius 1.
   :opaque    - sets the alpha channel to entirely opaque. Doesn't work
                with level.
@@ -1636,11 +1636,11 @@
   :dilate    - increases the light areas.  Doesn't work with level."
   ([mode]
    (.filter (current-graphics)
-            (int (u/resolve-constant-key mode filter-modes))))
+            (u/resolve-constant-key mode filter-modes)))

   ([mode level]
    (let [mode (u/resolve-constant-key mode filter-modes)]
-     (.filter (current-graphics) (int mode) (float level)))))
+     (.filter (current-graphics) mode (float level)))))

 #?(:clj
    (defn
@@ -1966,9 +1966,9 @@
                colors specified as the level parameter. The parameter can
                be set to values between 2 and 255, but results are most
                noticeable in the lower ranges.
-  :blur      - executes a Guassian blur with the level parameter
+  :blur      - executes a Gaussian blur with the level parameter
                specifying the extent of the blurring. If no level
-               parameter is used, the blur is equivalent to Guassian
+               parameter is used, the blur is equivalent to Gaussian
                blur of radius 1.
   :opaque    - sets the alpha channel to entirely opaque. Doesn't work
                with level.
@@ -1976,10 +1976,10 @@
   :dilate    - increases the light areas.  Doesn't work with level."
   ([^PImage img mode]
    (let [mode (u/resolve-constant-key mode filter-modes)]
-     (.filter img (int mode))))
+     (.filter img mode)))
   ([^PImage img mode level]
    (let [mode (u/resolve-constant-key mode filter-modes)]
-     (.filter img (int mode) (float level)))))
+     (.filter img mode (float level)))))

 (defn
   ^{:requires-bindings true


fix typos

fix typos


Add the ability to add a phone number

Add the ability to add a phone number

--- src/cljs/pplz/core.cljs
+++ src/cljs/pplz/core.cljs
@@ -7,40 +7,47 @@
             [clojure.string :as string]))

 (defonce app-state (atom {:contacts [
-                                     {:first "Vincent" :last "Chase"}
-                                     {:first "Ari" :last "Gold"}
-                                     {:first "Johnny" :last "Drama"}]}))
+                                     {:first "Vincent" :last "Chase" :phone "610-234-4567"}
+                                     {:first "Ari" :last "Gold" :phone "543-567-8907"}
+                                     {:first "Johnny" :last "Drama" :phone "345-789-1000"}]}))

 (defn build-contact
-  [contact]
-  (let [[first last :as full-name] (string/split contact #"\s+")]
-    {:first first :last last}))
+  [name phone]
+  (let [[first last :as full-name] (string/split name #"\s+")
+        phone phone]
+    {:first first :last last :phone phone}))

 (defn add-contact
   [contacts owner]
-  (let [new-contact (-> (om/get-node owner "new-contact")
-                        .-value
-                        (build-contact contact))]
-    (when new-contact
+  (let [new-contact-name (-> (om/get-node owner "new-contact-name")
+                        .-value)
+
+        new-contact-phone (-> (om/get-node owner "new-contact-phone")
+                              .-value)
+        new-contact (build-contact new-contact-name new-contact-phone)]
+    (when new-contact-name
       (om/transact! contacts :contacts #(conj % new-contact))
-      (om/set-state! owner :text ""))))
+      (om/set-state! owner :name "")
+      (om/set-state! owner :phone ""))))

 (defn contact-view
   [contact owner]
   (reify
     om/IRenderState
     (render-state
-      [this {:keys [delete]}]
+      [this state]
+      (println state)
       (dom/tr nil
               (dom/td nil (:first contact))
-              (dom/td nil (:last contact)
-                      (dom/td nil
-                              (dom/button #js {:onClick
-                                               (fn [e] (put! delete @contact))} "Delete")))))))
+              (dom/td nil (:last contact))
+              (dom/td nil (:phone contact))
+              (dom/td nil
+                      (dom/button #js {:onClick
+                                       (fn [e] (put! (:delete state) @contact))} "Delete"))))))

 (defn handle-change
-  [e owner {:keys [text]}]
-  (om/set-state! owner :text (.. e -target -value)))
+  [e owner state key]
+  (om/set-state! owner key (.. e -target -value)))

 (defn contacts-view
@@ -50,7 +57,8 @@
     (init-state
       [_]
       {:delete (chan)
-       :text ""})
+       :name ""
+       :phone ""})
     om/IWillMount
     (will-mount
       [_]
@@ -75,10 +83,12 @@
                                              (dom/td nil "Actions")))
                           (apply dom/tbody nil
                                  (om/build-all contact-view (:contacts contacts)
-                                               {:init-state {:delete delete}})))
+                                               {:init-state state})))
                (dom/div nil
-                        (dom/input #js {:type "text" :ref "new-contact" :value (:text state)
-                                        :onChange #(handle-change % owner state)})
+                        (dom/input #js {:type "text" :ref "new-contact-name" :value (:name state)
+                                        :onChange #(handle-change % owner state :name)})
+                        (dom/input #js {:type "text" :ref "new-contact-phone" :value (:phone state)
+                                        :onChange #(handle-change % owner state :phone)})
                         (dom/button #js {:onClick #(add-contact contacts owner)} "Add Contact"))))))

 (defn main []


lein kibit

lein kibit

--- src/cljs/ufo/views.cljs
+++ src/cljs/ufo/views.cljs
@@ -32,10 +32,10 @@
              [:tr {:key (str "tr-" i)}
               (let [id (name id-val)
                     salary-val (:salary hm)
-                    salary (if salary-val salary-val ;; auto-onclick
+                    salary (or salary-val ;; auto-onclick
                                (re-frame/dispatch [:id id]))
                     abbrev-val (:abbrev hm)
-                    abbrev (if abbrev-val abbrev-val ;; auto-onclick
+                    abbrev (or abbrev-val ;; auto-onclick
                                (re-frame/dispatch [:id id]))]
                 (doall
                  (map #(td i % @loading?)


Fixed issue #30: Print proper error message when some static file can't be send to the client.

--- src/clouseau/server.clj
+++ src/clouseau/server.clj
@@ -371,9 +371,10 @@
     [file-name content-type]
     (let [file (new java.io.File "www" file-name)]
         (println-and-flush "Returning file " (.getAbsolutePath file))
-        (println-and-flush "")
-        (-> (http-response/response file)
-            (http-response/content-type content-type))))
+        (if (.exists file)
+            (-> (http-response/response file)
+                (http-response/content-type content-type))
+            (println-and-flush "return-file(): can not access file: " (.getName file)))))

 (defn handler
     "Handler that is called by Ring for all requests received from user(s)."


[#3061] Refactor

[#3061] Refactor

--- backend/src/akvo/lumen/lib/transformation/engine.clj
+++ backend/src/akvo/lumen/lib/transformation/engine.clj
@@ -146,14 +146,17 @@
             {}
             changed-columns)))

+(defn datagroup-by-column [data-groups column-name]
+  (->> data-groups
+       (filter (fn [dg] (seq (filter #(= column-name (get % "columnName")) (:columns dg)))))
+       first))
+
 (defn execute-transformation-2
   [{:keys [tenant-conn] :as deps} dataset-id job-execution-id transformation]
   (let [dataset-version (db.dataset-version/latest-dataset-version-2-by-dataset-id tenant-conn {:dataset-id dataset-id})
         data-groups (db.data-group/list-data-groups-by-dataset-version-id tenant-conn {:dataset-version-id (:id dataset-version)})
         column-name (first (columns-used (w/keywordize-keys transformation) (reduce into [] (map :columns data-groups))))
-        data-group (->> data-groups
-                        (filter (fn [dg] (seq (filter #(= column-name (get % "columnName")) (:columns dg)))))
-                        first)
+        data-group (datagroup-by-column data-groups column-name)
         source-table (:table-name data-group)
         other-dgs-columns (db.data-group/get-all-columns-except-group-id tenant-conn {:dataset-version-id (:id dataset-version)
                                                                                :group-id (:group-id data-group)})


'generate' action implemented, not fully tested.

--- KataTrigrams/src/kata_trigrams/core.clj
+++ KataTrigrams/src/kata_trigrams/core.clj
@@ -20,6 +20,5 @@
    words-count words in it."
   [index-filename words-count]
   (let [trigrams (json->trigrams-map (slurp index-filename))]
-    ;; TODO
-    ))
+    (-> [] (generate-words trigrams words-count) join-space println)))


Simplified implementation of context-from-clop

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

--- src/conexp/fca/more.clj
+++ src/conexp/fca/more.clj
@@ -163,20 +163,17 @@

 (defn context-from-clop
   "Returns a context whose intents are exactly the closed sets of the
-  given closure operator on the given base-set.
-
-  Note: This implementation is slow."
+  given closure operator on the given base-set."
   [base-set clop]
-  (let [clop-handler (fn [ctx _ impl]
-                       (let [A (premise impl),
-                             B (conclusion impl),
-                             C (clop A)]
-                         (when-not (subset? B C)
-                           [[(gensym) C]])))]
-    (-> (explore-attributes (make-context #{} base-set #{})
-                            :handler clop-handler)
-        :context
-        reduce-context)))
+  (-> (explore-attributes (make-context #{} base-set #{})
+                          :handler (fn [_ _ impl]
+                                     (let [A (premise impl),
+                                           B (conclusion impl),
+                                           C (clop A)]
+                                       (when-not (subset? B C)
+                                         [[(gensym) C]]))))
+      :context
+      reduce-context))

 ;;;


arity mistake

arity mistake

--- src/datasplash/core.clj
+++ src/datasplash/core.clj
@@ -1785,7 +1785,7 @@
                        (.every  (->duration step))
                        (Window/into))]
      (apply-transform pcoll transform named-schema options)))
-  ([width step ^PCollection pcoll] (sliding-windows width step pcoll)))
+  ([width step ^PCollection pcoll] (sliding-windows width step {} pcoll)))

 (defn session-windows
   {:doc (with-opts-docstr
@@ -1805,4 +1805,4 @@
                        (Sessions/withGapDuration)
                        (Window/into))]
      (apply-transform pcoll transform named-schema options)))
-  ([gap ^PCollection pcoll] (sliding-windows gap pcoll)))
+  ([gap ^PCollection pcoll] (sliding-windows gap {} pcoll)))


little echo endpoint for testing

little echo endpoint for testing

--- src/dwc_rest/server.clj
+++ src/dwc_rest/server.clj
@@ -37,6 +37,11 @@
   (GET "/" []
     (redirect "/index.html"))

+  (POST "/echo" req
+    (let [data (slurp (:body req))]
+      (println "/echo" data)
+      {:status 200 :body data}))
+
   (context "/api" []
     (context "/v1" [] api-v1-routes))


Return error if library not found.

Return error if library not found.

--- src/clj/hatnik/web/server/handler.clj
+++ src/clj/hatnik/web/server/handler.clj
@@ -44,9 +44,13 @@
   (timbre/info "Initialisation finished."))

 (defn library-version [library]
-  (resp/response
-   {:result :ok
-    :version (ver/latest-release library)}))
+  (if-let [version (ver/latest-release library)]
+    (resp/response
+     {:result :ok
+      :version version})
+    (resp/response
+     {:result :error
+      :message (str "Library " library " not found")})))

 (defn wrap-authenticated-only [handler]
   (fn [req]


Slight restructuring of toggle-listbox code

--- src/clj_ns_browser/toggle_listbox.clj
+++ src/clj_ns_browser/toggle_listbox.clj
@@ -36,7 +36,7 @@
 (defn config-as-toggle-listbox! [id label-strs cur-label-str-order-atom]
   (let [label-str-set (set label-strs)
         buttons (map (fn [label]
-                       {:name label
+                       {:label label
                         :button-sel (toggle :text label :selected? true)
                         :button-unsel (toggle :text label :selected? false)})
                      label-strs)
@@ -44,26 +44,24 @@
                                   buttons))
         max-height (apply max (map #(-> % :button-sel .getPreferredSize .height)
                                    buttons))
-        name-to-icons (into {}
-                            (map (fn [{:keys [name button-sel button-unsel]}]
-                                   [name
-                                    {:icon-unselected
-                                     (component-icon-image button-unsel
-                                                           max-width max-height)
-                                     :icon-selected
-                                     (component-icon-image button-sel
-                                                           max-width max-height)
-                                     }])
-                                 buttons))
+        label-to-icon-sel (into {}
+                           (map (fn [{:keys [label button-sel]}]
+                                  [label
+                                   (component-icon-image button-sel
+                                                         max-width max-height)])
+                                buttons))
+        label-to-icon-unsel (into {}
+                           (map (fn [{:keys [label button-unsel]}]
+                                  [label
+                                   (component-icon-image button-unsel
+                                                         max-width max-height)])
+                                buttons))
         render-lb-item (fn [renderer info]
-                         (let [{:keys [value selected?]} info]
-                           (config! renderer
-                                    :icon (get-in name-to-icons
-                                                  [value (if selected?
-                                                           :icon-selected
-                                                           :icon-unselected)])
-                                    :text "")))
-        ]
+                         (let [{:keys [value selected?]} info
+                               m (if selected?
+                                   label-to-icon-sel
+                                   label-to-icon-unsel)]
+                           (config! renderer :icon (m value) :text "")))]
     (reset! cur-label-str-order-atom label-strs)
     (config! id
              :model label-strs


allow user to customize channel pool queue channel

--- src/cljs/wilkerdev/util/reactive.cljs
+++ src/cljs/wilkerdev/util/reactive.cljs
@@ -328,22 +328,23 @@
             (<! (:source v))
             (:value (get @mem args))))))))

-(defn channel-pool [n]
-  (let [queue (chan 1024)]
-    (dotimes [_ n]
-      (go
-        (loop []
-          (when-let [[input output] (<! queue)]
-            (<! (go
-                  (loop []
-                    (if-let [v (<! input)]
-                      (do
-                        (>! output v)
-                        (recur))
-                      (close! output)))
-                  nil))
-            (recur)))))
-    queue))
+(defn channel-pool
+  ([n] (channel-pool n (chan 2048)))
+  ([n queue]
+   (dotimes [_ n]
+     (go
+       (loop []
+         (when-let [[input output] (<! queue)]
+           (<! (go
+                 (loop []
+                   (if-let [v (<! input)]
+                     (do
+                       (>! output v)
+                       (recur))
+                     (close! output)))
+                 nil))
+           (recur)))))
+   queue))

 (defn pool-enqueue [pool source]
   (let [c (chan)]


No inline checkboxes

No inline checkboxes

--- src/clojurescript/skuld/show_group/app.cljs
+++ src/clojurescript/skuld/show_group/app.cljs
@@ -120,7 +120,7 @@
        [:label "Shared with"]
        [:div {:class "form-group"}
         (for [[n c] @shared-with]
-          ^{:key n} [:div {:class "form-check form-check-inline"}
+          ^{:key n} [:div {:class "form-check"}
                      [:label {:class "form-check-label"}
                       [:input {:class "form-check-input"
                                :type "checkbox"


Convert build to a normal map, apparently defrecord isn't happy with large numbers of fields.

--- src/circle/backend/build.clj
+++ src/circle/backend/build.clj
@@ -16,9 +16,11 @@
                   continue  ;; if true, continue running the build. Failed actions will set this to false
                   ])

-(defn build [& {:keys [project-name build-num vcs-type vcs-url vcs-revision aws-credentials r53-zone-id notify-email actions action-results group num-nodes lb-name continue]
-                :or {failed false}}]
-  (Build. project-name build-num vcs-type vcs-url vcs-revision aws-credentials r53-zone-id notify-email actions (or action-results []) group num-nodes lb-name true))
+;; (defn build [& {:keys [project-name build-num vcs-type vcs-url vcs-revision aws-credentials r53-zone-id notify-email actions action-results group num-nodes lb-name continue]
+;;                 :or {failed false}}]
+;;   (Build. project-name build-num vcs-type vcs-url vcs-revision aws-credentials r53-zone-id notify-email actions (or action-results []) group num-nodes lb-name true))
+
+(def build hash-map)

 (defrecord BuildContext [build
                          action


added libs in static html for designer - 3

--- src/clj/geoforms/handler.clj
+++ src/clj/geoforms/handler.clj
@@ -21,12 +21,13 @@
      #_(include-css "https://www.votepour.ca/assets/stylesheets/geoforms.css")]
     [:body {:style "height: 100%"}
      [:div#app
-      [:h3 "Votepour.ca / Geoforms"]
+      [:p "Votepour.ca / Geoforms"]
       [:p "Chargement... / Loading..."]
-      (when (env :dev)
+      (if (env :dev)
         [:p "please run "
          [:b "lein figwheel"]
-         " in order to start the compiler"])]
+         " in order to start the compiler"]
+        [:p "Problèmes de chargement ? SVP contactez info@votepour.ca / Not loading? Please contact info@votepour.ca"])]
      (include-js "https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.10/es5-shim.min.js")
      (include-js "https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.10/es5-sham.min.js")
      (include-js "js/app.js")


creator info pdf

creator info pdf

--- src/clj/salava/badge/pdf.clj
+++ src/clj/salava/badge/pdf.clj
@@ -135,12 +135,13 @@
                                                                 [:chunk.chunk (str (t :badge/IssuerContact ul)": ")] (:issuer_contact %)]

                                                                (when-not (= "-" (and (:creator_description %) (:creator_url %) (:creator_email %) ))
-                                                                 [:paragraph
-                                                                  [:paragraph.generic
-                                                                   [:chunk.chunk (str (t :badge/CreatorDescription ul)": ")] (:creator_description %)]
-                                                                  [:paragraph.generic
-                                                                   [:chunk.chunk (str (t :badge/CreatorWebsite ul)": ")] [:anchor {:target (:creator_url %) :style{:family :times-roman :color [66 100 162]}} (:creator_url %)] "\n"]
-                                                                  [:paragraph.generic
+                                                                 [:paragraph.generic
+                                                                  [:spacer 0]
+                                                                  [:paragraph
+                                                                   [:chunk.chunk (str (t :badge/CreatorDescription ul)": ")] (:creator_description %) "\n"]
+                                                                  [:paragraph
+                                                                   [:chunk.chunk (str (t :badge/CreatorWebsite ul)": ")] [:anchor {:target (:creator_url %) :style{:family :times-roman :color [66 100 162]}} (:creator_url %)]]
+                                                                  [:paragraph
                                                                    [:chunk.chunk (str (t :badge/CreatorContact ul)": ")] (:creator_email %)]])
                                                                (let [issuer-endorsement (replace-nils (select-issuer-endorsements {:id (:issuer_content_id %)} (u/get-db ctx)))]
                                                                  (when-not (empty? issuer-endorsement)


alignments data export

alignments data export

--- src/clj/salava/user/data.clj
+++ src/clj/salava/user/data.clj
@@ -250,13 +250,14 @@
                                                                                )
                                                                                (when (not-empty (:alignment %))
                                                                                [:paragraph
-                                                                                [:chunk.chunk (str (t :badge/Alignments ul) ": ")]"\n"
+                                                                                [:chunk.chunk (str (t :badge/Alignments ul) ": " (count (:alignment %)))]"\n"
                                                                                (into [:paragraph ]
                                                                                (for [a (:alignment %)]
                                                                                [:paragraph
-                                                                                [:chunk.chunk (str (t :badge/Name ul) ": ")] [:chunk (or (:name a) "-")]"\n"
-                                                                                [:chunk.chunk (str (t :page/Description ul) ": ")] [:chunk (or (:description a) "-")]"\n"
-                                                                                [:chunk.chunk (str (t :badge/URL ul) ": ")] [:chunk.link (or (:url a) "")]]))
+                                                                                [:chunk (or (:name a) "-")]"\n"
+                                                                                [:chunk (or (:description a) "-")]"\n"
+                                                                                [:chunk.link (or (:url a) "")]
+                                                                                [:spacer 0]]))
                                                                                ])

                                                                                (when-not (blank? (str (:view_count more-badge-info)))
@@ -268,7 +269,6 @@
                                                                                (when-not (blank? (str congratulated?))
                                                                                [:phrase
                                                                                [:chunk.chunk (str (t :badge/Congratulated ul) "?: ")][:chunk (str (if (true? congratulated?) (t :core/Yes ul) (t :core/No ul))" ")]"\n"])
-                                                                                ;;TEST congratulated!
                                                                                (when-not (empty? (:congratulations more-badge-info))
                                                                                [:paragraph
                                                                                [:chunk.chunk (str (t :badge/Congratulations ul) ": ")]"\n"


autofocus on email

autofocus on email

--- src/clj_money/web/grants.clj
+++ src/clj_money/web/grants.clj
@@ -84,7 +84,7 @@
      [:div.row
       [:div.col-md-6
        (form (format "/entities/%s/grants" (:id entity)) {}
-             (email-input-field grant :email)
+             (email-input-field grant :email {:autofocus true})
              (permission-checkbox-elements grant)
              [:button.btn.btn-primary {:type :submit}
               "Save"])]])))


used title case for :h3 in help

used title case for :h3 in help

--- src/cljs/netrunner/help.cljs
+++ src/cljs/netrunner/help.cljs
@@ -14,7 +14,7 @@
          [:a {:href "https://github.com/mtgred/netrunner/wiki/Jinteki.net-Guide" :target "_blank"}
           "Jinteki.net Guide"] " on the GitHub wiki."]

-        [:h3#site "Jinteki.net site"]
+        [:h3#site "Website"]

         [:h4#avatar "How can I change my avatar?"]
         [:p "Go to " [:a {:href "http://gravatar.com" :target "_blank"} "gravatar.com"]
@@ -24,7 +24,7 @@
         [:p "Google Chrome or Firefox on a desktop or laptop is recommended. Safari should work fine too. "
          "Touchscreen devices (smartphones, tablets etc.) are currently not supported."]

-        [:h3#cards "Cards and rules"]
+        [:h3#cards "Cards and Rules"]

         [:h3#troubleshooting "Troubleshooting"]

@@ -41,7 +41,7 @@
         [:p "This is most likely a websocket issue. Check if your network filters let through traffic from ws.jinteki.net. "
          "Whitelisting *.jinteki.net should solve the problem."]

-        [:h3#getinv "Getting involved"]
+        [:h3#getinv "Getting Involved"]

         [:h4#bugs "How can I report a bug?"]
         [:p "The best place to report bugs is the " [:a {:href "https://github.com/mtgred/netrunner/issues"} "GitHub issue tracker"]