Intro tasks for Clojure, ready to be solved.

--- clojure-functional/src/test/clojure/no/knowit/clojure_functional/intro.clj
+++ clojure-functional/src/test/clojure/no/knowit/clojure_functional/intro.clj
@@ -5,23 +5,23 @@
 (defn __ [& args] false)
 (def ___ '())

-
+#_
 (deftest very-basic-types
   (is (= 1 1))
   ;; Lots of things are truthy, which is the simplest?
-  (is (true? true))
+  (is (true? ___))
   ;; Now what is the concatenation of those Characters
-  (is (= (str \a \b \c) "abc"))
+  (is (= (str \a \b \c) ___))
   ;; Use vector literal
-  (is (= '(1 2 3) [1 2 3]))
+  (is (= '(1 2 3) ___))
   ;; Use list literal
-  (is (= [1 2 3] '(1 2 3)))
+  (is (= [1 2 3] ___))
   ;; Use list function
-  (is (= [1 2 3] (list 1 2 3)))
+  (is (= [1 2 3] ___))
   ;; Use vector function
-  (is (= [1 2 3] (vector 1 2 3))))
+  (is (= [1 2 3] ___)))

-
+#_
 (deftest use-conjoin
   ;; conjoin is a special function that works with most datastructures.
   ;; It nows where the right place is to append an element.
@@ -29,25 +29,25 @@
   ;; Oh, and by the way. 'are' creates a template (using a macro),
   ;; for alle the following test form, which need to be in pairs in this case.
   (are [x y] (= x y)
-    (conj [1] 2) [1 2]
-    (conj [1 2] 3 4) [1 2 3 4]
-    (conj '(2 1) 3 4) '(4 3 2 1)
-    (conj #{2 1} 3 4) #{1 2 3 4}))
+    (conj [1] 2) ___
+    (conj [1 2] 3 4) ___
+    (conj '(2 1) 3 4) ___
+    (conj #{2 1} 3 4) ___))

-
+#_
 (deftest how-to-count-stuff
   (are [x y] (= x y)
-       5 (count '(1 2 3 4 5))
-       4 (count [1 2 3 4])
-       10 (count (range 10))
-       4 (count {:a 1, :b 2, :c 3, :d 4})
-       8 (count "En banan")))
+       ___ (count '(1 2 3 4 5))
+       ___ (count [1 2 3 4])
+       ___ (count (range 10))
+       ___ (count {:a 1, :b 2, :c 3, :d 4})
+       ___ (count "En banan")))

-
+#_
 (deftest how-to-find-length-of-something
   ;; First class functions are so cool. Put in the right function in let
   ;; and all assertions should be correct.
-  (let [f count]
+  (let [f __]
     (are [x y] (= x y)
       (f '(1 2 3 3 1)) 5
       (f "Hello World") 11
@@ -55,87 +55,90 @@
       (f '(13)) 1
       (f '(:a :b :c))) 3))

-
+#_
 (deftest using-if
   (are [x y] (= x y)
     (if (> 1 0)
       true
       false)
-    true
+    ___

     (if (> 3 2 1)
       true
       false)
-    true
+    ___

     (if (> 3 2 3 1)
       true
       false)
-    false
+    ___

     (if nil
       "nil is truthy"
       "nil is falsey"
-      ) "nil is falsey"
+      ) ___

     (if true
       "true is truthy"
       "true is falsey"
-      ) "true is truthy"
+      ) ___

     (if false
       "false is truthy"
       "false is falsey"
-      ) "false is falsey"
+      ) ___

     (if '(1)
       "list is truthy"
       "list is falsey"
-      ) "list is truthy"
+      ) ___

     (if '()
       "empty list is truthy"
       "empty list is falsey"
-      ) "empty list is truthy"
+      ) ___

     (if (Object.)
       "Object is truthy"
       "Object is falsey"
-      ) "Object is truthy"))
+      ) ___))

-
+#_
 (deftest dealing-with-lists
   (are [x y] (= x y)
   ;; Should be able to use one simple function call to get result
-       (first '(1 2 3 4))  1
-       (last '(1 2 3 4 5)) 5
-       (take 2 '(1 2 3 4)) '(1 2)))
+       (__ '(1 2 3 4))  1
+       (__ '(1 2 3 4 5)) 5
+       (__ '(1 2 3 4)) '(1 2)))

+#_
 (deftest operating-on-lists
   (are [x y] (= x y)
   ;; Here you should try to apply the correct function to get the expected result
-       (apply + [1 2 3 4]) 10
-       (apply - [4 3 2 1]) -2
-       (apply * [1 2 3 4]) 24
+       (apply __ [1 2 3 4]) 10
+       (apply __ [4 3 2 1]) -2
+       (apply __ [1 2 3 4]) 24
        ))

-
+#_
 (deftest how-to-filter-out-the-stuff-you-want
   (are [x y] (= x y)
   ;; Filter is cool. Can you write or use a cool function to get correct result?
-    (filter odd? '(1 2 3 4 5)) '(1 3 5)
-    (filter even? '(1 2 3 4 5)) '(2 4)))
+    (filter __ '(1 2 3 4 5)) '(1 3 5)
+    (filter __ '(1 2 3 4 5)) '(2 4)))

+#_
 (deftest use-map-to-double-all-numbers-in-a-sequence
   ;; Write a function in the let form that doubles its input
-  (let [double (fn [x] (* 2 x))]
+  (let [double __]
     (are [x y] (= x y)
       (map double '(1 2 3)) '(2 4 6)
       (map double '(5 10 15)) '(10 20 30))))

+#_
 (deftest define-a-function-that-checks-string-longer-than
   ;; Write a function in the let form that that checks that the input String is longer than number input.
-  (let [longer-than? (fn [str len] (> (count str) len))]
+  (let [longer-than? __]
     (are [x y] (= x y)
          (longer-than? "long string" 5) true
          (longer-than? "short" 5) false


models.place: should not find place with non-existing name

--- test/busa_server/model/place_test.clj
+++ test/busa_server/model/place_test.clj
@@ -14,3 +14,6 @@

 (fact "should find place by name"
   (place/find-by-name "nummela") => place/nummela)
+
+(fact "should not find place with non-existing name"
+  (place/find-by-name "tsäggärä") => nil)


fix whitespace

fix whitespace

--- test/cljs/lambdacd/pipeline_test.cljs
+++ test/cljs/lambdacd/pipeline_test.cljs
@@ -48,34 +48,34 @@

 (deftest pipeline-view-test
-         (testing "rendering of a single build-step"
-                  (let [output-atom (atom "")]
-                    (tu/with-mounted-component
-                      (pipeline/build-step-component some-build-step output-atom 1)
-                      (fn [c div]
-                        (is (dom/found-in div #"some-step"))
-                        (is (dom/having-class "build-step" (step-label (first (steps div)))))
-                        (is (dom/having-data "status" "success" (first (steps div))))
-                        (is (= "hello world" (dom/after-click output-atom (step-label (first (steps div))))))))))
-         (testing "rendering of a container build-step"
-                  (let [output-atom (atom "")]
-                    (tu/with-mounted-component
-                      (pipeline/build-step-component some-container-build-step output-atom 1)
-                      (fn [c div]
-                        (is (dom/found-in div #"some-container"))
-                        (is (dom/found-in (first (steps div)) #"some-step"))
-                        (is (dom/having-class "build-step" (step-label (first (steps div)))))
-                        (is (dom/having-data "status" "success" (first (steps div))))
-                        (is (dom/containing-ordered-list (first (steps div))))
-                        (is (= "hello from container" (dom/after-click output-atom (step-label (first (steps div))))))))))
-         (testing "rendering of a parallel build-step"
-                  (let [output-atom (atom "")]
-                    (tu/with-mounted-component
-                      (pipeline/build-step-component some-parallel-build-step output-atom 1)
-                      (fn [c div]
-                        (is (dom/found-in div #"some-parallel-step"))
-                        (is (dom/found-in (first (steps div)) #"some-step"))
-                        (is (dom/having-class "build-step" (step-label (first (steps div)))))
-                        (is (dom/having-data "status" "success" (first (steps div))))
-                        (is (dom/containing-unordered-list (first (steps div))))
-                        (is (= "hello from p" (dom/after-click output-atom (step-label (first (steps div)))))))))))
+  (testing "rendering of a single build-step"
+    (let [output-atom (atom "")]
+      (tu/with-mounted-component
+        (pipeline/build-step-component some-build-step output-atom 1)
+        (fn [c div]
+          (is (dom/found-in div #"some-step"))
+          (is (dom/having-class "build-step" (step-label (first (steps div)))))
+          (is (dom/having-data "status" "success" (first (steps div))))
+          (is (= "hello world" (dom/after-click output-atom (step-label (first (steps div))))))))))
+  (testing "rendering of a container build-step"
+    (let [output-atom (atom "")]
+      (tu/with-mounted-component
+        (pipeline/build-step-component some-container-build-step output-atom 1)
+        (fn [c div]
+          (is (dom/found-in div #"some-container"))
+          (is (dom/found-in (first (steps div)) #"some-step"))
+          (is (dom/having-class "build-step" (step-label (first (steps div)))))
+          (is (dom/having-data "status" "success" (first (steps div))))
+          (is (dom/containing-ordered-list (first (steps div))))
+          (is (= "hello from container" (dom/after-click output-atom (step-label (first (steps div))))))))))
+  (testing "rendering of a parallel build-step"
+    (let [output-atom (atom "")]
+      (tu/with-mounted-component
+        (pipeline/build-step-component some-parallel-build-step output-atom 1)
+        (fn [c div]
+          (is (dom/found-in div #"some-parallel-step"))
+          (is (dom/found-in (first (steps div)) #"some-step"))
+          (is (dom/having-class "build-step" (step-label (first (steps div)))))
+          (is (dom/having-data "status" "success" (first (steps div))))
+          (is (dom/containing-unordered-list (first (steps div))))
+          (is (= "hello from p" (dom/after-click output-atom (step-label (first (steps div)))))))))))


Updated test for updated schema

Updated test for updated schema


fix generated sources creating unusable source maps

fixes #329

--- src/main/shadow/build/compiler.clj
+++ src/main/shadow/build/compiler.clj
@@ -385,7 +385,7 @@
         (let [compile-init
               (-> {:resource-id resource-id
                    :resource-name resource-name
-                   :source source
+                   :source (str source)
                    :ns 'cljs.user
                    :js ""
                    :cljc (util/is-cljc? resource-name)


make tests

make tests

--- saas-dsl/test/saas_dsl/core_test.clj
+++ saas-dsl/test/saas_dsl/core_test.clj
@@ -1,7 +1,17 @@
 (ns saas-dsl.core-test
   (:require [clojure.test :refer :all]
-            [saas-dsl.core :refer :all]))
+            [sass-dsl.core :as core]
+            [sass-dsl.common-test :as common-test]))

-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))
+(deftest basic-css-test
+  (testing "Ensure we get css output"
+    (is (.contains
+         (core/sass-to-css-basic common-test/basic-css)
+        "table.h1 {\n"))))
+
+(deftest basic-css-consants-test
+  (testing "Ensure we get CSS."
+    (is (.contains
+         (core/saas-to-css common-test/basic-css-constants)
+         ".content-navigation {\n"))))
+


nil-Type means "all types"

nil-Type means "all types"

--- src/barmap/model/places.clj
+++ src/barmap/model/places.clj
@@ -6,4 +6,7 @@
   (into [] (sql/query (config/db) ["select * from places;"])))

 (defn allViaType [type]
-  (into [] (sql/query (config/db) ["select * from places where type_id = ?" type])))
+  (if (nil? type)
+    (all)
+    (into [] (sql/query (config/db)
+                        ["select * from places where type_id = ?" type]))))


Add function to retrieve all the entries of a certain board, published and drafts.

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -269,6 +269,12 @@
                                           :interactions common/interaction-table-name :uuid :resource-uuid
                                           ["uuid" "headline" "body" "reaction" "author" "created-at" "updated-at"]))

+(schema/defn ^:always-validate list-all-entries-by-board
+  "Given the UUID of the board, return all the entries for the board."
+  [conn board-uuid :- lib-schema/UniqueID]
+  {:pre [(db-common/conn? conn)]}
+  (db-common/read-resources conn table-name :board-uuid [board-uuid] ["uuid" "status"]))
+
 ;; ----- Data about entries -----

 (schema/defn ^:always-validate entry-months-by-org


get non-excluded macros in doc generator (close #31)

--- scripts/cljs-api-parser/src/core.clj
+++ scripts/cljs-api-parser/src/core.clj
@@ -31,7 +31,9 @@
   {"cljs.core"              {"clojurescript" {"core.cljs"        "src/cljs/cljs/core.cljs"
                                               "core.clj"         "src/clj/cljs/core.clj"}
                              "clojure"       {"core.clj"         "src/clj/clojure/core.clj"
-                                              "core_deftype.clj" "src/clj/clojure/core_deftype.clj"}}
+                                              "core_deftype.clj" "src/clj/clojure/core_deftype.clj"
+                                              "core_print.clj"   "src/clj/clojure/core_print.clj"
+                                              "core_proxy.clj"   "src/clj/clojure/core_proxy.clj"}}
    "cljs.reader"            {"clojurescript" {"reader.cljs"      "src/cljs/cljs/reader.cljs"}}
    "clojure.set"            {"clojurescript" {"set.cljs"         "src/cljs/clojure/set.cljs"}}
    "clojure.string"         {"clojurescript" {"string.cljs"      "src/cljs/clojure/string.cljs"}}
@@ -184,26 +186,32 @@

 (defn parse-defn-or-macro
   [form]
-  (let [docstring (let [ds (nth form 2)]
+  (let [fn-or-macro ({'defn "function" 'defmacro "macro"} (first form))
+        args (drop 2 form)
+        docstring (let [ds (first args)]
                     (when (string? ds)
                       ds))
-        attr-map (let [m (nth form (if docstring 3 2))]
+        args (if docstring (rest args) args)
+        attr-map (let [m (first args)]
                    (when (map? m) m))
+        args (if attr-map (rest args) args)
+        private? (:private attr-map)
         doc-forms (cond-> []
                     docstring (conj docstring)
                     attr-map (conj attr-map))
-        sig-body-forms (drop (+ 2 (count doc-forms)) form)
-        signatures (if (vector? (first sig-body-forms))
-                     (take 1 sig-body-forms)
-                     (map first sig-body-forms))
+        signatures (if (vector? (first args))
+                     (take 1 args)
+                     (map first args))
         expected-docs (try-locate-docs
                         {:whole form
                          :head (take 2 form)
                          :doc doc-forms
-                         :sig-body sig-body-forms})]
-    {:expected-docs expected-docs
-     :docstring (fix-docstring docstring)
-     :signatures signatures}))
+                         :sig-body args})]
+    (when-not private?
+      {:expected-docs expected-docs
+       :docstring (fix-docstring docstring)
+       :signatures signatures
+       :fn-or-macro fn-or-macro})))

 (defn parse-def-fn
   [form]
@@ -213,10 +221,9 @@
         signatures (when-let [arglists (:arglists m)]
                      (when (= 'quote (first arglists))
                        (second arglists)))]
-    (when (= 'let name-)
-      (println "let"))
     {:docstring docstring
-     :signatures signatures}))
+     :signatures signatures
+     :fn-or-macro "function"}))

 (defmulti parse-form*
   (fn [form]
@@ -239,15 +246,15 @@

 (defmethod parse-form* "def fn"
   [form]
-  (assoc (parse-def-fn form) :fn-or-macro "function"))
+  (parse-def-fn form))

 (defmethod parse-form* "defn"
   [form]
-  (assoc (parse-defn-or-macro form) :fn-or-macro "function"))
+  (parse-defn-or-macro form))

 (defmethod parse-form* "defmacro"
   [form]
-  (assoc (parse-defn-or-macro form) :fn-or-macro "macro"))
+  (parse-defn-or-macro form))

 (defmethod parse-form* nil
   [form]
@@ -295,27 +302,43 @@
       (doall (keep #(parse-form % ns- repo) forms)))))

 (defn get-imported-macro-api
-  [ns- repo file macro-api]
-  (let [forms (get-forms ns- repo file)
-        macro-names (-> (filter #(= 'import-macros (first %)) forms)
-                        first (nth 2) set)]
+  [forms macro-api]
+  (let [get-imports #(match % (['import-macros 'clojure.core x] :seq) x :else nil)
+        macro-names (->> forms (keep get-imports) first set)]
     (filter #(macro-names (:name %)) macro-api)))

+(defn get-non-excluded-macro-api
+  [forms macro-api]
+  (let [ns-form (first (filter #(= 'ns (first %)) forms))
+        get-excludes #(match % ([:refer-clojure :exclude x] :seq) x :else nil)
+        macro-names (->> ns-form (drop 2) (keep get-excludes) first set)]
+    (remove #(macro-names (:name %)) macro-api)))
+
 ;;------------------------------------------------------------
 ;; Namespace API parsing
 ;;------------------------------------------------------------

 (defmulti parse-ns-api (fn [ns-] ns-))

+(defn parse-extra-macros-from-clj
+  []
+  (let [clj-api (concat (parse-api "cljs.core" "clojure" "core.clj")
+                        (parse-api "cljs.core" "clojure" "core_deftype.clj")
+                        (parse-api "cljs.core" "clojure" "core_print.clj")
+                        (parse-api "cljs.core" "clojure" "core_proxy.clj"))
+        clj-api (filter #(= "macro" (:fn-or-macro %)) clj-api)
+        cljs-forms   (get-forms "cljs.core" "clojurescript" "core.clj")
+        imports      (get-imported-macro-api     cljs-forms clj-api)
+        non-excludes (get-non-excluded-macro-api cljs-forms clj-api)]
+    (println "   " (count imports) "imported clojure.core macros")
+    (println "   " (count non-excludes) "non-excluded clojure.core macros")
+    (concat imports non-excludes)))
+
 (defmethod parse-ns-api "cljs.core" [ns-]
-  (let [clj-api       (parse-api ns- "clojure"       "core.clj")
-        clj-type-api  (parse-api ns- "clojure"       "core_deftype.clj")
-        clj-cljs-api  (parse-api ns- "clojurescript" "core.clj")
-        cljs-cljs-api (parse-api ns- "clojurescript" "core.cljs")
-        import-macro-api (get-imported-macro-api ns- "clojurescript" "core.clj" (concat clj-api clj-type-api))]
-    (concat import-macro-api
-            clj-cljs-api
-            cljs-cljs-api)))
+  (let [clj-api  (parse-api ns- "clojurescript" "core.clj")
+        cljs-api (parse-api ns- "clojurescript" "core.cljs")
+        extra-macro-api (parse-extra-macros-from-clj)]
+    (concat extra-macro-api clj-api cljs-api)))

 (defmethod parse-ns-api "cljs.reader" [ns-]
   (parse-api ns- "clojurescript" "reader.cljs"))
@@ -412,7 +435,7 @@

     ;; Build the docs.
     (doseq [ns- (keys cljs-ns-paths)]
-      (println "   " ns-)
+      (println " " ns-)
       (dump-api-docs! (parse-ns-api ns-)))

     (println "\nDone.")


Added license header

Added license header

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -1,3 +1,15 @@
+;
+;  (C) Copyright 2016, 2020  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
 (ns branch-handler.core)

 (require '[ring.adapter.jetty      :as jetty])


Simple action consumer

Simple action consumer

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -10,7 +10,7 @@
 (require '[clojure.tools.logging   :as log])

 (def verbose true)
-(def port 4000)
+(def port 3000)

 (defn slurp-
     [filename]
@@ -41,6 +41,27 @@
     (let [body (read-request-body request)]
         (if body
             (json/read-str body :key-fn clojure.core/keyword))))
+
+(defn clone-or-fetch-bare-repo
+    [repository-url]
+    (log/info "Cloning or fetching bare repository" repository-url)
+    )
+
+(def actions (java.util.concurrent.LinkedBlockingQueue.))
+
+(defn action-consumer
+    []
+    (log/info "Starting actions consumer")
+    (future                                    ; start consumer in its own thread
+        (while true
+            (when-let [action (.take actions)] ; blocking operation
+                (log/info "Got action for repository" action)
+                (clone-or-fetch-bare-repo action)
+            ))))
+
+(defn new-action
+    [action]
+    (.put actions action))

 (def empty-SHA "0000000000000000000000000000000000000000")

@@ -80,9 +101,9 @@
         (log/info "before"     before)
         (log/info "after"      after)
         (log/info "operation"  operation)
+        (if (contains? #{:branch-created :branch-deleted :branch-updated} operation)
+            (new-action repository-url))
         ))
-
-

 (defn http-request-handler
     "Handler that is called by Ring for all requests received from user(s)."
@@ -106,6 +127,7 @@
 (defn -main
     "Entry point to the branch handler service server."
     [& args]
-    (log/info "started app on port" port)
+    (log/info "Started app on port" port)
+    (action-consumer)
     (start-server ring-app port))


DM + JC | 153 | Fix build

DM + JC | 153 | Fix build

--- src/stonecutter/handler.clj
+++ src/stonecutter/handler.clj
@@ -152,7 +152,7 @@

 (defn create-app
   ([config-m clock stores-m email-sender id-token-generator]
-   (create-app config-m stores-m email-sender id-token-generator false))
+   (create-app config-m clock stores-m email-sender id-token-generator false))
   ([config-m clock stores-m email-sender id-token-generator prone-stacktraces?]
    (splitter (create-site-app clock config-m stores-m email-sender prone-stacktraces?)
              (create-api-app config-m stores-m id-token-generator prone-stacktraces?))))


fix typo in require

fix typo in require

--- src/chat/server/handler.clj
+++ src/chat/server/handler.clj
@@ -15,7 +15,7 @@
             [braid.server.routes.client :refer [desktop-client-routes
                                                 mobile-client-routes
                                                 resource-routes]]
-            [braid.server.route.api :refer [api-private-routes
+            [braid.server.routes.api :refer [api-private-routes
                                             api-public-routes]]
             [environ.core :refer [env]]
             [braid.server.conf :refer [config]]


Accept strokes posted to /write-character

--- src/clj/calc_angle/core.clj
+++ src/clj/calc_angle/core.clj
@@ -138,14 +138,16 @@
 (def ^:dynamic *serial-conn*)

 (defn set-angle [base-angle first-angle second-angle]
-  (println (str "--> " "a=" base-angle ",b=" first-angle ",c=" second-angle ","))
-  (.writeString *serial-conn* (str "a=" base-angle ",b=" first-angle ",c=" second-angle ","))
-  (.readBytes *serial-conn* 1)
-  (loop [reduce-str "<-- "
-         curr-char (aget (.readBytes *serial-conn* 1) 0)]
-    (if (= curr-char (byte \n))
-      (println reduce-str)
-      (recur (str reduce-str (char curr-char)) (aget (.readBytes *serial-conn* 1) 0)))))
+  (let [serial-str (format "a=%.3f,b=%.3f,c=%.3f," base-angle first-angle second-angle)]
+    (println (str "--> " serial-str))
+    (.writeString *serial-conn* serial-str)
+    (let [echo (aget (.readBytes *serial-conn* 1) 0)]
+      (when-not (= echo \0) (println (str echo " angle out of range"))))
+    (loop [reduce-str "<-- "
+           curr-char (aget (.readBytes *serial-conn* 1) 0)]
+      (if (= curr-char (byte \n))
+        (println reduce-str)
+        (recur (str reduce-str (char curr-char)) (aget (.readBytes *serial-conn* 1) 0))))))

 (defn calc-angle-seq [input-str]
   (let [input (load-string input-str)
@@ -160,16 +162,11 @@
         alpha-beta-radian-list (map #(calc-alpha-beta (first %1) %2) r-theta-list (map (fn [x] (last x)) strokes-z))
         alpha-beta-degree-list (map (fn [[alpha beta]] (list (radian-to-degree alpha) (radian-to-degree beta))) alpha-beta-radian-list)]
     (println input-str)
-    (map #(fn [[_ theta] [alpha beta]] (list theta beta (- 180 alpha beta))) r-theta-list alpha-beta-degree-list)))
-
-(def character-str "{:scale 480 :strokes [['(47 89) '(174 88) '(174 100) '(172 111) '(171 120) '(169 130) '(167 138) '(166 146) '(164, 154) '(161 164) '(158 176) '(154 189) '(149 202) '(145 213) '(141 223) '(135 236) '(119 267) '(113 275) '(106 286) '(100 294) '(94 304) '(87 314) '(81 321) '(75 329) '(68 338) '(62 344) '(56 350) '(50 357) '(43 363) '(26 364) '(15 365)] ['(62 172) '(70 182) '(76 189) '(82 196) '(86 200) '(91 206) '(95 211) '(100 216) '(104 222) '(108 228) '(112 234) '(117 238) '(136 266) '(142 273) '(148 282) '(154 292) '(159 299) '(163 306) '(166 310) '(170 317) '(174 323) '(179 324) '(184 324) '(189 326) '(194 326)] ['(270 43) '(267 52) '(264 62) '(262 70) '(260 78) '(258 87) '(257 96) '(254 106) '(250 115) '(248 122) '(246 129) '(243 138) '(240 146) '(238 154) '(234 162) '(231 169) '(227 178) '(224 185) '(220 193) '(216 201) '(212 209)] ['(257 108) '(416 108) '(412 114) '(411 122) '(410 130) '(406 140) '(403 148) '(400 157) '(397 166) '(394 175) '(393 178) '(387 182) '(380 184)] ['(311 186) '(310, 247) '(309 258) '(305 266) '(302 274) '(299 283) '(296 292) '(293 302) '(290 309) '(286 318) '(282 326) '(277 334) '(272 342) '(267 350) '(262 356) '(257 362) '(252 368) '(247 374) '(240 381) '(232 390) '(223 396) '(215 402) '(206 408) '(200 412) '(196 416) '(191 418) '(186 420)] ['(310 250) '(312 260) '(324 268) '(326 276) '(329 286) '(332 296) '(335 302) '(338 310) '(342 318) '(347 327) '(352 334) '(356 341) '(362 351) '(368 360) '(374 366) '(381 374) '(387 381) '(394 388) '(401 396) '(409 402) '(416 408) '(422 414) '(438 414) '(448 414)]]}")
-
-(def curr-angle (atom {:a 0 :b 90 :c 180}))
+    (map (fn [[_ theta] [alpha beta]] (list theta beta (- 180 alpha beta))) r-theta-list alpha-beta-degree-list)))

 (defn write-strokes [angles-seq]
   (doseq [[base-angle first-angle second-angle] angles-seq]
-    (set-angle base-angle first-angle second-angle)
-    (swap! curr-angle (fn [_] {:a base-angle :b first-angle :c second-angle})))
+    (set-angle base-angle first-angle second-angle))
   "OK")

 (defroutes app
@@ -177,8 +174,7 @@
            (GET "/set-angle" [a b c] (if (and a b c)
                                        (set-angle a b c)
                                        "/set-angle?a=<base>&b=<large>&c="))
-           ;(POST "/write-character" [strokes] (write-strokes (calc-angle-seq strokes)))
-           (POST "/write-character" req (println req))
+           (POST "/write-character" [strokes] (write-strokes (calc-angle-seq strokes)))
            (resources "/")
            (not-found "
not found
"))


temp to fix heroku state

temp to fix heroku state

--- src/clj_crud/migrations.clj
+++ src/clj_crud/migrations.clj
@@ -72,7 +72,8 @@
                  db
                  "ALTER TABLE accounts
                    ADD admin INT default 0"))
-          :down (fn [db]
+          :down (fn [db] nil)
+          #_(fn [db]
                   (jdbc/db-do-commands
                    db
                    "ALTER TABLE accounts


Remove trailing whitespace

Remove trailing whitespace

--- src/cljs/db_quiz/logic.cljs
+++ src/cljs/db_quiz/logic.cljs
@@ -107,7 +107,7 @@
                                      ; TODO: Does first (some) suffice of we need the shortest path?
                                      path (some (partial find-connecting-path (into {} player-fields))
                                                 (remove-inner-fields player-fields))]
-                                 (when path
+                                 (when path
                                    {:player player
                                     :path path})))
         players-fields (->> board
@@ -148,7 +148,7 @@
   (dissoc app-state :current-field))

 (defn match-answer
-  "Mark if the last question was correctly answered or not."
+  "Mark if the last question was correctly answered or not."
   [matches? app-state]
   (assoc app-state :verdict matches?))

@@ -198,7 +198,7 @@
         (alts! [keypresses (timeout verdict-display-time)])
         (close! keypresses)
         (swap! app-state (comp restart-timer toggle-player clear-hint clear-answer
-                               deselect-current-field unmatch-answer)))))
+                               deselect-current-field unmatch-answer)))))

 (defn make-a-guess
   []
@@ -214,10 +214,10 @@
       (when (= data-source :dbpedia)
         (analytics/log-answer (:subject correct-answer) answer-matched?)
         (update-success-rate answer-matched?))
-
+
       (mark-deselected true)
       (go (<! (timeout 2000))
-          (mark-deselected false))
+          (mark-deselected false))

       ; Test if the game is over:
       (test-winner new-ownership current-field)
@@ -236,7 +236,7 @@
                                                 restart-timer
                                                 (fn [app-state] (assoc app-state :current-field id))))
                 :missed (do (test-winner on-turn id)
-                            (swap! app-state (comp toggle-player
+                            (swap! app-state (comp toggle-player
                                                    deselect-current-field)))
                 nil))))


Removed redundant code from react.cljs

Removed redundant code from react.cljs

--- src/cljs/hyjinks/react.cljs
+++ src/cljs/hyjinks/react.cljs
@@ -5,8 +5,6 @@
   (cond
     (h/tag? arg)
       (let [{:keys [tag-name attrs css items]} arg
-      	    {:keys [className]} attrs
-            attrs (if (sequential? className) (assoc attrs :className (clojure.string/join " " className)) attrs)
             attrs+css (if (empty? css) attrs (assoc attrs :style css))]
         (.apply (aget js/React.DOM tag-name) nil (into-array (cons (clj->js attrs+css) (map #(tag->react % f) items)))))
     f (f arg)


Removed comment

Removed comment

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -261,7 +261,7 @@
     (cells-strength point)
     converted))

-(defn- worst-immediate-loss ;; TODO - Does not take into account the move itself
+(defn- worst-immediate-loss
   "Return the next worse lost game move for 'looser' if 'player' plays"
   {:pre [(player? player) (player? looser)]}
   [cells-strength game player looser]


minor transformation from anonymous to name functions

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -306,11 +306,11 @@

 (defonce game-loop (start-game-loop))

-(def send-player-event!
-  #(put! (game-loop :player-events) %))
-
-(def send-game-event!
-  #(put! (game-loop :game-events) %))
+(defn send-player-event! [e]
+  (put! (game-loop :player-events) e))
+
+(defn send-game-event! [e]
+  (put! (game-loop :game-events) e))

 (defn toogle-help! []
   (swap! app-state update :help not))


Added function to deactivate an Environment resource.  Fixes #40

--- src/prop_shop/data/environment.clj
+++ src/prop_shop/data/environment.clj
@@ -32,3 +32,10 @@
 	{:added "0.1"}
 	[uuid name]
 	(b/update-entity-by-uuid uuid {:name name}))
+
+
+(defn deactivate-environment
+  "Deactivates the Environment specified by the UUID."
+  {:added "0.1"}
+	[uuid]
+	(b/deactivate-entity uuid))


Fixing missing brace.

Fixing missing brace.

--- src/cmr/transmit/config.clj
+++ src/cmr/transmit/config.clj
@@ -40,7 +40,7 @@
    :bootstrap {:host (cfg/config-value :bootstrap-host "localhost")
                :port (bootstrap-port)}
    :transformer {:host (cfg/config-value :transformer-host "localhost")
-                 :port (transformer-port)})
+                 :port (transformer-port)}})

 (defn app-connection-system-key-name
   "The name of the app connection in the system"


Convert rect-shape component to use new defc macro.

--- src/uxbox/main/ui/shapes/rect.cljs
+++ src/uxbox/main/ui/shapes/rect.cljs
@@ -9,7 +9,7 @@
             [rum.core :as rum]
             [uxbox.main.ui.shapes.common :as common]
             [uxbox.main.ui.shapes.attrs :as attrs]
-            [uxbox.util.mixins :as mx]
+            [uxbox.util.mixins :as mx :include-macros true]
             [uxbox.main.geom :as geom]
             [uxbox.util.dom :as dom]))

@@ -38,19 +38,12 @@

 ;; --- Rect Shape

-(defn- rect-shape-render
-  [own {:keys [id x1 y1 x2 y2] :as shape}]
+(mx/defc rect-shape
+  [{:keys [id x1 y1 x2 y2] :as shape}]
   (let [key (str id)
         rfm (geom/transformation-matrix shape)
         size (geom/size shape)
         props {:x x1 :y y1 :id key :key key :transform (str rfm)}
         attrs (-> (attrs/extract-style-attrs shape)
                   (merge props size))]
-    (html
-     [:rect attrs])))
-
-(def rect-shape
-  (mx/component
-   {:render rect-shape-render
-    :name "rect-shape"
-    :mixins [mx/static]}))
+    [:rect attrs]))


fix undeclared fn

fix undeclared fn

--- pp-cljs-client/src-cljs/pp_client/html/about_page.cljs
+++ pp-cljs-client/src-cljs/pp_client/html/about_page.cljs
@@ -1,6 +1,7 @@
 (ns pp-client.html.about-page
   (:require
     [pp-client.html.common :refer [footer]]
+    [pp-client.dom :refer [by-id]]
     [quiescent :include-macros true]
     [sablono.core :as sablono :include-macros true]))

@@ -39,4 +40,4 @@
         [:div.clr-217e3]]]
       (footer)]))

-(defn about-init! [] (quiescent/render (AboutPage) (by-id "bodyWrapper")))+(defn about-init! [] (quiescent/render (AboutPage) (by-id "bodyWrapper")))


Sanitize video tags

Sanitize video tags

--- src/video_server/ffmpeg.clj
+++ src/video_server/ffmpeg.clj
@@ -22,7 +22,7 @@
   (let [exec (exec "ffprobe" "-v" "quiet" "-print_format" "json"
                    "-show_format" "-show_streams" (.getCanonicalPath file))]
     (when (zero? (:exit exec))
-      (json/read-str (:out exec) :key-fn keyword))))
+      (json/read-str (:out exec) :key-fn (comp keyword str/lower-case)))))

 (defn detect-interlace
   "Performs interlace detection, returning true if present."


Added test for analyze-trends query (#295)


Faster version of next-shared-intent

Faster version of next-shared-intent

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -210,14 +210,14 @@
 (defn object-derivation
   "Computes set of attributes common to all objects in context."
   [ctx objects]
-  (let [inz (incidence ctx)
+  (let [inz  (incidence ctx),
 	atts (attributes ctx)]
     (set-of m [m atts :when (forall [g objects] (inz [g m]))])))

 (defn attribute-derivation
   "Computes set of objects common to all attributes in context."
   [ctx attributes]
-  (let [inz (incidence ctx)
+  (let [inz  (incidence ctx),
         objs (objects ctx)]
     (set-of g [g objs :when (forall [m attributes] (inz [g m]))])))

@@ -705,15 +705,21 @@
   (loop [shared-attrs b,
          objs-1       (attribute-derivation ctx-1 b),
          objs-2       (attribute-derivation ctx-2 b)]
-    (let [new-shared-attrs-1 (difference (object-derivation ctx-1 objs-1)
-                                         shared-attrs),
-          new-shared-attrs-2 (difference (object-derivation ctx-2 objs-2)
-                                         shared-attrs)]
+    (let [new-shared-attrs-1 (set-of m [m (difference (attributes ctx-1) shared-attrs)
+                                        :when (forall [g objs-1]
+                                                ((incidence ctx-1) [g m]))]),
+          new-shared-attrs-2 (set-of m [m (difference (attributes ctx-2) shared-attrs)
+                                        :when (forall [g objs-2]
+                                                ((incidence ctx-2) [g m]))])]
       (if (and (empty? new-shared-attrs-1) (empty? new-shared-attrs-2))
         shared-attrs
         (recur (union shared-attrs new-shared-attrs-1 new-shared-attrs-2)
-               (intersection objs-1 (attribute-derivation ctx-1 new-shared-attrs-2))
-               (intersection objs-2 (attribute-derivation ctx-2 new-shared-attrs-1)))))))
+               (set-of g [g objs-1
+                          :when (forall [m new-shared-attrs-2]
+                                  ((incidence ctx-1) [g m]))])
+               (set-of g [g objs-2
+                          :when (forall [m new-shared-attrs-1]
+                                  ((incidence ctx-2) [g m]))]))))))

 (defn all-shared-intents
   "All intents shared between contexts ctx-1 and ctx-2. ctx-1 and


GAWB-1444: change bucket url on call level

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/monitor/workflow_details.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/monitor/workflow_details.cljs
@@ -96,7 +96,7 @@
                             :target "_blank"
                             :style {:color "-webkit-link" :textDecoration "underline"}
           :href (str moncommon/google-cloud-context (:bucketName props) "/" (:submission-id props)
-                     "/" workflow-name "/" (:workflowId props) "/" call-name "/")}))]
+                     "/" workflow-name "/" (:workflowId props) "/call-" call-name "/")}))]
       (style/create-link {:text (if (:expanded @state) "Hide" "Show")
                           :onClick #(swap! state assoc :expanded (not (:expanded @state)))})
       (when (:expanded @state)


[layers] Fix cljs where join isn't a view.

--- src/cortex/impl/layers.cljc
+++ src/cortex/impl/layers.cljc
@@ -236,9 +236,24 @@

     (update-parameters [this parameters]
       (let [param-view (cp/parameters this)]
-        (m/assign! param-view parameters))
-      (let [gradient-view (cp/gradient this)]
-        (m/assign! gradient-view 0.0))
+        #?(:clj
+            (m/assign! param-view parameters)
+           :cljs
+            (do
+              (let [w (:weights this)
+                    w-update (m/array (take (m/ecount (:weights this)) (m/eseq parameters)))
+                    b (:bias this)
+                    b-update (m/array (drop (m/ecount (:weights this)) (m/eseq parameters)))]
+              (m/assign! (m/as-vector w) (m/as-vector w-update))
+              (m/assign! (m/as-vector b) (m/as-vector b-update))))))
+
+      #?(:clj
+          (let [gradient-view (cp/gradient this)]
+            (m/assign! gradient-view 0.0))
+         :cljs
+          (do
+            (m/assign! (:weight-gradient this) 0.0)
+            (m/assign! (:bias-gradient this) 0.0)))
       this)

   cp/PGradient


Add another test case for s/fspec

Add another test case for s/fspec

--- test/cljc/spectrace/core_test.cljc
+++ test/cljc/spectrace/core_test.cljc
@@ -754,6 +754,15 @@
        :trail []}]]

     (s/fspec :args (s/cat :n integer?) :ret integer?)
+    42
+    [[{:spec `(s/fspec :args (s/cat :n integer?) :ret integer? :fn nil)
+       :path []
+       :val 42
+       :in []
+       :trail []}
+      {:spec 'ifn? :path [] :val 42 :in [] :trail []}]]
+
+    (s/fspec :args (s/cat :n integer?) :ret integer?)
     str
     [[{:spec `(s/fspec :args (s/cat :n integer?) :ret integer? :fn nil)
        :path [:ret]


fix indentation

fix indentation

--- src-cljs/frontend/components/doc_viewer.cljs
+++ src-cljs/frontend/components/doc_viewer.cljs
@@ -109,7 +109,7 @@
         (html
          [:div.menu-view {:class (str "menu-prompt-" "doc-viewer")}
           [:article.menu-view-frame {:class (when (nil? touched-docs)
-                                           "loading")}
+                                              "loading")}
            (if (seq docs)
              (om/build docs-list docs))]])))))


some api unit tests for POST /api/session/forgot_password

--- test/metabase/api/session_test.clj
+++ test/metabase/api/session_test.clj
@@ -5,7 +5,8 @@
             [metabase.db :refer :all]
             [metabase.http-client :refer :all]
             [metabase.test-data :refer :all]
-            [metabase.models.session :refer [Session]]
+            (metabase.models [session :refer [Session]]
+                             [user :refer [User]])
             [metabase.test.util :refer [expect-eval-actual-first]]))

 ;; ## POST /api/session
@@ -39,3 +40,25 @@
     (assert session_id)
     ((user->client :rasta) :delete 204 "session" :session_id session_id)
     (sel :one Session :id session_id)))
+
+
+;; ## POST /api/session/forgot_password
+;; Test that we can initiate password reset
+(expect true
+  (do
+    (let [{:keys [reset_token reset_triggered]} (sel :one :fields [User :reset_token :reset_triggered] :id (user->id :rasta))]
+      ;; make sure user is starting with no values
+      (assert (and (= nil reset_token) (= nil reset_triggered)))
+      ;; issue reset request (token & timestamp should be saved)
+      ((user->client :rasta) :post 200 "session/forgot_password" {:email (:email (user->credentials :rasta))}))
+    ;; TODO - how can we test email sent here?
+    (let [{:keys [reset_token reset_triggered]} (sel :one :fields [User :reset_token :reset_triggered] :id (user->id :rasta))]
+      (and (not (nil? reset_token)) (not (nil? reset_triggered))))))
+
+;; Test that email is required
+(expect "'email' is a required param."
+  (client :post 400 "session/forgot_password" {}))
+
+;; Test that email not found gives 404
+(expect "Not found."
+  (client :post 404 "session/forgot_password" {:email "not-found"}))


Cleanup the tests a bit.

Cleanup the tests a bit.

--- test/posthere/integration/post.clj
+++ test/posthere/integration/post.clj
@@ -8,6 +8,12 @@
             [posthere.app :refer (app)]
             [posthere.capture-request :refer (post-response-body)]
             [posthere.storage :refer (requests-for)]))
+
+(def string-body "I'm a little teapot.")
+(def json-body "{\"lyric\": \"I'm a little teapot.\"}")
+(def xml-body "<song><lyric>I'm a little teapot.</lyric></song>")
+
+(def query-params "foo=bar&ferrets=evolved")

 (defn url-for [url-uuid]
   (str "/" url-uuid))
@@ -69,18 +75,20 @@

     (fact "without a body"
       (let [url-uuid (uuid)
-            url (url-for (str url-uuid "?foo=bar&ferrets=evolved"))
+            url (url-for (str url-uuid "?" query-params))
             request (request :post url)
             response (app request)]
-        (:query-string (first (requests-for url-uuid))) => "foo=bar&ferrets=evolved"))
+        (:query-string (first (requests-for url-uuid))) => query-params))

     (fact "with a body"
       (let [url-uuid (uuid)
-          url (url-for (str url-uuid "?foo=bar&ferrets=evolved"))
+          url (url-for (str url-uuid "?" query-params))
           request (request :post url)
-          body (body request "I'm a little teapot.")
+          body (body request string-body)
           response (app body)]
-        (:query-string (first (requests-for url-uuid))) => "foo=bar&ferrets=evolved")))
+        (:query-string (first (requests-for url-uuid))) => query-params)))
+
+  ; POST saves form fields

   ; POST saves BODY content
   (facts "body is saved"
@@ -89,25 +97,26 @@
       (let [url-uuid (uuid)
             url (url-for url-uuid)
             request (request :post url)
-            body (body request "I'm a little teapot.")
+            body (body request string-body)
             response (app body)]
-          (:body (first (requests-for url-uuid))) => "I'm a little teapot."))
+          (:body (first (requests-for url-uuid))) => string-body))
+
+    (fact "JSON body is saved"
+      (let [url-uuid (uuid)
+            url (url-for url-uuid)
+            request (request :post url)
+            body (body request json-body)
+            response (app body)]
+          (:body (first (requests-for url-uuid))) => json-body))

     (fact "XML body is saved"
       (let [url-uuid (uuid)
             url (url-for url-uuid)
             request (request :post url)
-            body (body request "<song><lyric>I'm a little teapot.</lyric></song>")
+            body (body request xml-body)
             response (app body)]
-          (:body (first (requests-for url-uuid))) => "<song><lyric>I'm a little teapot.</lyric></song>"))
+          (:body (first (requests-for url-uuid))) => xml-body))))

-    (fact "JSON body is saved"
-      (let [url-uuid (uuid)
-            url (url-for url-uuid)
-            request (request :post url)
-            body (body request "{\"lyric\": \"I'm a little teapot.\"}")
-            response (app body)]
-          (:body (first (requests-for url-uuid))) => "{\"lyric\": \"I'm a little teapot.\"}"))))

 (future-facts "about giant POSTs getting partially saved"


allow for 1 arg callback in reconciler's `send`

--- src/cellophane/next.clj
+++ src/cellophane/next.clj
@@ -1640,8 +1640,11 @@
               (assoc :queued-sends {})
               (assoc :sends-queued false))))
         ((:send config) sends
-          (fn [res query]
-            (merge! this res query)))))))
+         (fn send-cb
+           ([res]
+            (send-cb res nil))
+           ([res query]
+            (merge! this res query))))))))

 (defn reconciler
   [{:keys [state shared shared-fn


Improve api support

Improve api support

--- src/cfpb/qu/swagger.clj
+++ src/cfpb/qu/swagger.clj
@@ -30,15 +30,15 @@
          {:apis (concat [{:path (urls/swagger-api-declaration-url :api "data")
                           :description "Operations about datasets."}]
                         dataset-apis
+                        []
                         )})))))

 (defn- get-api
-  [& {:keys [path method nickname summary parameters]}]
+  [& {:keys [path] :as m}]
   {:path path
-   :operations [{:method "GET"
-                 :nickname nickname
-                 :summary summary
-                 :parameters parameters}]})
+   :operations [(-> m
+                    (assoc :method "GET")
+                    (dissoc :path))]})

 (defn- api-param
   [data-type param-name & {:as m}]
@@ -56,13 +56,16 @@
   [req]
   (-> {:resourcePath (urls/datasets-path)
        :produces ["application/json" "application/xml"]
+       :models {}
        :apis [(get-api :path (urls/datasets-path)
                        :nickname "getDatasets"
-                       :summary "Get a list of all datasets."
+                       :summary "Get a list of all datasets."
+                       :produces ["application/json" "application/xml"]
                        :parameters [])
               (get-api :path (urls/dataset-path :dataset "{dataset}")
                        :nickname "getDataset"
                        :summary "Get metadata about a dataset."
+                       :produces ["application/json" "application/xml"]
                        :parameters [(api-param :string "dataset"
                                                :paramType "path"
                                                :description "Name of dataset"


delaney.clj: added function that computes all autormorphisms of a symbol

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -245,6 +245,10 @@
               (recur (into mapping pairs)
                      (into (rest q) (filter (comp nil? mapping first) pairs)))
               nil)))))))
+
+(defn automorphisms [ds]
+  (when-let [D (first (elements ds))]
+    (keep (partial morphism ds ds D) (rest (elements ds)))))

 ;; === Persistent Clojure implementation of IDSymbol with some common
 ;;     restrictions.


Fix shield icon in library page

Fix shield icon in library page

--- src/cljs/main/broadfcui/page/library/library_page.cljs
+++ src/cljs/main/broadfcui/page/library/library_page.cljs
@@ -63,7 +63,7 @@
                       :render (fn [data]
                                 (when (= (:workspaceAccess data) "NO ACCESS")
                                   (icons/icon (merge
-                                               {:style {:alignSelf "center" :cursor "pointer"}}
+                                               {:style {:cursor "pointer" :marginLeft "-0.7rem"}}
                                                (this :-get-link-props data))
                                               :shield)))}
                      {:id "library:datasetName"


Update example to better illustrate self-descriptive arguments for help.

--- src/cli4clj/example.clj
+++ src/cli4clj/example.clj
@@ -15,8 +15,8 @@
   (:gen-class))

 ;;; This function is just used for providing an example below.
-(defn divide [x y]
-  (/ x y))
+(defn divide [numer denom]
+  (/ numer denom))

 (defn -main [& args]
 ;;; Simple cli4clj usage example:
@@ -41,7 +41,7 @@
 ;;;           All Clojure data types are supported as arguments.
 ;;;           However, no sanity checks, e.g., with respect to the number of arguments or the argument type(s), are performed.
 ;;;           If things go wrong, exceptions will be thrown and printed.
-              :add  {:fn (fn [a b] (+ a b))
+              :add  {:fn (fn [summand1 summand2] (+ summand1 summand2))
                      :short-info "Add two values."}
                      :a :add
 ;;;           The following example shows the use of a named function.


Send anon-token on first connect.

Send anon-token on first connect.

--- src/clj/cipher/main.clj
+++ src/clj/cipher/main.clj
@@ -33,7 +33,7 @@

 (defn- uuid
   []
-  (str (java.util.UUID/randomUUID)))
+  (str "anon-" (java.util.UUID/randomUUID)))

 (defn- now
   []
@@ -77,6 +77,10 @@
   [stream]
   (doseq [msg @history]
     (stream/put! stream (pr-str msg))))
+
+(defn send-anon!
+  [stream]
+  @(stream/put! stream (pr-str [:server/token (uuid)])))

 ;; API
 ;; [:client/new-name "string"
@@ -131,6 +135,7 @@
     (log/info "connected:" auth-token)
     (async/go (log/info "client connect")
               (add-stream! stream auth-token)
+              (send-anon! stream)
               (catch-up! stream)
               (loop []
                 (when-let [msg @(stream/take! stream)]


Fix handling of :display option.

Fix handling of :display option.

--- src/clj/quil/applet.clj
+++ src/clj/quil/applet.clj
@@ -127,7 +127,8 @@
   "Checks that the size vector is exactly two elements. If not, throws
   an exception, otherwise returns the size vector unmodified."
   [size display]
-  (cond (= size :fullscreen) (apply display-size display)
+  (cond (= size :fullscreen) (if (== :default display) (display-size)
+                               (display-size display))
         (and (coll? size) (= 2 (count size))) size
         :else (throw (IllegalArgumentException.
                       (str "Invalid size definition: " size ". Was expecting :fullscreen or 2 elements vector: [x-size y-size].")))))
@@ -383,8 +384,7 @@
         options           (merge (dissoc options :features)
                                  features)

-        display           (let [d (:display options)]
-                            (if d [d] []))
+        display           (or (:display options) :default)
         size              (process-size (:size options) display)

         title             (or (:title options) (str "Quil " (swap! untitled-applet-id* inc)))


Throw an IllegalArgumentException instead of a regular Exception

--- src/clj_http/client.clj
+++ src/clj_http/client.clj
@@ -319,7 +319,7 @@

 (definline check-url! [url]
   `(when (nil? ~url)
-     (throw (Exception. "Host URL cannot be nil"))))
+     (throw (IllegalArgumentException. "Host URL cannot be nil"))))

 (defn get
   "Like #'request, but sets the :method and :url as appropriate."


optionally use a function to specify the db connection (cherry picked from commit 54e2d307fe4787f0f37e90457c04c15fcc84ce60)

--- src/clj_record/meta.clj
+++ src/clj_record/meta.clj
@@ -22,4 +22,7 @@
     (ref-set model-ref (assoc @model-ref category value))))

 (defn db-spec-for [model-name]
-  (model-metadata-for model-name :db-spec))
+  (let [db-spec (model-metadata-for model-name :db-spec)]
+    (if (fn? db-spec)
+      (db-spec)
+      db-spec)))


Fix typo. Close #245.

Fix typo. Close #245.

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -2794,7 +2794,7 @@
   can happen, and functions like save-frame may not be used.

   Note that if the sketch is resized, redraw will be called to
-  update the sketch, even after no-oop has been
+  update the sketch, even after no-loop has been
   specified. Otherwise, the sketch would enter an odd state until
   loop was called."
   []


unroll vary-meta

unroll vary-meta

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2541,8 +2541,18 @@
 (defn vary-meta
  "Returns an object of the same type and value as obj, with
   (apply f (meta obj) args) as its metadata."
- [obj f & args]
- (with-meta obj (apply f (meta obj) args)))
+  ([obj f]
+   (with-meta obj (f (meta obj))))
+  ([obj f a]
+   (with-meta obj (f (meta obj) a)))
+  ([obj f a b]
+   (with-meta obj (f (meta obj) a b)))
+  ([obj f a b c]
+   (with-meta obj (f (meta obj) a b c)))
+  ([obj f a b c d]
+   (with-meta obj (f (meta obj) a b c d)))
+  ([obj f a b c d & args]
+   (with-meta obj (apply f (meta obj) a b c d args))))

 (defn ^boolean not=
   "Same as (not (= obj1 obj2))"


Rename js-equals to 'identical?'

Rename js-equals to 'identical?'

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -83,11 +83,11 @@
 (defn js-delete [obj key]
   (js* "delete ~{obj}[~{key}]"))

-(defn js-equals [x y]
+(defn identical? [x y]
   (js* "return ~{x} === ~{y}"))

 (defn nil? [x]
-  (js-equals x nil))
+  (identical? x nil))

 (defn seq
   "Returns a seq on the collection. If the collection is
@@ -193,13 +193,13 @@

 (extend-protocol IEquiv
   goog.global.String
-  (-equiv [o other] (js-equals o other))
+  (-equiv [o other] (identical? o other))

   goog.global.Number
-  (-equiv [o other] (js-equals o other))
+  (-equiv [o other] (identical? o other))

   goog.global.Date ; treat dates as values
-  (-equiv [o other] (js-equals (.toString o ()) (.toString other ()))))
+  (-equiv [o other] (identical? (.toString o ()) (.toString other ()))))

 (defn = [x y]
   (-equiv x y))


use clearier font for links

use clearier font for links

--- src/cljs/paren/app.cljs
+++ src/cljs/paren/app.cljs
@@ -121,8 +121,7 @@
         [paren-box focus?]
         [:p "- OR -"]
         [:a {:href "#"
-             :style {:font-family "Helvetica, Arial"
-                     :font-weight "bold"}
+             :style {:font-family "Helvetica, Arial"}
              :on-click #(swap! flipped? not)}
           "Just show me everyting"]])))

@@ -172,7 +171,6 @@
                    :alt (-> @app-state :events last :location)}]])]
       [:a {:href "#"
            :style {:font-family "Helvetica, Arial"
-                   :font-weight "bold"
                    :margin-top "10px"}
            :on-click #(swap! flipped? not)}
         "Give me back! My Terminal!"]]))


Convert groupname to slashes for promotion reading from filesystem

--- src/clojars/promote.clj
+++ src/clojars/promote.clj
@@ -16,7 +16,7 @@

 (defn file-for [group artifact version extension]
   (let [filename (format "%s-%s.%s" artifact version extension)]
-    (io/file (config :repo) group artifact version filename)))
+    (apply io/file (concat [(config :repo)] (str/split group #"\.") [artifact version filename]))))

 (defn check-file [blockers file]
   (if (.exists file)


nearest-color with pal returns fn

nearest-color with pal returns fn

--- src/clojure2d/color.clj
+++ src/clojure2d/color.clj
@@ -2803,20 +2803,20 @@
 (defn nearest-color
   "Find nearest color from a set. Input: distance function (default euclidean), list of target colors and source color."
   {:metadoc/categories #{:dist}}
-  ([f xf c]
-   (let [s (count xf)]
+  ([f pal c]
+   (let [s (count pal)]
      (loop [i (int 0)
             currc c
             currdist Double/MAX_VALUE]
        (if (< i s)
-         (let [c1 (nth xf i)
+         (let [c1 (nth pal i)
                dist (m/abs (double (f c c1)))]
            (recur (unchecked-inc i)
                   (if (< dist currdist) c1 currc)
                   (if (< dist currdist) dist currdist)))
          currc))))
-  ([xf c]
-   (nearest-color euclidean xf c)))
+  ([pal c] (nearest-color euclidean pal c))
+  ([pal] (partial nearest-color pal)))

 (defn average
   "Average colors in given `colorspace` (default: `:RGB`)"


more debug logging

more debug logging

--- src/clj/backtype/storm/daemon/supervisor.clj
+++ src/clj/backtype/storm/daemon/supervisor.clj
@@ -312,7 +312,7 @@
                            (when @active (conf SUPERVISOR-MONITOR-FREQUENCY-SECS))
                            )
                          :priority Thread/MAX_PRIORITY)]))]
-    (log-message "Starting supervisor with id " supervisor-id)
+    (log-message "Starting supervisor with id " supervisor-id " at host " my-hostname)
     (reify
      Shutdownable
      (shutdown [this]


Ensure argument to printf is a float.

Ensure argument to printf is a float.

--- src/clojush/problems/classification/penn.clj
+++ src/clojush/problems/classification/penn.clj
@@ -80,7 +80,7 @@
     (printf  "\nTest mean: %.4f"
             (float (/ (apply + best-test-errors)
                       (count best-test-errors))))(flush)
-    (printf "\nTest RMSE: %.4f" (rmse best-test-errors))(flush)
+    (printf "\nTest RMSE: %.4f" (float (rmse best-test-errors)))(flush)
     (printf "\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n")(flush)
     ))

@@ -92,12 +92,12 @@

 (def penn-atom-generators
   (concat (distinct (mapv :target (:train penn-fitness-cases))) ;; classes, for output
-          (list (tag-instruction-erc [:exec :integer :boolean :string] 1000)
-                (tagged-instruction-erc 1000))
+          ;(list (tag-instruction-erc [:exec :integer :boolean :string] 1000)
+          ;      (tagged-instruction-erc 1000))
           (for [n (map inc
                        (range (count (:inputs (first (:train penn-fitness-cases))))))]
             (symbol (str "in" n)))
-          (registered-for-stacks [:exec :integer :boolean :string])))
+          (registered-for-stacks [:exec :integer :boolean])))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Main call
@@ -126,3 +126,4 @@
    :final-report-simplifications 5000
    })

+


CMR-809: Changed to address pull request comments.

--- src/cmr/indexer/data/concepts/collection.clj
+++ src/cmr/indexer/data/concepts/collection.clj
@@ -8,6 +8,7 @@
             [cmr.indexer.data.elasticsearch :as es]
             [cmr.common.mime-types :as mt]
             [cmr.common.log :refer (debug info warn error)]
+            [cmr.common.services.errors :as errors]
             [cmr.umm.related-url-helper :as ru]
             [cmr.indexer.data.concepts.temporal :as temporal]
             [cmr.indexer.data.concepts.attribute :as attrib]
@@ -22,13 +23,12 @@
   [collection]
   (when-let [geometries (seq (get-in collection [:spatial-coverage :geometries]))]
     (let [sr (get-in collection [:spatial-coverage :spatial-representation])]
-      ;; TODO Add support for all spatial representations and geometries
       (cond
         (or (= sr :geodetic) (= sr :cartesian))
         (spatial/spatial->elastic-docs sr collection)

         :else
-        (info "Ignoring indexing spatial of collection spatial representation of" sr)))))
+        (errors/internal-error! (str "Unknown spatial representation [" sr "]"))))))

 (defmethod es/concept->elastic-doc :collection
   [context concept collection]
@@ -81,9 +81,9 @@
             :processing-level-id.lowercase (when processing-level-id (str/lower-case processing-level-id))
             :collection-data-type collection-data-type
             :collection-data-type.lowercase (when collection-data-type
-                                              (if (= java.lang.String (type collection-data-type))
-                                                (str/lower-case collection-data-type)
-                                                (map str/lower-case collection-data-type)))
+                                              (if (sequential? collection-data-type)
+                                                (map str/lower-case collection-data-type)
+                                                (str/lower-case collection-data-type)))
             :platform-sn platform-short-names
             :platform-sn.lowercase  (map str/lower-case platform-short-names)
             :instrument-sn instrument-short-names


Charsets

Charsets

--- test/yada/representations_test.clj
+++ test/yada/representations_test.clj
@@ -92,6 +92,7 @@
   ;; limited in the same fashion." -- RFC 7231 Section 5.3.1
   [rep acceptable]
   (when
+      ;; TODO: Case sensitivity/insensitivity requirements
       (= (:parameters acceptable) (:parameters rep))
     (cond
       (and (= (:type acceptable) (:type rep))
@@ -137,26 +138,23 @@
             {:content-type (mime/string->media-type "text/html")})
            [(float 1.0) 3 0 (float 1.0)])))

-
   (testing "Basic match, with multiple options"
     (is (= (get-highest-content-type-quality
             {:headers {"accept" "image/png,text/html"}}
             {:content-type (mime/string->media-type "text/html")})
-           [(float 1.0) 3 0 (float 1.0)]))
-
-    (testing "Basic match, with multiple options and q values"
+           [(float 1.0) 3 0 (float 1.0)])))
+
+  (testing "Basic match, with multiple options and q values"
       (is (= (get-highest-content-type-quality
               {:headers {"accept" "image/png,text/html;q=0.9"}}
               {:content-type (mime/string->media-type "text/html;q=0.8")})
-             [(float 0.9) 3 0 (float 0.8)]))))
-
+             [(float 0.9) 3 0 (float 0.8)])))

   (testing "Basic reject"
     (is (= (get-highest-content-type-quality
             {:headers {"accept" "text/html"}}
             {:content-type (mime/string->media-type "text/plain")})
            :rejected)))
-

   (testing "Basic reject with multiple options"
     (is (= (get-highest-content-type-quality
@@ -199,13 +197,80 @@
              {:content-type (mime/string->media-type "text/html;level=1")}) 2)
            ;; We get a specificty score of 3, indicating we matched on the
            ;; text/html rather than the preceeding text/*
-           1)))
-
-  ;; TODO: Test charsets
-
-  ;; TODO: Test encodings
-
-  )
+           1))))
+
+;; Charsets ------------------------------------
+
+(defn charset-acceptable? [rep acceptable-charset]
+  (when
+      (or (= (charset/charset acceptable-charset) "*")
+          (and
+           (some? (charset/charset acceptable-charset))
+           (= (charset/charset acceptable-charset)
+              (charset/charset rep)))
+          ;; Finally, let's see if their canonical names match
+          (and
+           (some? (charset/canonical-name acceptable-charset))
+           (= (charset/canonical-name acceptable-charset)
+              (charset/canonical-name rep))))
+    [(:quality acceptable-charset) (:quality rep)]))
+
+(defn highest-charset-quality
+  "Given a collection of acceptable charsets, return a function that
+  will return the quality."
+  [accepts]
+  (fn [rep]
+    (best (map (partial charset-acceptable? (:charset rep)) accepts))))
+
+(defn make-charset-quality-assessor
+  [req k]
+  (->
+   (->> (get-in req [:headers "accept-charset"]) parse-csv (map charset/to-charset-map))
+   highest-charset-quality
+   (wrap-quality-assessor :charset)
+   skip-rejected))
+
+(defn- get-highest-charset-quality
+  "Given the request and a representation, get the highest possible
+  quality value. Convenience function for independent testing."
+  [req rep]
+  (let [k :charset
+        qa (make-charset-quality-assessor req k)
+        rep (qa rep)]
+    (or (get-in rep [:qualities k])
+        (when (:rejected rep) :rejected))))
+
+(deftest charset-test
+
+  (testing "Basic match"
+    (is (= (get-highest-charset-quality
+            {:headers {"accept-charset" "utf-8"}}
+            {:charset (charset/to-charset-map "utf-8")})
+           [(float 1.0) (float 1.0)])))
+
+  (testing "Quality values"
+    (is (= (get-highest-charset-quality
+            {:headers {"accept-charset" "utf-8;q=0.8"}}
+            {:charset (charset/to-charset-map "utf-8;q=0.9")})
+           [(float 0.8) (float 0.9)])))
+
+  (testing "Multiple choices"
+    (is (= (get-highest-charset-quality
+            {:headers {"accept-charset" "us-ascii,utf-8;q=0.9,Shift_JIS"}}
+            {:charset (charset/to-charset-map "utf-8")})
+           [(float 0.9) (float 1.0)])))
+
+  (testing "Multiple choices but none ok"
+    (is (= (get-highest-charset-quality
+            {:headers {"accept-charset" "us-ascii,Shift_JIS"}}
+            {:charset (charset/to-charset-map "utf-8")})
+           :rejected))))
+
+;; TODO: Test encodings - note that encodings can be combined
+
+;; TODO: Test languages
+
+

 ;; "A request without any Accept header
 ;; field implies that the user agent


Fix handler test

Fix handler test

--- test/yetibot/core/test/handler.clj
+++ test/yetibot/core/test/handler.clj
@@ -3,6 +3,7 @@
     [yetibot.core.parser :refer [parser]]
     [yetibot.core.handler :refer :all]
     [yetibot.core.commands.history]
+    [yetibot.core.util.command :refer [extract-command]]
     [clojure.string :as s]
     [yetibot.core.repl :refer [load-minimal]]
     [instaparse.core :as insta]
@@ -17,7 +18,8 @@
     {:adapter :test :room "foo"}
     {:id "yetitest"}
     :message
-    (str "test history: " i)))
+    (str "test history: " i)
+    {:username "yetibot" :id "123"}))

 (deftest test-newline-cmd


Allow pathom connect graphql configuring `tempid?`.

--- src/com/wsscode/pathom/connect/graphql2.cljc
+++ src/com/wsscode/pathom/connect/graphql2.cljc
@@ -331,8 +331,11 @@

 (defn query->graphql
   "Like the pg/query-graphql, but adds name convertion so clj names like :first-name turns in firstName."
-  [query {::keys [demung] :or {demung identity}}]
-  (pg/query->graphql query {::pg/js-name (comp demung name)}))
+  [query {::keys [demung tempid?]
+          :or {demung identity
+               tempid? (constantly false)}}]
+  (pg/query->graphql query {::pg/js-name (comp demung name)
+                            ::pg/tempid? tempid?}))

 (defn ast->graphql [{:keys     [ast]
                      ::pc/keys [indexes]}


:bug: Fix colorpalette navigation

:bug: Fix colorpalette navigation

--- frontend/src/uxbox/main/ui/workspace/colorpalette.cljs
+++ frontend/src/uxbox/main/ui/workspace/colorpalette.cljs
@@ -31,7 +31,7 @@

 (mx/defc palette-item
   {:mixins [mx/static]}
-  [color]
+  [color position]
   (letfn [(select-color [event]
             (let [attrs (if (kbd/shift? event)
                           {:stroke-color color}
@@ -88,8 +88,12 @@
            [:div.btn-palette.create i/close]]]

        [:span.left-arrow {}
-        (when (> offset 0)
-          {:on-click #(swap! local update :offset (fnil dec 1))})
+        (if (> (:position @local) 0)
+          {:on-click #(swap! local update :position dec)}
+          {:class :disabled})
+        ;; FIXME Objects are not valid as a React child (found: :on-click).
+        ;;(when (> offset 0)
+        ;;  {:on-click #(swap! local update :offset (fnil dec 1))})
         i/arrow-slide]

        [:div.color-palette-content {:ref "container"}
@@ -100,9 +104,13 @@
                (mx/with-key color)))]]

        [:span.right-arrow
-        (if (< offset invisible)
-          {:on-click #(swap! local update :offset (fnil inc 0))}
-          {})
+        (if (< (* (+ 1 (:position @local)) 10) (count (:colors selected-coll)))
+          {:on-click #(swap! local update :position inc)}
+          {:class :disabled})
+        ;; FIXME Objects are not valid as a React child (found: :on-click).
+        ;;(if (< offset invisible)
+        ;;  {:on-click #(swap! local update :offset (fnil inc 0))}
+        ;;  {})
         i/arrow-slide]
        [:span.close-palette {:on-click close}
         i/close]])))


removed a tab (the only one I could find)

--- src/desdemona/launcher/launch_prod_peers.clj
+++ src/desdemona/launcher/launch_prod_peers.clj
@@ -39,5 +39,5 @@
                          (onyx.api/shutdown-peer-group peer-group)
                          (shutdown-agents))))
     (println "Started peers. Blocking forever.")
-	;; Block forever.
+    ;; Block forever.
     (<!! (chan))))


fix logic from 2e84459 for merge conflict detection

- add more logging for merge conflict

--- src/github_bot_app/action/merge_conflict.clj
+++ src/github_bot_app/action/merge_conflict.clj
@@ -121,26 +121,32 @@
                                    :base-ref base-ref
                                    :head-ref (get-in pull [:head :ref])
                                    :last-merged merged-pull-id}))
-                       (if (< 0 (compare (last-conflict-comment-instant owner repo pull-id config)
-                                         (last-commit-instant owner repo pull-id config))) ;; true if comment-instant is nil
-                         (do
-                           (github-api-time!
-                            (gh-issues/create-comment
-                             owner repo pull-id
-                             (str "It looks like #"
-                                  merged-pull-id
-                                  " got there first and ruined your clean merge!\n\n"
-                                  "You'll need to need to resolve the conflicts with the `"
-                                  base-ref
-                                  "` branch.\n")
-                             (:auth-options config)))
+                       (let [comment-inst (last-conflict-comment-instant owner repo pull-id config)
+                             commit-inst (last-commit-instant owner repo pull-id config)]
+                         (log/info (pr-str
+                                    {:info :merge-conflict
+                                     :url (:url p)
+                                     :comment-inst comment-inst
+                                     :commit-inst commit-inst}))
+                         (if (< (compare comment-inst commit-inst) 0) ;; true if comment-instant is nil
+                           (do
+                             (github-api-time!
+                              (gh-issues/create-comment
+                               owner repo pull-id
+                               (str "It looks like #"
+                                    merged-pull-id
+                                    " got there first and ruined your clean merge!\n\n"
+                                    "You'll need to need to resolve the conflicts with the `"
+                                    base-ref
+                                    "` branch.\n")
+                               (:auth-options config)))
+                             (log/info (pr-str
+                                        {:api-call :create-comment
+                                         :url (:comments_url p)
+                                         :info :merge-conflict})))
                            (log/info (pr-str
-                                      {:api-call :create-comment
-                                       :url (:comments_url p)
-                                       :info :merge-conflict})))
-                         (log/info (pr-str
-                                    {:info :existing-merge-conflict
-                                     :url (:url p)})))))))))))))
+                                      {:info :existing-merge-conflict
+                                       :url (:url p)}))))))))))))))
       (log/info (pr-str
                  {:schedule
                   {:delay 5


Kinda noisy

Kinda noisy

--- integration-tests/apps/ring/basic-ring/src/basic_ring/core.clj
+++ integration-tests/apps/ring/basic-ring/src/basic_ring/core.clj
@@ -5,8 +5,7 @@

 (defn handler [request]
   (let [body (str "Hello From Clojure inside TorqueBox! This is basic-ring
" shared? "
")
-        services (seq (map #(.getCanonicalName %) (.getServiceNames service/registry)))
         factory (service/service "jboss.naming.context.java.ConnectionFactory")]
     {:status 200
      :headers {"Content-Type" "text/html"}
-     :body (str body "
" services "

" factory "
")}))
+     :body (str body "
" factory "
")}))


Add Hurrcane 1800 Flex fogger.

Add Hurrcane 1800 Flex fogger.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -58,6 +58,15 @@
                               10 :strobe)
               (chan/dimmer 8)]
    :name "Geyser RGB"})
+
+(defn hurricane-1800-flex
+  "[Hurricane 1800 Flex](http://www.chauvetlighting.com/hurricane-1800-flex.html) fogger."
+  {:doc/format :markdown}
+  []
+  {:channels [(chan/functions :fog 1
+                              0 nil
+                              6 "Fog")]
+   :name "Hurricane 1800 Flex"})

 (defn intimidator-spot-led-150
   "[Intimidator Spot LED 150](http://www.chauvetlighting.com/intimidator-spot-led-150.html) moving yoke.


Must have a timestamp to insert.

Must have a timestamp to insert.

--- src/kixi/hecuba/data/measurements/upload.clj
+++ src/kixi/hecuba/data/measurements/upload.clj
@@ -219,7 +219,7 @@
     (try
       (let [page-size 10
             validated-measurements (->> measurements
-                                        (remove #(nil? (:timestamp %)))
+                                        (filter #(seq (:timestamp %)))
                                         (map #(-> %
                                                   (prepare-measurement sensor date-parser)
                                                   (v/validate sensor))))]


[#21] Removed old api endpoint

[#21] Removed old api endpoint

--- backend/src/org/akvo/dash/endpoint/api.clj
+++ backend/src/org/akvo/dash/endpoint/api.clj
@@ -1,88 +0,0 @@
-(ns org.akvo.dash.endpoint.api
-  (:require [cheshire.core :as json]
-            [compojure.core :refer :all]
-            [ring.util.response :refer [redirect]]))
-
-(defn imports
-  "Resource that will list imports"
-  [req config]
-  {:status 200
-   :headers {"content-type" "application/json"}
-   :body (json/generate-string (if true ;; pending
-                                 {:status   :pending
-                                  :progress "77%"}
-                                 {:status     :done
-                                  :dataset-id 1}))})
-
-(def root-body
-  "Static links to resources."
-  "

-
Collections

-
Dashboards

-
Datasets

-
Library

-
Visualizations

-
")
-
-(defn root
-  "List of resources."
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/html"}
-   :body root-body})
-
-(defn collections
-  "List all entities in a dataset"
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/plain"}
-   :body    "Visualizations"})
-
-(defn dashboards
-  "List all entities in a dataset"
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/plain"}
-   :body    "Dashboards"})
-
-(defn datasets
-  "List all entities in a dataset"
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/plain"}
-   :body    (json/generate-string {:meta {:key "value"}
-                                   :dataset [{:id 1} {:id 2}]})})
-
-(defn library
-  "List all entities in a library"
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/plain"}
-   :body    "Library"})
-
-(defn visualizations
-  "List all entities in a dataset"
-  [req config]
-  {:status  200
-   :headers {"content-type" "text/plain"}
-   :body    "Visualizations"})
-
-(defn api-v1-routes
-  ""
-  [config]
-  (context "/v1" []
-           (GET "/" req (root req config))
-           (GET "/collections" req (collections req config))
-           (GET "/dashboards" req (dashboards req config))
-           (GET "/datasets" req (datasets req config))
-           (GET "/imports" req (imports req config))
-           (GET "/library" req (library req config))
-           (GET "/visualizations" req (visualizations req config))))
-
-(defn api-endpoint
-  ""
-  [config]
-  (context "/apii" []
-           (GET "/" []
-                (redirect "/api/v1"))
-           (api-v1-routes config)))


Typos...

Typos...

--- src/main/clj/clojure/core/matrix/complex.clj
+++ src/main/clj/clojure/core/matrix/complex.clj
@@ -93,14 +93,14 @@

    mp/PMatrixProducts
      (inner-product [m a]
-       (ComplexArray. (mp/add-scaled (mp/inner-product (clojure.core.matric.complex/real m)
+       (ComplexArray. (mp/add-scaled (mp/inner-product (clojure.core.matrix.complex/real m)
                                                        (clojure.core.matrix.complex/real a))
-                                     (mp/inner-product (clojure.core.matric.complex/imag m)
+                                     (mp/inner-product (clojure.core.matrix.complex/imag m)
                                                        (clojure.core.matrix.complex/imag a))
                                      -1)
-                      (mp/matrix-add (mp/inner-product (clojure.core.matric.complex/real m)
+                      (mp/matrix-add (mp/inner-product (clojure.core.matrix.complex/real m)
                                                        (clojure.core.matrix.complex/imag a))
-                                     (mp/inner-product (clojure.core.matric.complex/imag m)
+                                     (mp/inner-product (clojure.core.matrix.complex/imag m)
                                                        (clojure.core.matrix.complex/real a))))))


turn down logging

turn down logging

--- src/babel/francais/morphology.cljc
+++ src/babel/francais/morphology.cljc
@@ -94,7 +94,7 @@
           (and underspecified?
                (not (= :if-underspecified :error)))
           (do
-            (log/warn (str "conjugate: underspecified: returning infinitive: " infinitive "; conjugate-with: " (strip-refs conjugate-with)))
+            (log/debug (str "conjugate: underspecified: returning infinitive: " infinitive "; conjugate-with: " (strip-refs conjugate-with)))
             (str infinitive))

           underspecified?


Fix calls to submit-mocked-assignment: executor id should be of the form [first-task last-task]


[#2650] Augment undo transformation logs with tx result message

--- backend/src/akvo/lumen/lib/transformation/engine.clj
+++ backend/src/akvo/lumen/lib/transformation/engine.clj
@@ -213,7 +213,7 @@
               (log/info (str "Unsuccessful undo of dataset: " dataset-id))
               (log/debug message)
               (log/debug "Job executionid: " job-execution-id)
-              (throw (ex-info (str "Failed to undo transformation index:" tx-index) {:transformation-result transformation-result
+              (throw (ex-info (str "Failed to undo transformation index:" tx-index ". Tx message:" message) {:transformation-result transformation-result
                                                                                :transformation transformation})))))))))

 (defn execute-undo [{:keys [tenant-conn] :as deps} dataset-id job-execution-id]


Use "byte buffer" consistently

Use "byte buffer" consistently

--- src/caesium/crypto/generichash.clj
+++ src/caesium/crypto/generichash.clj
@@ -50,7 +50,7 @@

   All arguments must be `java.nio.ByteBuffer`.

-  You only want this to manage the output byte array yourself. Otherwise, you
+  You only want this to manage the output byte buffer yourself. Otherwise, you
   want [[blake2b]]."
   ([buf msg]
    (blake2b-to-buf! buf msg {}))


Use map instead of pmap for performance debugging

--- src/lcmap/aardvark/tile.clj
+++ src/lcmap/aardvark/tile.clj
@@ -221,7 +221,7 @@
           [xs ys] (:data_shape band)
           tiles   (dataset->tiles tile-xf dataset xs ys)]
       (progress source "band-start" (:ubid band))
-      (dorun (pmap process-tile tiles))
+      (dorun (map process-tile tiles))
       (progress source "band-done" (:ubid band)))))

 (defn process-scene
@@ -232,7 +232,7 @@
                          (map +locate)
                          (map (fn [band] (assoc band :source (:id source))))
                          (filter conforms?))]
-     (dorun (pmap #(process-band % source) (scene->bands scene-dir band-xf)))
+     (dorun (map #(process-band % source) (scene->bands scene-dir band-xf)))
      :done)))

 (defn process


Minor: break out handle-keydown function

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -196,6 +196,17 @@

   (set! (.-onmouseup overlay-canvas) handle-mouseup))

+(defn handle-keydown!
+  "Bind ctrl-z to undo and ctrl-i to open-image"
+  [e]
+  (when (and (= (aget e "keyCode") 90)
+             (aget e "ctrlKey"))
+    (undo!))
+
+  (when (and (= (aget e "keyCode") 73)
+             (aget e "ctrlKey"))
+    (open-as-png! (:canvas @app-state))))
+
 (defn init!
   "Initialise event handlers, add atom watches, do the first rendering"
   []
@@ -205,22 +216,13 @@

   (add-overlay-handlers! (get @app-state :overlay-canvas))

-  (set! (.-onkeydown js/window)
-        (fn [e]
-          (when (and (= (aget e "keyCode") 90)
-                     (aget e "ctrlKey"))
-            (undo!))
-
-          (when (and (= (aget e "keyCode") 73)
-                     (aget e "ctrlKey"))
-            (open-as-png! (:canvas @app-state)))))
+  (set! (.-onkeydown js/window) handle-keydown!)

   (set! (.-onclick (.getElementById js/document "undo")) undo!)

   (set! (.-onclick (.getElementById js/document "reset")) reset-rendering-data!)

-  (set! (.-onclick (.getElementById js/document "png"))
-        #(open-as-png! (:canvas @app-state)))
+  (set! (.-onclick (.getElementById js/document "png")) #(open-as-png! (:canvas @app-state)))

   (render-mandelbrot! @app-state))


Fix bug in keydown binding - you can't have two \!

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -223,13 +223,11 @@
   (set! (.-onkeydown js/window)
         (fn [e]
           (when (and (= (aget e "keyCode") 90)
-                   (aget e "ctrlKey"))
-            (undo!))))
-
-  (set! (.-onkeydown js/window)
-        (fn [e ]
+                     (aget e "ctrlKey"))
+            (undo!))
+
           (when (and (= (aget e "keyCode") 73)
-                   (aget e "ctrlKey"))
+                     (aget e "ctrlKey"))
             (open-as-png! (:canvas @app-state)))))

   (set! (.-onclick (.getElementById js/document "undo")) undo!)


set null config bug fix

set null config bug fix

--- src/clojure/zensols/cisql/conf.clj
+++ src/clojure/zensols/cisql/conf.clj
@@ -52,8 +52,20 @@

 (add-set-config-hook update-system-properties)

+(defn- config-data []
+  (swap! config-data-inst
+         (fn [prefs]
+           (if (nil? prefs)
+             (let [prefs (pref/environment default-config)]
+               (doseq [[k v] prefs]
+                 (doseq [callback @set-config-hooks]
+                   ((eval callback) k v)))
+               prefs)
+             prefs))))
+
 (defn set-config [key value]
   (log/tracef "%s -> %s" key value)
+  (config-data)
   (if-not (contains? default-config key)
     (-> (format "no such variable: %s" (name key))
         (ex-info {:key key :value value})
@@ -67,17 +79,6 @@
       ((eval callback) key value))
     (pref/set-environment @config-data-inst)
     (log/tracef "vars: %s" @config-data-inst)))
-
-(defn- config-data []
-  (swap! config-data-inst
-         (fn [prefs]
-           (if (nil? prefs)
-             (let [prefs (pref/environment default-config)]
-               (doseq [[k v] prefs]
-                 (doseq [callback @set-config-hooks]
-                   ((eval callback) k v)))
-               prefs)
-             prefs))))

 (defn config [key]
   (if (nil? key)


Changing reset status code.

Changing reset status code.

--- src/cmr/metadata_db/api/routes.clj
+++ src/cmr/metadata_db/api/routes.clj
@@ -119,9 +119,7 @@
   "Delete all concepts from the data store"
   [context params]
   (concept-service/reset context)
-  {:status 204
-   :body nil
-   :headers json-header})
+  {:status 204})

 (defn- get-concept-id
   "Get the concept id for a given concept."


Update docstrings

Update docstrings

--- src/cortex/optimise.clj
+++ src/cortex/optimise.clj
@@ -72,7 +72,7 @@
                          ])

 (defn sgd-optimiser
-  "Constructs a new AdaDelta optimiser of the given size (parameter length)"
+  "Constructs a new Stochastic Gradient Descent optimiser of the given size (parameter length)"
   ([size]
     (sgd-optimiser size nil))
   ([size {:keys [learn-rate momentum] :as options}]
@@ -115,44 +115,47 @@

 (deftype MSELoss []
   cp/PLossFunction
-  (loss [this v target]
-    (let [z (m/sub v target)]
-      (m/esum (m/pow z 2))))
+    (loss [this v target]
+      (let [z (m/sub v target)]
+        (m/esum (m/pow z 2))))

-  (loss-gradient [this v target]
-    (m/sub v target)))
+    (loss-gradient [this v target]
+      (m/sub v target)))

-(defn mse-loss []
-  (MSELoss.))
+(defn mse-loss
+  "Returns a Mean Squared Error (MSE) loss function"
+  ([]
+    (MSELoss.)))

 ; NOTE: not really sure how this is supposed to differ and why from a simple MSE
 ; loss.  Must investigate.
 (deftype QuadraticLoss []
   cp/PLossFunction
-  (loss [this v target]
-    ; NOTE: linear/norm is different for matrices and vectors so this row-matrix
-    ; conversion is important for correctness.
-    ;(println "loss: " v "-" target)
-    (let [diff (m/sub v target)
-          diff (if (m/vec? diff) (m/row-matrix diff) diff)]
-      (m/mul 0.5 (m/pow (linear/norm diff) 2))))
+    (loss [this v target]
+      ; NOTE: linear/norm is different for matrices and vectors so this row-matrix
+      ; conversion is important for correctness.
+      ;(println "loss: " v "-" target)
+      (let [diff (m/sub v target)
+            diff (if (m/vec? diff) (m/row-matrix diff) diff)]
+        (m/mul 0.5 (m/pow (linear/norm diff) 2))))

-  (loss-gradient [this v target]
-    (m/sub v target)))
+    (loss-gradient [this v target]
+      (m/sub v target)))

 (defn quadratic-loss
-  []
-  (QuadraticLoss.))
+  "Returns a qaudratic loss function"
+  ([]
+    (QuadraticLoss.)))

 (def SMALL-NUM 1e-30)

 (deftype CrossEntropyLoss []
   cp/PLossFunction
-  (loss [this v target]
-    (let [a (m/mul (m/negate target) (m/log (m/add SMALL-NUM v)))
-          b (m/mul (m/sub 1.0 target) (m/log (m/sub (+ 1.0 (double SMALL-NUM)) a)))
-          c (m/esum (m/sub a b))]
-      c))
+    (loss [this v target]
+      (let [a (m/mul (m/negate target) (m/log (m/add SMALL-NUM v)))
+            b (m/mul (m/sub 1.0 target) (m/log (m/sub (+ 1.0 (double SMALL-NUM)) a)))
+            c (m/esum (m/sub a b))]
+        c))

-  (loss-gradient [this v target]
-    (m/sub v target)))
+    (loss-gradient [this v target]
+      (m/sub v target)))


Converted macro container-checker into container-check-maker fn.

--- src/midje/util/checkers.clj
+++ src/midje/util/checkers.clj
@@ -413,9 +413,21 @@
 	:else
 	[actual expected kind]))

-
-(defn- best-seq-match-actual [comparison]
++;;
+
+(defn- map-or-not [thing] (if (map? thing) :map :not-map))
+
+(defmulti best-match-actual map-or-not)
+(defmethod best-match-actual :not-map [comparison]
   (str "Best match found: " (pr-str (:actual-found comparison))))
+(defmethod best-match-actual :map [comparison]
+  (str "Best match found: {"
+       (apply str
+              (interpose ", "
+                         (sort (map (fn [[k v]] (str (pr-str k) " " (pr-str v)))
+                                    (:actual-found comparison)))))
+       "}."))

 (defn- best-seq-match-expected [comparison expected]
   (if (or (some extended-fn? expected)
@@ -431,14 +443,6 @@
                                 (:expected-found comparison))))
          "] (in that order)")))

-(defn- best-map-match-actual [comparison]
-  (str "Best match found: {"
-       (apply str
-              (interpose ", "
-                         (sort (map (fn [[k v]] (str (pr-str k) " " (pr-str v)))
-                                    (:actual-found comparison)))))
-       "}."))
-
 (defn- best-map-match-expected [comparison expected]
   (if (or (some extended-fn? (vals expected))
           (some regex? (vals expected)))
@@ -487,7 +491,7 @@
 ;  (println 'map-match actual expected kind)
   (let [comparison (map-comparison actual expected kind)
         mismatch-description (fn [comparison expected]
-                               (remove nil? [ (best-map-match-actual comparison)
+                               (remove nil? [ (best-match-actual comparison)
                                               (best-map-match-expected comparison expected) ]))]
     (or (total-match? comparison)
         (tag-as-chatty-falsehood
@@ -497,7 +501,7 @@
 (defn full-sequence-match? [actual expected kind]
   (let [comparison (seq-comparison actual expected kind)
         mismatch-description (fn [comparison expected]
-                               (remove nil? [ (best-seq-match-actual comparison)
+                               (remove nil? [ (best-match-actual comparison)
                                               (best-seq-match-expected comparison expected) ]))]
     (or (total-match? comparison)
         (tag-as-chatty-falsehood


Cleanup

Cleanup

--- src/midje/util/checkers.clj
+++ src/midje/util/checkers.clj
@@ -184,7 +184,7 @@
 	argmap `(hash-map ~@first-kvs)]
     `(merge-with conj ~hashmap ~argmap)))

-(defn- all-expected-variants [expected]
+(defn- all-expected-permutations [expected]
   (cond (not-any? extended-fn? expected)
 	[expected]

@@ -213,12 +213,11 @@
   [actual expected & kind]
   (let [starting-candidate  {:actual-found [], :expected-found [],
 			     :expected-skipped-over [], :expected expected }
-	starting-expected-variants (all-expected-variants expected)
+	starting-expected-permutations (all-expected-permutations expected)
 	gaps-ok? (some #{:gaps-ok} kind)]
-    (println :in-any-order gaps-ok?)
     (loop [walking-actual   actual
-	   walking-expected (first starting-expected-variants)
-	   expected-variants starting-expected-variants
+	   walking-expected (first starting-expected-permutations)
+	   expected-permutations starting-expected-permutations
 	   best-so-far      starting-candidate
 	   candidate        starting-candidate]

@@ -229,160 +228,51 @@
 	    ;; window good so far, keep working on it
 	    (recur (rest walking-actual)
 		   (concat (:expected-skipped-over candidate) (rest walking-expected))
-		   expected-variants
+		   expected-permutations
 		   best-so-far
 		   (tack-on-to candidate
 			       :actual-found (first walking-actual)
 			       :expected-found (first walking-expected)))

 	    (not (empty? (rest walking-expected)))
-	    ;; Perhaps another value in the current expected variant will work.
+	    ;; Perhaps another value in the current expected permutation will work.
+	    ;; We can, after all, be in any order.
 	    (recur walking-actual
 		   (rest walking-expected)
-		   expected-variants
+		   expected-permutations
 		   best-so-far
 		   (tack-on-to candidate
 			       :expected-skipped-over (first walking-expected)))

 	    (not (empty? (rest walking-actual)))
+	    ;; OK, there's no match for this actual element in the whole expected.
 	    (if gaps-ok?
-	      ;; Current actual doesn't match anything expected. Lose it and
-	      ;; try other actuals on same expected variant.
+	      ;; Since gaps are OK, we can drop the bad actual element and look for next one.
 	      (recur (rest walking-actual)
-		     (first expected-variants)
-		     expected-variants
+		     (first expected-permutations)
+		     expected-permutations
 		     (better-of candidate best-so-far)
 		     candidate)

-	      ;; Current window didn't work. Slide it down, reusing same expected variant
+	      ;; Start again with a new actual: the tail of what we started with.
 	      (recur (rest (concat (:actual-found candidate) walking-actual))
-		   (first expected-variants)
-		   expected-variants
+		   (first expected-permutations)
+		   expected-permutations
 		   (better-of candidate best-so-far)
                    starting-candidate))

-	    (not (empty? (rest expected-variants)))
-	    ;; Can't slide window any further, so let's try another variant
+	    (not (empty? (rest expected-permutations)))
+	    ;; No more actual elements, and we still have no match. So try a
+	    ;; different permutation of the expected list. (This is required
+	    ;; because of matching functions.
             (recur actual
-                   (second expected-variants)
-		   (rest expected-variants)
+                   (second expected-permutations)
+		   (rest expected-permutations)
 		   (better-of candidate best-so-far)
                    starting-candidate)

-	    :else ; no variant left, window used up. give up.
+	    :else ; no permutation left, no smaller actuals to try. give up.
 	    (better-of candidate best-so-far)))))
-
-;; (defmethod seq-comparison #{:in-any-order}
-;;   [actual expected & kind]
-;;   (let [starting-candidate  {:actual-found [], :expected-found [],
-;; 			     :expected-skipped-over [], :expected expected }
-;; 	starting-expected-variants (all-expected-variants expected)]
-;;     (loop [walking-actual   actual
-;;            walking-expected (first starting-expected-variants)
-;; 	   expected-variants starting-expected-variants
-;;            best-so-far      starting-candidate
-;;            candidate        starting-candidate]
-
-;;       (cond (or (empty? walking-actual) (empty? walking-expected))
-;;             (better-of candidate best-so-far)
-
-;; 	    (extended-= (first walking-actual) (first walking-expected))
-;; 	    ;; window good so far, keep working on it
-;; 	    (recur (rest walking-actual)
-;; 		   (concat (:expected-skipped-over candidate) (rest walking-expected))
-;; 		   expected-variants
-;; 		   best-so-far
-;; 		   (tack-on-to candidate
-;; 			       :actual-found (first walking-actual)
-;; 			       :expected-found (first walking-expected)))
-
-;; 	    (not (empty? (rest walking-expected)))
-;; 	    ;; Perhaps another value in the current expected variant will work.
-;; 	    (recur walking-actual
-;; 		   (rest walking-expected)
-;; 		   expected-variants
-;; 		   best-so-far
-;; 		   (tack-on-to candidate
-;; 			       :expected-skipped-over (first walking-expected)))
-
-;; 	    (not (empty? (rest walking-actual)))
-;; 	    ;; Current window didn't work. Slide it down, reusing same expected variant
-;;             (recur (rest (concat (:actual-found candidate) walking-actual))
-;; 		   (first expected-variants)
-;; 		   expected-variants
-;; 		   (better-of candidate best-so-far)
-;;                    starting-candidate)
-
-;; 	    (not (empty? (rest expected-variants)))
-;; 	    ;; Can't slide window any further, so let's try another variant
-;;             (recur actual
-;;                    (second expected-variants)
-;; 		   (rest expected-variants)
-;; 		   (better-of candidate best-so-far)
-;;                    starting-candidate)
-
-;; 	    :else ; no variant left, window used up. give up.
-;; 	    (better-of candidate best-so-far)))))
-
-
-;; (defmethod seq-comparison #{:in-any-order :gaps-ok}
-;;   [actual expected & kind]
-;;   (let [starting-candidate  {:actual-found [], :expected-found [],
-;; 			     :expected-skipped-over [], :expected expected }
-;; 	starting-expected-variants (all-expected-variants expected)]
-;;     ;; (println "=============")
-;;     ;; (println actual expected)
-;;     ;; (println starting-expected-variants)
-
-;;     (loop [walking-actual   actual
-;;            walking-expected (first starting-expected-variants)
-;; 	   expected-variants starting-expected-variants
-;;            best-so-far      starting-candidate
-;;            candidate        starting-candidate]
-;;       ;; (println "walking " walking-actual "of" walking-expected)
-;;       ;; (println "remainder " expected-variants)
-
-;;       (cond (or (empty? walking-actual) (empty? walking-expected))
-;;             (better-of candidate best-so-far)
-
-;; 	    (extended-= (first walking-actual) (first walking-expected))
-;; 	    ;; actual good so far, keep working on it
-;; 	    (recur (rest walking-actual)
-;; 		   (concat (:expected-skipped-over candidate) (rest walking-expected))
-;; 		   expected-variants
-;; 		   best-so-far
-;; 		   (tack-on-to candidate
-;; 			       :actual-found (first walking-actual)
-;; 			       :expected-found (first walking-expected)))
-
-;; 	    (not (empty? (rest walking-expected)))
-;; 	    ;; Perhaps another value in the current expected variant will work.
-;; 	    (recur walking-actual
-;; 		   (rest walking-expected)
-;; 		   expected-variants
-;; 		   best-so-far
-;; 		   (tack-on-to candidate
-;; 			       :expected-skipped-over (first walking-expected)))
-
-;; 	    (not (empty? (rest walking-actual)))
-;; 	    ;; Current actual doesn't match anything expected. Lose it and
-;; 	    ;; try other actuals on same expected variant.
-;;             (recur (rest walking-actual)
-;; 		   (first expected-variants)
-;; 		   expected-variants
-;; 		   (better-of candidate best-so-far)
-;;                    candidate)
-
-;; 	    (not (empty? (rest expected-variants)))
-;; 	    ;; Can't slide window any further, so let's try another variant
-;;             (recur actual
-;;                    (second expected-variants)
-;; 		   (rest expected-variants)
-;; 		   (better-of candidate best-so-far)
-;;                    starting-candidate)
-
-;; 	    :else ; no variant left, window used up. give up.
-;; 	    (better-of candidate best-so-far)))))

 (defmethod seq-comparison :strict-order
   [actual expected & kind]
@@ -423,42 +313,6 @@
 		   expected
 		   (better-of candidate best-so-far)
 		   starting-candidate)))))
-
-
-;; (defmethod seq-comparison #{}
-;;   [actual expected & kind]
-;;   (let [starting-candidate  {:actual-found [], :expected-found [], :expected expected }]
-;;     ;; (println "=============")
-;;     ;; (println actual expected)
-
-;;     (loop [actual           actual
-;; 	   walking-actual   actual
-;;            walking-expected expected
-;;            best-so-far      starting-candidate
-;;            candidate        starting-candidate]
-;;       ;; (println "walking " walking-actual "of" walking-expected)
-
-;;       (cond (or (empty? walking-actual) (empty? walking-expected))
-;;             (better-of candidate best-so-far)
-
-;; 	    (extended-= (first walking-actual) (first walking-expected))
-;; 	    ;; actual good so far, keep working on it
-;; 	    (recur actual
-;; 	           (rest walking-actual)
-;; 		   (rest walking-expected)
-;; 		   best-so-far
-;; 		   (tack-on-to candidate
-;; 			       :actual-found (first walking-actual)
-;; 			       :expected-found (first walking-expected)))
-
-;; 	    (not (empty? actual))
-;; 	    ;; See if we can find something better later on.
-;; 	    (recur (rest actual)
-;; 		   (rest actual)
-;; 		   expected
-;; 		   (better-of candidate best-so-far)
-;; 		   starting-candidate)))))
-

 ; Searches through particular types of actual results


Reformat config

Reformat config

--- src/discuss/config.cljs
+++ src/discuss/config.cljs
@@ -4,14 +4,14 @@

 (def user "Q2hyaXN0aWFu")

-(def api {:host "http://localhost:4284/"
-          :init "api/elektroautos"
-          :base "api/"
+(def api {:host  "http://localhost:4284/"
+          :init  "api/elektroautos"
+          :base  "api/"
           :login "api/login"
-          :add  {:add-start-statement "api/add/start_statement"
-                 :add-start-premise   "api/add/start_premise"
-                 :add-justify-premise "api/add/justify_premise"}
-          :get  {:references       "api/get/references"
-                 :reference-usages "api/get/reference/usages"
-                 :statements       "api/get/statements"
-                 :statement-url    "api/get/statement/url"}})+          :add   {:add-start-statement "api/add/start_statement"
+                  :add-start-premise   "api/add/start_premise"
+                  :add-justify-premise "api/add/justify_premise"}
+          :get   {:references       "api/get/references"
+                  :reference-usages "api/get/reference/usages"
+                  :statements       "api/get/statements"
+                  :statement-url    "api/get/statement/url"}})