Prepare build for public release.

Prepare build for public release.

--- project.clj
+++ project.clj
@@ -27,23 +27,32 @@
                     parkour.remote.mux
                     parkour.util]
           :output-dir "tmp/codox"}
-  :aliases {"test-all" ["with-profile" ~(str "default,hadoop-0-20-205:"
-                                             "default,hadoop-1-0-3:"
-                                             "default,hadoop-1-2-1:"
-                                             "default,hadoop-cdh3:"
-                                             "default,hadoop-cdh4:"
-                                             "default,hadoop-2-2-0")
+  :aliases {"test-all" ["with-profile" ~(str "+hadoop-0-20-205:"
+                                             "+hadoop-1-0-3:"
+                                             "+hadoop-1-2-1:"
+                                             "+hadoop-cdh3:"
+                                             "+hadoop-cdh4:"
+                                             "+hadoop-2-2-0")
                         ,              "test"]}
-  :profiles {:provided {:dependencies
-                        [[org.codehaus.jsr166-mirror/jsr166y "1.7.0"]
-                         [org.apache.hadoop/hadoop-core "1.2.1"]
+  :profiles {:default [:base :system :user :provided :java6 :dev]
+             :conjars {:repositories
+                       [["conjars" "http://conjars.org/repo/"]]}
+             :cloudera {:repositories
+                        [["cloudera" ~(str "https://repository.cloudera.com"
+                                           "/artifactory/cloudera-repos/")]]}
+             :platypope {:repositories
+                         [["platypope" "http://jars.platypope.org/release/"]]}
+             :provided {:dependencies
+                        [[org.apache.hadoop/hadoop-core "1.2.1"]
                          [org.slf4j/slf4j-api "1.6.1"]
                          [org.slf4j/slf4j-log4j12 "1.6.1"]
                          [log4j "1.2.17"]]}
+             :java6 {:dependencies
+                     [[org.codehaus.jsr166-mirror/jsr166y "1.7.0"]]}
              :examples {:source-paths ["examples"]}
              :dev [:examples
-                   {:repositories {"conjars" "http://conjars.org/repo/"}
-                    :dependencies
+                   :conjars ;; For cascading-* *
+                   {:dependencies
                     [[cascading/cascading-hadoop "2.2.0"
                       :exclusions [org.codehaus.janino/janino
                                    org.apache.hadoop/hadoop-core]]]}]
@@ -54,21 +63,17 @@
                             [[org.apache.hadoop/hadoop-core "1.0.3"]]}
              :hadoop-1-2-1 {:dependencies
                             [[org.apache.hadoop/hadoop-core "1.2.1"]]}
-             :hadoop-cdh3 {:repositories
-                           [["cloudera" ~(str "https://repository.cloudera.com"
-                                              "/artifactory/cloudera-repos/")]]
-                           :dependencies
-                           [[org.apache.hadoop/hadoop-core "0.20.2-cdh3u3"]]}
-             :hadoop-cdh4 {:repositories
-                           [["cloudera" ~(str "https://repository.cloudera.com"
-                                              "/artifactory/cloudera-repos/")]
-                            ["damballa" "http://jars.repo.rnd.atl.damballa/"]]
-                           :dependencies
-                           [[org.apache.hadoop/hadoop-core "2.0.0-mr1-cdh4.1.2"]
-                            [org.apache.hadoop/hadoop-common "2.0.0-cdh4.1.2"]
-                            [org.apache.avro/avro-mapred "1.7.5"
-                             :classifier "hadoop1-cdh4"
-                             :exclusions [org.apache.avro/avro-ipc]]]}
+             :hadoop-cdh3 [:cloudera ;; For hadoop-* *-*cdh3*
+                           {:dependencies
+                            [[org.apache.hadoop/hadoop-core "0.20.2-cdh3u3"]]}]
+             :hadoop-cdh4 [:cloudera ;; For hadoop-* *-*cdh4*
+                           :platypope ;; For avro-mapred 1.7.5 hadoop1-cdh4
+                           {:dependencies
+                            [[org.apache.hadoop/hadoop-core "2.0.0-mr1-cdh4.1.2"]
+                             [org.apache.hadoop/hadoop-common "2.0.0-cdh4.1.2"]
+                             [org.apache.avro/avro-mapred "1.7.5"
+                              :classifier "hadoop1-cdh4"
+                              :exclusions [org.apache.avro/avro-ipc]]]}]
              :hadoop-2-2-0 {:dependencies
                             [[org.apache.hadoop/hadoop-client "2.2.0"]
                              [org.apache.hadoop/hadoop-common "2.2.0"]


Increment version number

Increment version number

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject nightcode "0.4.4-SNAPSHOT"
+(defproject nightcode "0.4.4"
   :description "An IDE for Clojure and Java"
   :url "https://github.com/oakes/Nightcode"
   :license {:name "Public Domain"


A lot has transpired: bumping version

A lot has transpired: bumping version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sparqlab "0.5.0"
+(defproject sparqlab "0.6.0"
   :description "Lab for exercising SPARQL"
   :url "http://github.com/jindrichmynarz/sparqlab"
   :dependencies [[cheshire "5.7.1"]


0.4.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject testdouble/clojurescript.csv "0.4.2"
+(defproject testdouble/clojurescript.csv "0.4.3-SNAPSHOT"
   :description "A ClojureScript library for reading and writing comma (and other) separated values."
   :url "https://github.com/testdouble/clojurescript.csv"
   :license {:name "Eclipse Public License"


Upgrade ClojureScript to 1.10.597

Upgrade ClojureScript to 1.10.597

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
   :license     {:name "MIT"}

   :dependencies [[org.clojure/clojure       "1.10.1" :scope "provided"]
-                 [org.clojure/clojurescript "1.10.520" :scope "provided"
+                 [org.clojure/clojurescript "1.10.597" :scope "provided"
                   :exclusions [com.google.javascript/closure-compiler-unshaded
                                org.clojure/google-closure-library
                                org.clojure/google-closure-library-third-party]]


incremented version

incremented version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject gorillalabs/sparkling "1.2.4-SNAPSHOT"
+(defproject gorillalabs/sparkling "1.2.4.1-SNAPSHOT"
             :description "A Clojure Library for Apache Spark"
             :url "https://gorillalabs.github.io/sparkling/"
             :license {:name "Eclipse Public License"


remove cljsjs react

remove cljsjs react

--- project.clj
+++ project.clj
@@ -13,7 +13,6 @@
                  [compojure "1.4.0"]
                  [garden "1.3.0-SNAPSHOT"]
                  [prismatic/dommy "1.1.0"]
-                 [cljsjs/react "0.14.0-0"]
                  [org.omcljs/om "0.9.0"  :exclusions [cljsjs/react]]
                  [sablono "0.3.6"  :exclusions [cljsjs/react]]
                  [jarohen/chord "0.6.0"]


latest swag

latest swag


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-sql "0.7.3-beta9"
+(defproject org.onyxplatform/onyx-sql "0.7.3-SNAPSHOT"
   :description "Onyx plugin for JDBC-backed SQL databases"
   :url "https://github.com/MichaelDrogalis/onyx-sql"
   :license {:name "Eclipse Public License"


Next dev cycle.

Next dev cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject active-clojure "0.5.0"
+(defproject active-clojure "0.6.0-SNAPSHOT"
   :description "Active Clojure: Various Clojure utilities in use at Active Group"
   :url "http://github.com/active-group/active-clojure"
   :license {:name "Eclipse Public License"


Revert "try not optimizing prod js code to see if this makes a difference with search bar problems | fs | #39"

This reverts commit 940a66497f736ec7e5a4955c27df24df544e5136.

--- project.clj
+++ project.clj
@@ -114,5 +114,5 @@
                                    :builds {:app
                                              {:source-paths ["env/prod/cljs"]
                                               :compiler
-                                              {:optimizations :whitespace
-                                               :pretty-print true}}}}}})
+                                              {:optimizations :advanced
+                                               :pretty-print false}}}}}})


working on 2.7.4

working on 2.7.4

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject babel "2.7.3"
+(defproject babel "2.7.4-SNAPSHOT"
   :description "A library for natural language generation and parsing"
   :url "http://github.com/ekoontz/babel"
   :license {:name "Eclipse Public License"


Add build config for Node test (but not running on CI)

--- project.clj
+++ project.clj
@@ -28,7 +28,14 @@
                         :compiler {:output-to "target/nashorn_out/test.js"
                                    :output-dir "target/nashorn_out"
                                    :main pinpointer.runner
-                                   :optimizations :whitespace}}]}
+                                   :optimizations :whitespace}}
+                       {:id "node-test"
+                        :source-paths ["src" "test/cljc" "test/cljs"]
+                        :compiler {:output-to "target/node_out/test.js"
+                                   :output-dir "target/node_out"
+                                   :main pinpointer.runner
+                                   :optimizations :none
+                                   :target :nodejs}}]}

   :eftest {:report eftest.report.pretty/report}

@@ -40,4 +47,5 @@
             "test-cljs" ["do" ["test-cljs-none" "once"]
                               ["test-cljs-nashorn" "once"]]
             "test-cljs-none" ["doo" "phantom" "test"]
-            "test-cljs-nashorn" ["doo" "nashorn" "nashorn-test"]})
+            "test-cljs-nashorn" ["doo" "nashorn" "nashorn-test"]
+            "test-cljs-node" ["doo" "node" "node-test"]})


Bump version for development.

Bump version for development.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.toomuchcode/clara-rules "0.10.0"
+(defproject org.toomuchcode/clara-rules "0.11.0-SNAPSHOT"
   :description "Clara Rules Engine"
   :url "https://github.com/rbrush/clara-rules"
   :license {:name "Eclipse Public License"


try new gc options

try new gc options

--- project.clj
+++ project.clj
@@ -20,7 +20,7 @@
              "-Dcom.sun.management.jmxremote.port=9876"
              "-Dcom.sun.management.jmxremote.authenticate=false"
              "-Dcom.sun.management.jmxremote.ssl=false"
-             "-Xmx4G"
+             "-Xmx6G"
              "-enableassertions"
-             ;"-XX:+UseParNewGC" "-XX:+UseConcMarkSweepGC" "-XX:+CMSParallelRemarkEnabled"
+             "-XX:+UseParNewGC" "-XX:+UseConcMarkSweepGC" "-XX:+CMSParallelRemarkEnabled"
              ])


clojars config

clojars config

--- project.clj
+++ project.clj
@@ -6,6 +6,8 @@
             :key "mit"
             :year 2015}
   :min-lein-version "2.3.4"
+  :signing {:gpg-key "rozifus@gmail.com"}
+  :deploy-repositories [["clojars" {:creds :gpg}]]
   :source-paths ["src" "test"]
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.8.34"]]


PDOK-1025: remove clostache import

PDOK-1025: remove clostache import

--- project.clj
+++ project.clj
@@ -9,7 +9,6 @@
                  [org.clojure/tools.trace "0.7.8"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [environ "1.0.0"]
-                 [de.ubercode.clostache/clostache "1.4.0"]
                  [org.clojure/tools.cli "0.3.1"]
                  [com.fasterxml.jackson.core/jackson-core "2.4.4"]
                  [clj-time "0.9.0"]


Version 1.5.0

Version 1.5.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.zalando.stups/friboo "1.5.0-SNAPSHOT"
+(defproject org.zalando.stups/friboo "1.5.0"
   :description "A utility library to write microservices in clojure."
   :url "https://github.com/zalando-stups/friboo"


latest subs

latest subs

--- project.clj
+++ project.clj
@@ -50,7 +50,7 @@
                  [puny "0.3.0"]
                  [com.taoensso/carmine "2.11.1"]
                  [commons-codec "1.10"]
-                 [substantiation "0.2.1"]
+                 [substantiation "0.3.1"]
                  [fogus/minderbinder "0.2.0"]
                  [org.clojure/core.logic "0.8.10"]
                  ; scheduling


Preparing for release 0.2.9

Preparing for release 0.2.9

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject se.haleby/stub-http "0.2.9-SNAPSHOT"
+(defproject se.haleby/stub-http "0.2.9"
   :description "A client library agonistic way to stub HTTP responses"
   :url "https://github.com/johanhaleby/stub-http"
   :license {:name         "MIT License"


Dropping str fun in project.clj, messing with clojars

--- project.clj
+++ project.clj
@@ -1,6 +1,5 @@
 (defproject clj-fuzzy "0.1.0"
-  :description (str "A handy compilation of algorithms"
-                    "dealing with fuzzy strings and phonetics.")
+  :description "A handy compilation of algorithms dealing with fuzzy strings and phonetics."
   :url "https://github.com/Yomguithereal/clj-fuzzy"
   :license {:name "MIT"
             :url "http://opensource.org/licenses/MIT"}


(MAINT) Bump to 2.1.3-SNAPSHOT

(MAINT) Bump to 2.1.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (def tk-version "1.1.1")
 (def tk-jetty-version "1.3.1")
 (def ks-version "1.1.0")
-(def ps-version "2.1.2")
+(def ps-version "2.1.3-SNAPSHOT")

 (defn deploy-info
   [url]


remove duplicate sente dep, upgrade to newest stable

fixes an issue where if you log in and immediately try to log out, the
CSRF token is missing

--- project.clj
+++ project.clj
@@ -10,7 +10,7 @@
                  [fogus/ring-edn "0.3.0"]
                  [compojure "1.4.0"]
                  [environ "1.0.0"]
-                 [com.taoensso/sente "1.5.0"]
+                 [com.taoensso/sente "1.7.0"]
                  [com.taoensso/timbre "4.0.2"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [crypto-password "0.1.3"]
@@ -25,7 +25,6 @@
                  [prismatic/schema "0.4.3"]
                  [secretary "1.2.3"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
-                 [com.taoensso/sente "1.5.0"]
                  [com.lucasbradstreet/cljs-uuid-utils "1.0.2"]
                  [org.clojars.leanpixel/om-fields "1.8.6"]
                  [com.andrewmcveigh/cljs-time "0.4.0"]]


cleaning up project.clj

cleaning up project.clj

--- project.clj
+++ project.clj
@@ -1,5 +1,4 @@
 (use '[clojure.java.shell :only [sh]])
-(require '(leiningen deploy))

 (defproject com.rallydev/jarvis-core "1.0.0"
   :description "A robot for FlowDock"


Update dependencies.

Update dependencies.

--- project.clj
+++ project.clj
@@ -18,13 +18,13 @@
     [com.taoensso/timbre "4.8.0-alpha1"] ; Logging https://github.com/ptaoussanis/timbre
     [raven-clj "1.4.3"] ; Interface to Sentry error reporting https://github.com/sethtrain/raven-clj
     [com.stuartsierra/component "0.3.1"] ; Component Lifecycle
-    [amazonica "0.3.76"] ; A comprehensive Clojure client for the entire Amazon AWS api https://github.com/mcohen01/amazonica
+    [amazonica "0.3.77"] ; A comprehensive Clojure client for the entire Amazon AWS api https://github.com/mcohen01/amazonica
     [hiccup "1.0.5"] ; HTML rendering https://github.com/weavejester/hiccup
     [cheshire "5.6.3"] ; JSON encoding / decoding https://github.com/dakrone/cheshire
     [manifold "0.1.6-alpha3"] ; Async programming tools https://github.com/ztellman/manifold
     [clj-time "0.12.0"] ; Date and time lib https://github.com/clj-time/clj-time
     [jfree/jfreechart "1.0.13"] ; Java chart library http://www.jfree.org/jfreechart/
-    [open-company/lib "0.0.4.2-6cdf3dd"] ; Library for OC projects https://github.com/open-company/open-company-lib
+    [open-company/lib "0.0.5-5899489"] ; Library for OC projects https://github.com/open-company/open-company-lib
   ]

   :repositories [["jfreechart" "http://central.maven.org/maven2/"]]


updating frame sequence interval in verlet demo

--HG--
branch : develop

--- test/simplecl/verlet_test.clj
+++ test/simplecl/verlet_test.clj
@@ -285,4 +285,4 @@
             (time (physics-time-step step (:pipeline state) false))
             (recur (rest iter) state)))))))

-(defn -main [& args] (run-sim physics-state 200 600 5 1920 1080))
+(defn -main [& args] (run-sim physics-state 5 600 5 1920 1080))


Added generate-report

Added generate-report

Does not contain the actual calculation of the values from tasks

--- kanbanik-statistics/src/main/clojure/org/kanbanik/statistics.clj
+++ kanbanik-statistics/src/main/clojure/org/kanbanik/statistics.clj
@@ -9,17 +9,17 @@
   )
 )

-(defn reduce-chunk [grouped-chunk base-timestamp]
-  (let [last-from-chunk (last (val (first grouped-chunk)))]
-    (assoc
-      last-from-chunk
-      :timestamp
-      (- (:timestamp last-from-chunk) base-timestamp)
+(defn reduce-tasks [grouped base-timestamp]
+  (defn reduce-chunk [grouped-chunk base-timestamp]
+    (let [last-from-chunk (last (val (first grouped-chunk)))]
+      (assoc
+          last-from-chunk
+        :timestamp
+        (- (:timestamp last-from-chunk) base-timestamp)
+        )
+      )
     )
-  )
-)

-(defn reduce-tasks [grouped base-timestamp]
   (let [vals (map (fn [[k v]] v) grouped)] ; ignore the timestamps
     ; result is something like:
     ; ({10 [{:id 10, :timestamp 20}]} {20 [{:id 20, :timestamp 30}]}
@@ -46,3 +46,49 @@
     )
   )
 )
+
+
+
+(defn generate-report [descriptor tasks]
+"
+The tasks are one timeframe output from the reduce-tasks
+
+Example input (aka descriptor)
+[
+ {
+  :type :composite
+  :title \"some title\"
+  :children [
+   {
+    :type :leaf
+    :filter {:worfklowitem-id 12}
+    :function :avg-cnt/:avg-time
+   }
+  ]
+ }
+]
+
+Example output
+[
+ {
+  :title \"some title\"
+  :children [
+    {
+      :type :leaf
+      :value 10
+    }
+  ]
+ }
+]
+"
+  (loop [res [] desc descriptor]
+    (if (= (count desc) 0)
+      res
+      (if (= (:type (first desc)) :leaf)
+        (recur (conj res {:type :leaf :value 103}) (rest desc))
+        (recur (conj res {:title (:title (first desc)) :children (generate-report (:children (first desc)) tasks)}) (rest desc))
+      )
+    )
+  )
+)
+


[#2809] Adapt RQG to null responses

[#2809] Adapt RQG to null responses

--- backend/src/akvo/lumen/lib/import/flow_common.clj
+++ backend/src/akvo/lumen/lib/import/flow_common.clj
@@ -122,7 +122,7 @@
   (let [dict (let [[rep-col non-rep-col] (u/split-with-non-stop :repeatable groups)]
                {:rqg-ns (set (map :id rep-col)) :main-ns (set (map :id non-rep-col))})]
     (into [(with-meta
-             (question-responses-base (select-keys responses (:main-ns dict)))
+             (or (question-responses-base (select-keys responses (:main-ns dict))) {})
              {:ns "main"})]
           (mapv #(with-meta
                     (or (question-responses-base {% (get responses %)}) {})


Close api token modal after submitting

Close api token modal after submitting

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1342,9 +1342,11 @@
                                                                            :data-loading-text "Adding..." ,
                                                                            :value "Create Token" ,
                                                                            :type "submit"
-                                                                           :on-click #(raise! owner [:saved-project-api-token {:project-id project-id
-                                                                                :api-token {:scope scope
-                                                                                :label label}}])}])]})))
+                                                                           :on-click #(do
+                                                                                (raise! owner [:saved-project-api-token {:project-id project-id
+                                                                                :api-token {:scope scope
+                                                                                :label label}}])
+                                                                                (close-fn))}])]})))
               (when-let [tokens (seq (:tokens project-data))]
                 (om/build table/table
                           {:rows tokens


Test we can encrypt/verify without specifying and algorithm

--- test/buddy/hashers_tests.clj
+++ test/buddy/hashers_tests.clj
@@ -20,6 +20,8 @@
 (deftest buddy-hashers
   (let [plain-password "my-test-password"]
     (is (hashers/check plain-password
+                       (hashers/encrypt plain-password)))
+    (is (hashers/check plain-password
                        (hashers/encrypt plain-password {:algorithm :pbkdf2+sha1})))
     (is (hashers/check plain-password
                        (hashers/encrypt plain-password {:algorithm :pbkdf2+sha256})))


Fix tests on CLJS

Fix tests on CLJS

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -2393,7 +2393,8 @@
         :args (s/cat :x nat-int? :y nat-int?)
         :ret pos?)
 (defn results-str-fn1 [x y]
-  (+' x y))
+  #?(:clj (+' x y)
+     :cljs (+ x y)))

 (s/fdef results-str-fn2
         :args (s/cat :x nat-int? :y nat-int?)
@@ -2958,9 +2959,9 @@
                    :name ::spec-name
                    :spec (s/spec ::spec)))

-(s/def ::spec-defs (s/coll-of ::spec-def
-                              :min-count 1
-                              :gen-max 3))
+#?(:clj (s/def ::spec-defs (s/coll-of ::spec-def
+                                      :min-count 1
+                                      :gen-max 3)))

 (defn exercise-count [spec]
   (case spec


Added back some previously disabled tests, which also pass now.

--- test/minijava/test_canon.clj
+++ test/minijava/test_canon.clj
@@ -44,7 +44,6 @@
            5))))
 )

-(comment
  (deftest test-commute
   (let [s (Statement (Const 0))
         m (Move s (Const 2))
@@ -117,7 +116,7 @@
         prog (Seq [(Label other)
                    (Conditional :< (Const 3) (Const 4) (Name t) (Name f))
                    ])]))
-)
+

 (deftest test-simple
   (let [t (tm/label)
@@ -173,25 +172,51 @@
 						(Const 5)
             (Jump (Name other))
             (Label f)]))))
-(comment
-(deftest test-recursion-call
-  (let [t (tm/label)
-        f (tm/label)
-				v1 (tm/temp)
-        other (tm/label)
-				function (tm/label)
-        prog  (Seq [(Label other)
-                    (Conditional :< (BinaryOp :+ (ExpSeq (Statement (Const 3)) (Const 2)) (Temp v1) ) (Const 4)  (Name t) (Name f))
-                    (Label t)
-                    (Seq [(Call (Name function) [(BinaryOp :+  (ExpSeq (Seq [(Const 1) (Const 2)]) (Const 3)) (Const 4) ) (Const 5) ])])
+
+(deftest test-call
+  (let [t (tm/label)
+        f (tm/label)
+				v1 (tm/temp)
+        other (tm/label)
+				function (tm/label)
+        prog  (Seq [(Label other)
+                    (Conditional :< (BinaryOp :+ (ExpSeq [(Statement (Const 3))] (Const 2)) (Temp v1) ) (Const 4)  (Name t) (Name f))
+                    (Label t)
+                    (Seq [(Call (Name function) [(Const 5)]) ])
                     (Jump (Name other))
                     (Label f)])]
     (is (= (canon prog)
            [
             (Label other)
 						(Statement (Const 3))
-            (Conditional :< (BinaryOp :+ (Const 2) (Temp v1)) (Name t) (Name f))
-            (Label t)
+            (Conditional :< (BinaryOp :+ (Const 2) (Temp v1)) (Const 4) (Name t) (Name f))
+            (Label t)
+						(Call (Name function) [(Const 5)])
+            (Jump (Name other))
+            (Label f)]))))
+
+(comment
+(deftest test-recursion-call
+  (let [t (tm/label)
+        f (tm/label)
+				v1 (tm/temp)
+        other (tm/label)
+				function (tm/label)
+        prog  (Seq [(Label other)
+                    (Conditional :< (BinaryOp :+ (ExpSeq [(Statement (Const 3))] (Const 2)) (Temp v1) ) (Const 4)  (Name t) (Name f))
+                    (Label t)
+                    (Seq [(Call (Name function) [(BinaryOp :+  (ExpSeq [(Seq [(Const 1) (Const 2)])] (Const 3)) (Const 4) ) (Const 5) ])])
+                    (Jump (Name other))
+                    (Label f)])]
+    (is (= (canon prog)
+           [
+            (Label other)
+						(Statement (Const 3))
+            (Conditional :< (BinaryOp :+ (Const 2) (Temp v1)) (Const 4) (Name t) (Name f))
+            (Label t)
+						(Const 1)
+						(Const 2)
+						(Call (Name function) [(BinaryOp :+ (Const 3) (Const 4) ) (Const 5) ])
             (Jump (Name other))
             (Label f)]))))
 )


added drop-collection

added drop-collection

--- src/karras.clj
+++ src/karras.clj
@@ -35,6 +35,9 @@
      (.getCollection db collection-name))
   ([mongo db-name collection-name]
      (collection (.getDB mongo db-name) collection-name)))
+
+(defn drop-collection [#^DBCollection collection]
+  (.drop collection))

 (defn insert [#^DBCollection collection & objs]
   (if (= 1 (count objs))


A bit of reformating, and tests for with-class

--- test/test_huh/test_core.cljs
+++ test/test_huh/test_core.cljs
@@ -21,13 +21,33 @@
 (deftest test-coverage-is-good-enough
   (is (= 2 3)))

+;; with-text
 (deftest with-text-returns-true-when-text-present
   (is (= true ((huh/with-text "some text")
-               (rendered-div #js {}
-                             "some text")))))
+               (rendered-div #js {} "some text")))))

 (deftest with-text-returns-error-without-match
-  (is (= {:msg "Text does not match" :expected "some text" :actual "other text"}
+  (is (= {:msg "Text does not match"
+          :expected "some text" :actual "other text"}
          ((huh/with-text "some text")
-          (rendered-div #js {}
-                        "other text")))))
+          (rendered-div #js {} "other text")))))
+
+;; with-class
+(deftest with-class-returns-true-when-class-matches
+  (is (= true ((huh/with-class "some-class")
+               (rendered-div #js {:className "some-class"} nil)))))
+
+(deftest with-class-returns-true-when-class-present-in-list
+  (is (= true ((huh/with-class "some-class")
+               (rendered-div #js {:className "some-class other-class"} nil)))))
+
+(deftest with-class-returns-error-when-class-doesnt-match
+  (is (= {:msg "Class name does not match"
+          :expected "some-class" :actual "other-class"}
+          ((huh/with-class "some-class")
+           (rendered-div #js {:className "other-class"} nil)))))
+
+(deftest with-class-returns-error-when-class-not-specified
+  (is (= {:msg "Class name does not match"
+          :expected "some-class" :actual ""}
+          ((huh/with-class "some-class") (rendered-div #js {} nil)))))


Add namespace for rbush spatial index

Add namespace for rbush spatial index

--- src/cljs/chocolatier/engine/systems/collision.cljs
+++ src/cljs/chocolatier/engine/systems/collision.cljs
@@ -2,48 +2,9 @@
   "System for checking collisions between entities"
   (:require [chocolatier.utils.logging :as log]
             [chocolatier.engine.ecs :as ecs]
-            [chocolatier.engine.events :as ev]))
+            [chocolatier.engine.events :as ev]
+            [chocolatier.engine.rbush :as r]))

-
-(defn rbush
-  ([]
-   (js/rbush))
-  ([max-entries]
-   (js/rbush max-entries)))
-
-(defn rbush-item
-  ([x1 y1 x2 y2]
-   (rbush-item x1 y1 x2 y2 nil))
-  ([x1 y1 x2 y2 data]
-   (array x1 y1 x2 y2 data)))
-
-(defn rbush-insert!
-  [rbush item]
-  (.insert rbush item))
-
-(defn rbush-bulk-insert!
-  [rbush items]
-  (.load rbush items))
-
-(defn rbush-remove!
-  [rbush item]
-  (.remove rbush item))
-
-(defn rbush-clear!
-  [rbush]
-  (.clear rbush))
-
-(defn rbush-collides?
-  [rbush item]
-  (.collides rbush item))
-
-(defn rbush-search
-  [rbush item]
-  (.search rbush item))
-
-(defn rbush-all
-  [rbush]
-  (.all rbush))

 (def spatial-index-location
   [:state :spatial-index])
@@ -52,7 +13,7 @@
   "Format entity state for use with spatial index. Includes all
    collision component state in the metadata of the spatial tree item"
   [id {:keys [pos-x pos-y offset-x offset-y]} {:keys [height width attributes]}]
-  (rbush-item pos-x
+  (r/rbush-item pos-x
               pos-y
               ;; Adjust the width and height of the bounding box based
               ;; on where the entity will be next frame
@@ -71,7 +32,7 @@
            items (array)]
       (let [entity-id (first entities)]
         (if (nil? entity-id)
-          (rbush-bulk-insert! index items)
+          (r/rbush-bulk-insert! index items)
           (let [move-state (get moveable-states entity-id)
                 collision-state (get collidable-states entity-id)]
             (when (not (and (nil? move-state) (nil? collision-state)))
@@ -82,7 +43,7 @@

 (defn get-or-create-spatial-index
   [state max-entries]
-  (get-in state spatial-index-location (rbush max-entries)))
+  (get-in state spatial-index-location (r/rbush max-entries)))

 (defn mk-broad-collision-system
   "Returns a system function that creates a spatial index with max-entries.
@@ -93,7 +54,7 @@
           spatial-index (get-or-create-spatial-index state max-entries)]
       ;; Clear the spatial index for the frame since we can't modify
       ;; it once it's been inserted
-      (rbush-clear! spatial-index)
+      (r/rbush-clear! spatial-index)
       (update-spatial-index! state spatial-index entity-ids)
       (assoc-in state spatial-index-location spatial-index))))

@@ -121,11 +82,11 @@
        (not (attack? attributes))
        (not (keyword-identical? id (:from-id attributes)))))

-(defn ^boolean not-self? [id item]
-  (not (keyword-identical? id (:id (nth item 4)))))
+(defn self? [id item]
+  (keyword-identical? id (:id (nth item 4))))

-(defn ^boolean not-self-attack? [id item]
-  (not (keyword-identical? id (get-in (nth item 4) [:attributes :from-id]))))
+(defn self-attack? [id item]
+  (keyword-identical? id (get-in (nth item 4) [:attributes :from-id])))

 (defn collision-events
   "Returns a hashmap of all collision events by entity ID"
@@ -136,8 +97,8 @@
       (if item
         (if (valid-collision-item? item width height)
           (let [id (:id (nth item 4))
-                collisions (rbush-search spatial-index item)]
-            (if (some #(and (not-self? id %) (not-self-attack? id %))
+                collisions (r/rbush-search spatial-index item)]
+            (if (some #(not (or (self? id %) (self-attack? id %)))
                       collisions)
               (recur (rest items)
                      (assoc! accum id [(ev/mk-event {:collisions collisions}
@@ -153,6 +114,6 @@
   [height width]
   (fn [state]
     (let [spatial-index (get-in state spatial-index-location)
-          items (rbush-all spatial-index)
+          items (r/rbush-all spatial-index)
           events (collision-events items spatial-index width height)]
       (ev/batch-emit-events state [:collision] events))))


add mailto: link for Support footer

add mailto: link for Support footer

--- src/cljs/org/broadinstitute/firecloud_ui/main.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/main.cljs
@@ -27,6 +27,7 @@
               {:render
                (fn [{:keys [props state]}]
                  [:a {:href (:href props)
+                      :target (:target props)
                       :style {:color (:footer-text style/colors)
                               :textDecoration (when-not (:hovering? @state) "none")}
                       :onMouseOver #(swap! state assoc :hovering? true)
@@ -39,11 +40,11 @@
      [:div {:style {:display "block"}}
       (str "\u00A9 " yeartext " Broad Institute")
       spacer
-      [Link {:href "#" :text "Privacy Policy"}]
+      [Link {:href "#" :text "Privacy Policy" :target "_self"}]
       spacer
-      [Link {:href "#" :text "Terms of Service"}]
+      [Link {:href "#" :text "Terms of Service" :target "_self"}]
       spacer
-      [Link {:href "#" :text "Support"}]]]))
+      [Link {:href "mailto:firecloud-help@broadinstitute.org?Subject=FireCloud%20Help" :text "Support" :target "_blank"}]]]))

 (def top-nav-bar-items


changed key detector to react only to down presses

--- src/clojure/org/turtle/geometry/TurtleGraphics.clj
+++ src/clojure/org/turtle/geometry/TurtleGraphics.clj
@@ -338,39 +338,40 @@
      (reify View$OnKeyListener
        (^boolean onKey [this ^View v ^int key-code ^KeyEvent event]
          ;; false
-         (let [code      (.getKeyCode event)]
-           (if (contains? #{KeyEvent/KEYCODE_DPAD_DOWN
-                            KeyEvent/KEYCODE_DPAD_LEFT
-                            KeyEvent/KEYCODE_DPAD_RIGHT
-                            KeyEvent/KEYCODE_DPAD_UP}
-                          code)
-             (do
-               (update-activity-view-transform
-                activity
-                (condp = code
-                  KeyEvent/KEYCODE_DPAD_DOWN
-                  (make-move-transform 0 -25)
-                  KeyEvent/KEYCODE_DPAD_LEFT
-                  (make-move-transform +25 0)
-                  KeyEvent/KEYCODE_DPAD_RIGHT
-                  (make-move-transform -25 0)
-                  KeyEvent/KEYCODE_DPAD_UP
-                  (make-move-transform 0 +25)
-                  :else
-                  (log "invalid key code: %s (%d)"
-                       (get {KeyEvent/KEYCODE_DPAD_DOWN
-                             "KEYCODE_DPAD_DOWN"
-                             KeyEvent/KEYCODE_DPAD_LEFT
-                             "KEYCODE_DPAD_LEFT"
-                             KeyEvent/KEYCODE_DPAD_RIGHT
-                             "KEYCODE_DPAD_RIGHT"
-                             KeyEvent/KEYCODE_DPAD_UP
-                             "KEYCODE_DPAD_UP"}
-                            code
-                            "UNKNOWN")
-                       code)))
-               true)
-             false)))))))
+         (if (and (= (.getAction event)
+                     KeyEvent/ACTION_DOWN)
+                  (contains? #{KeyEvent/KEYCODE_DPAD_DOWN
+                               KeyEvent/KEYCODE_DPAD_LEFT
+                               KeyEvent/KEYCODE_DPAD_RIGHT
+                               KeyEvent/KEYCODE_DPAD_UP}
+                             key-code))
+           (do
+             (update-activity-view-transform
+              activity
+              (condp = key-code
+                KeyEvent/KEYCODE_DPAD_DOWN
+                (make-move-transform 0 -25)
+                KeyEvent/KEYCODE_DPAD_LEFT
+                (make-move-transform +25 0)
+                KeyEvent/KEYCODE_DPAD_RIGHT
+                (make-move-transform -25 0)
+                KeyEvent/KEYCODE_DPAD_UP
+                (make-move-transform 0 +25)
+                :else
+                (log "invalid key code: %s (%d)"
+                     (get {KeyEvent/KEYCODE_DPAD_DOWN
+                           "KEYCODE_DPAD_DOWN"
+                           KeyEvent/KEYCODE_DPAD_LEFT
+                           "KEYCODE_DPAD_LEFT"
+                           KeyEvent/KEYCODE_DPAD_RIGHT
+                           "KEYCODE_DPAD_RIGHT"
+                           KeyEvent/KEYCODE_DPAD_UP
+                           "KEYCODE_DPAD_UP"}
+                          key-code
+                          "UNKNOWN")
+                     key-code)))
+             true)
+           false))))))


admin? has to be passed into the artifacts-node as part of its data (*not opts*) if we want the component to be re-rendered on the data updating.

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -230,7 +230,7 @@
                {})
        :children))

-(defn artifacts-node [artifacts owner {:keys [show-node-indices? admin?] :as opts}]
+(defn artifacts-node [{:keys [artifacts admin?] :as data} owner {:keys [show-node-indices?] :as opts}]
   (reify
     om/IRender
     (render [_]
@@ -246,8 +246,8 @@
                                :else              part)
                    url        (:url artifact)
                    tag        (if (and url (not admin?)) ; Be extra careful about XSS of admins
-                                [:a {:href (:url artifact) :target "_blank"} text]
-                                [:span text])
+                                [:a.artifact-link {:href (:url artifact) :target "_blank"} text]
+                                [:span.artifact-directory-text text])
                    key        (keyword (str "index-" idx))
                    closed?    (or
                                (:ancestors-closed? opts)
@@ -267,7 +267,8 @@
                   tag)
                 [:div {:style (when closed? {:display "none"})}
                  (om/build artifacts-node
-                           children
+                           {:artifacts children
+                            :admin? admin?}
                            {:opts (assoc opts
                                     :ancestors-closed? (or (:ancestors-closed? opts) closed?))})]]))
            (sort-by first artifacts))])))))
@@ -287,7 +288,8 @@
             (artifacts-ad)
             (if-not artifacts
               [:div.loading-spinner common/spinner]
-              (om/build artifacts-node (artifacts-tree artifacts) {:opts node-opts})))])))))
+              (om/build artifacts-node {:artifacts (artifacts-tree artifacts)
+                                        :admin? (:admin (:user data))} {:opts node-opts})))])))))

 (defn tests-ad [owner]
   [:div


Fix catenation of keyword names

Fix catenation of keyword names

--- src/main/cljc/clojure_club/rpg_spec/mgrimm.cljc
+++ src/main/cljc/clojure_club/rpg_spec/mgrimm.cljc
@@ -39,7 +39,8 @@
 (s/def ::wis ::trait)
 (s/def ::con ::trait)
 (s/def ::traits (s/keys :req [::str ::dex ::int ::cha ::wis ::con]))
-(s/def ::name (s/with-gen string?  #(s/gen (into #{} (apply map str (vals (rand-nth (seq names))))))))
+(s/def ::name (s/with-gen string?
+                #(s/gen (into #{} (apply map (fn [p s] (str (name p) (name s))) (vals (rand-nth (seq names))))))))

 (s/def ::gender #{:male :female})
 (s/def ::race #{:dwarf :elf :gnome :half-elf :half-orc :halfling :human})


Support metadata in TestCase and TestGroup constructors

--- src/main/clojure/lazytest/group.clj
+++ src/main/clojure/lazytest/group.clj
@@ -21,9 +21,11 @@
 		    (apply f (map setup fixtures))
 		    (dorun (map teardown fixtures))))))))

-(defn test-case [fixtures f]
-  {:pre [(every? fixture? fixtures) (fn? f)]}
-  (TestCase. fixtures f))
+(defn test-case
+  ([fixtures f] (test-case fixtures f nil))
+  ([fixtures f metadata]
+     {:pre [(every? fixture? fixtures) (fn? f)]}
+     (TestCase. fixtures f metadata nil)))

 (defrecord TestGroup [children]
   Testable
@@ -33,6 +35,8 @@
 	     (or (skip-or-pending this)
 		 (result-group this (lazy-seq (mapcat run-tests children))))))

-(defn test-group [children]
-  {:pre [(every? (runnable-test? children))]}
-  (TestGroup. children))+(defn test-group
+  ([children] (test-group children nil))
+  ([children metadata]
+     {:pre [(every? (runnable-test? children))]}
+     (TestGroup. children metadata nil)))


STORM-166: fixing a bug where the leader lock was not queued due to incorrect latch state being used

--- storm-core/src/clj/backtype/storm/zookeeper.clj
+++ storm-core/src/clj/backtype/storm/zookeeper.clj
@@ -233,7 +233,7 @@
         STORMS-ROOT (str (conf STORM-ZOOKEEPER-ROOT) "/storms")]
     (reify LeaderLatchListener
       (^void isLeader[this]
-        (log-message (str hostname "gained leadership, checking if it has all the topology code locally."))
+        (log-message (str hostname " gained leadership, checking if it has all the topology code locally."))
         (let [active-topology-ids (set (get-children zk STORMS-ROOT false))
               local-topology-ids (set (.list (File. (master-stormdist-root conf))))
               diff-topology (first (set-delta active-topology-ids local-topology-ids))]
@@ -241,9 +241,9 @@
                           "] local-topology-ids [" (clojure.string/join "," local-topology-ids)
                           "] diff-topology [" (clojure.string/join "," diff-topology) "]")
         (if (empty? diff-topology)
-          (log-message " Accepting leadership, all active topology found localy.")
+          (log-message "Accepting leadership, all active topology found localy.")
           (do
-            (log-message " code for all active topologies not available locally, giving up leadership.")
+            (log-message "code for all active topologies not available locally, giving up leadership.")
             (.close leader-latch)))))
       (^void notLeader[this]
         (log-message (str hostname " lost leadership."))))))
@@ -263,9 +263,8 @@
         (log-message "no-op for zookeeper implementation"))

       (^void addToLeaderLockQueue [this]
-        (let [state (.getState @leader-latch)]
         ;if this latch is already closed, we need to create new instance.
-        (if (.equals LeaderLatch$State/CLOSED state)
+        (if (.equals LeaderLatch$State/CLOSED (.getState @leader-latch))
           (do
             (reset! leader-latch (LeaderLatch. zk leader-lock-path id))
             (reset! leader-latch-listener (leader-latch-listener-impl conf zk @leader-latch))
@@ -273,12 +272,12 @@
             ))

         ;Only if the latch is not already started we invoke start.
-        (if (.equals LeaderLatch$State/LATENT state)
+        (if (.equals LeaderLatch$State/LATENT (.getState @leader-latch))
           (do
             (.addListener @leader-latch @leader-latch-listener)
             (.start @leader-latch)
             (log-message "Queued up for leader lock."))
-          (log-message "Node already in queue for leader lock."))))
+          (log-message "Node already in queue for leader lock.")))

       (^void removeFromLeaderLockQueue [this]
         ;Only started latches can be closed.


Turn a string literal into a docstring

Turn a string literal into a docstring

--- src/atom_finder/util/10_clj_util.clj
+++ src/atom_finder/util/10_clj_util.clj
@@ -176,8 +176,8 @@
           ret#))

 (defmacro doto-class
+  "Calls a series of static methods on a class"
   [klass & forms]
-  "Calls a series of static methods on a class"
   (cons 'do
         (for [f forms]
           `(. ~klass ~f))))


get txn

get txn

--- src/block_chain/message_handlers.clj
+++ src/block_chain/message_handlers.clj
@@ -57,6 +57,11 @@
    :payload (bc/block-by-hash (:payload msg)
                               @db/block-chain)})

+(defn get-transaction [msg sock-info]
+  {:message-type "transaction_info"
+   :payload (bc/txn-by-hash (:payload msg)
+                              @db/block-chain)})
+
 (def message-handlers
   {"echo" echo
    "ping" pong
@@ -69,6 +74,7 @@
    "get_transaction_pool" get-transaction-pool
    "get_blocks" get-blocks
    "get_block" get-block
+   "get_transaction" get-transaction
    "add_transaction" add-transaction})

 (defn handler [msg sock-info]


log recover

log recover

--- src/clj/neb/durability/serv/logs.clj
+++ src/clj/neb/durability/serv/logs.clj
@@ -1,5 +1,6 @@
 (ns neb.durability.serv.logs
   (:require [neb.durability.serv.file-reader :refer [read-bytes]]
+            [neb.core :refer [new-cell-by-raw* delete-cell*]]
             [clojure.java.io :as io])
   (:import (com.google.common.primitives Ints Longs)
            (java.io OutputStream)
@@ -33,4 +34,13 @@
                           (reset! body-read? true)
                           (read-bytes reader body-length)))]
         (process-fn act timestamp cell-id read-body)
-        (if (and has-body? (not @body-read?)) (.skip reader body-length))))))+        (if (and has-body? (not @body-read?)) (.skip reader body-length))))))
+
+(defn recover [file-path trunk-timestamp]
+  (read-all-from-log
+    file-path
+    (fn [act timestamp cell-id read-body]
+      (when (> timestamp trunk-timestamp)
+        (case act
+          0 (new-cell-by-raw* cell-id (read-body))
+          1 (delete-cell* cell-id))))))


minor fixes

minor fixes

--- src/clj_highlight/syntax/clojure.clj
+++ src/clj_highlight/syntax/clojure.clj
@@ -14,7 +14,7 @@
 			   (let [[prefix precision] p
 				 precision (Integer/parseInt precision)
 				 number-re (re-pattern (str "^" prefix "[" (subs didgets 0 precision) "]++"))]
-			     (if-let [num (re-find number-re)]
+			     (if-let [num (re-find number-re s)]
 			       num
 			       nil))
 			   (if-let [num (re-find #"^\d+(?:(?:/\d+)|(?:(?:\.\d*)?(?:e[+-]\d+)?))" s)]


[REFACTOR] Use `timetable-get-day-row` to replace some code

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -652,7 +652,7 @@
    the one on the row closest to that time.
    If such a `TimetableLessonInfo` object does not exist, returns nil."
   [day rowNum timeIdx]
-  (let [ttRow (get-in TIMETABLE [day rowNum])]
+  (let [ttRow (timetable-get-day-row day rowNum)]
     (reduce (fn [ttLessonInfoBefore [ttLessonInfo _]]
               (let [endTime   (:endTime ttLessonInfo)]
                 (cond (and (nil? ttLessonInfoBefore)
@@ -673,7 +673,7 @@
    is the one on the row closest to that time.
    If such a `TimetableLessonInfo` object does not exist, returns nil."
   [day rowNum timeIdx]
-  (let [ttRow (get-in TIMETABLE [day rowNum])]
+  (let [ttRow (timetable-get-day-row day rowNum)]
     (reduce (fn [ttLessonInfoAfter [ttLessonInfo _]]
               (let [startTime (:startTime ttLessonInfo)]
                 (cond (and (nil? ttLessonInfoAfter)


remove unecessary print

remove unecessary print

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -33,9 +33,6 @@
  (fn [db]
    (reaction (:order-prop @db))))

-<<<<<<< HEAD
-(re-frame/register-handler
-=======
 (re-frame/register-subs
  :phone-query
  (fn [db [_ phone-id]]
@@ -43,7 +40,6 @@
      (reaction ((keyword phone-id) @phone-details-reaction)))))

 (re-frame/register-pure-handler
->>>>>>> dff3fe5... add back handlers for loading individual phone data
  :process-phones-response
  (fn
    [app-state [_ response]]


add json rendering

add json rendering

--- rest-media-demo/src/rest_media_demo/handler.clj
+++ rest-media-demo/src/rest_media_demo/handler.clj
@@ -12,6 +12,10 @@
   ["application/json"
    "text/plain"
    "text/html"])
+
+(defmethod render-map-generic "application/json" [data context]
+  (json/write str (conj (:links data) (:properties data) )))
+
 (defroutes app-routes
   (GET "/" [] "Hello World")
   (route/not-found "Not Found"))


manuall merge utf fix

manuall merge utf fix

--- src/clj/collect_earth_online/db/projects.clj
+++ src/clj/collect_earth_online/db/projects.clj
@@ -409,8 +409,8 @@
   (sh-wrapper folder-name {} (str "7z e -y " ext-file " -o" design-type))
   (let [[info body-text _] (-> (sh-wrapper-stdout (str folder-name design-type)
                                                   {}
-                                                  (format-simple "shp2pgsql -s 4326 -t 2D -D %1"
-                                                                 (find-file-by-ext (str folder-name design-type) "shp")))
+                                                  (str "shp2pgsql -s 4326 -t 2D -D "
+                                                       (find-file-by-ext (str folder-name design-type) "shp")))
                                (str/split #"stdin;\n|\n\\\."))
         geom-key    (keyword (str design-type "_geom"))
         header-keys (as-> info i
@@ -445,6 +445,7 @@
                         (str/split hr #",")
                         (mapv #(-> %
                                    (str/lower-case)
+                                   (str/replace "\uFEFF" "")
                                    (str/replace #"-| " "_")
                                    (str/replace #"^(x|longitude|long|center_x)$" "lon")
                                    (str/replace #"^(y|latitude|center_y)$" "lat")
@@ -476,7 +477,9 @@
                          (str "'" h "'"))
                        " are missing.")))
     (when invalid-headers
-      (init-throw (str "One or more headers contains invalid characters: " (str/join ", " invalid-headers))))))
+      (init-throw (str "One or more headers contains invalid characters: '"
+                       (str/join "', '" (map #(-> % name str/upper-case) invalid-headers))
+                       "'")))))

 (defn- load-external-data! [project-id distribution file-name file-base64 design-type primary-key]
   (when (#{"csv" "shp"} distribution)


unwrap BatchUpdateException

unwrap BatchUpdateException

--- src/clj_money/models/storage/sql_storage.clj
+++ src/clj_money/models/storage/sql_storage.clj
@@ -7,7 +7,8 @@
             [clj-time.coerce :as tc]
             [honeysql.core :as sql]
             [honeysql.helpers :as h]
-            [clj-money.models.storage :refer [Storage]]))
+            [clj-money.models.storage :refer [Storage]])
+  (:import java.sql.BatchUpdateException))

 (defn- exists?
   [db-spec table where]
@@ -237,14 +238,18 @@
           first
           ->clojure-keys)))

-(update-transaction-item
-  [_ transaction-item]
-  (let [sql (sql/format (-> (h/update :transaction_items)
-                            (h/sset (->sql-keys (select-keys transaction-item
-                                                             [:amount
-                                                              :action
-                                                              :index
-                                                              :balance
-                                                              :account-id])))
-                            (h/where [:= :id (:id transaction-item)])))]
-    (jdbc/execute! db-spec sql))))
+  (update-transaction-item
+    [_ transaction-item]
+    (let [sql (sql/format (-> (h/update :transaction_items)
+                              (h/sset (->sql-keys (select-keys transaction-item
+                                                              [:amount
+                                                               :action
+                                                               :index
+                                                               :balance
+                                                               :account-id])))
+                              (h/where [:= :id (:id transaction-item)])))]
+      (try
+        (jdbc/execute! db-spec sql)
+        (catch BatchUpdateException e
+          (pprint {:sql sql
+                   :batch-update-exception (.getNextException e)}))))))


Changed printing of test cases to true for Word Stats

--- src/clojush/problems/software/word_stats.clj
+++ src/clojush/problems/software/word_stats.clj
@@ -190,7 +190,7 @@
   (let [[train-cases test-cases] (map #(sort-by (comp count first) %)
                                       (map word-stats-test-cases
                                            (test-and-train-data-from-domains data-domains)))]
-    (when false ;; Change to false to not print test cases
+    (when true ;; Change to false to not print test cases
       (doseq [[i case] (map vector (range) train-cases)]
         (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
       (doseq [[i case] (map vector (range) test-cases)]


Setting initial concept number to use that is larger than the biggest id generated by Catalog REST currently.

--- src/cmr/metadata_db/data/oracle/concepts.clj
+++ src/cmr/metadata_db/data/oracle/concepts.clj
@@ -25,8 +25,10 @@
            oracle.sql.TIMESTAMPTZ))

 (def INITIAL_CONCEPT_NUM
-  "The number to use as the numeric value for the first concept."
-  1000000000)
+  "The number to use as the numeric value for the first concept. Chosen to be larger than the current
+  largest sequence in Catalog REST in operations which is 1005488460 as of this writing."
+  1200000000)
+

 (def EXPIRED_CONCEPTS_BATCH_SIZE
   "The batch size to retrieve expired concepts"


changed ordering of articles to descending by date

--- src/blog/article/article_sql_datastore_impl.clj
+++ src/blog/article/article_sql_datastore_impl.clj
@@ -53,7 +53,7 @@
 (defn select-article-page [{:keys [db articles-per-page]} page-num]
   (jdbc/query db [(str "SELECT name, body "
                        "FROM article "
-                       "ORDER BY date "
+                       "ORDER BY date DESC "
                        "LIMIT ? "
                        "OFFSET ?")
                   articles-per-page
@@ -83,7 +83,7 @@
   (jdbc/query db [(str "SELECT name, body "
                        "FROM article "
                        "WHERE MONTH(date) = ? AND YEAR(date) = ? "
-                       "ORDER BY date "
+                       "ORDER BY date DESC "
                        "LIMIT ? "
                        "OFFSET ?")
                   month
@@ -132,7 +132,7 @@
 (defn select-recent-articles [{db :db recent-articles :recent-articles}]
   (jdbc/query db [(str "SELECT name "
                        "FROM article "
-                       "ORDER BY date "
+                       "ORDER BY date DESC "
                        "LIMIT ?")
                   recent-articles]
               :row-fn (comp helpers/parse-article-code :name)))
@@ -144,7 +144,7 @@
 (defn select-archive-months [{db :db}]
   (jdbc/query db [(str "SELECT DISTINCT MONTH(date), YEAR(date), date "
                        "FROM article "
-                       "ORDER BY date")]
+                       "ORDER BY date DESC")]
               :row-fn parse-article-date))

 (defn sidebar [this]


Send templates

Send templates

--- src/cider_ci/dispatcher/dispatch/build_data.clj
+++ src/cider_ci/dispatcher/dispatch/build_data.clj
@@ -4,6 +4,7 @@

 (ns cider-ci.dispatcher.dispatch.build-data
   (:require
+    [cider-ci.utils.map :refer [convert-to-array]]
     [cider-ci.dispatcher.task :as task]
     [cider-ci.utils.http :as http]
     [cider-ci.utils.rdbms :as rdbms]
@@ -42,6 +43,13 @@
         {:git_path (git-path repository-id)
          :git_url (git-url repository-id) }))

+
+;### templates ################################################################
+
+(defn- templates-data [task-spec]
+  (if-let [templates (:templates task-spec)]
+    (-> templates convert-to-array)
+    []))

 ;### dispatch data ############################################################

@@ -82,6 +90,7 @@
               :repository_id repository-id
               :scripts (:scripts trial)
               :task_id (:task_id trial)
+              :templates (templates-data task-spec)
               :tree-attachments (:tree-attachments task-spec)
               :tree-attachments-path (tree-attachments-path tree-id)
               :trial-attachments (:trial-attachments task-spec)
@@ -91,4 +100,7 @@
     (-> data
         (add-git-url repository-id))))

-
+;#### debug ###################################################################
+;(logging-config/set-logger! :level :debug)
+;(logging-config/set-logger! :level :info)
+;(debug/debug-ns *ns*)


Adjusted handler for concept approximation exploration to new semantics

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

--- src/conexp/contrib/concept_approximation.clj
+++ src/conexp/contrib/concept_approximation.clj
@@ -16,16 +16,13 @@
 (defn- apprx-handler
   "Special handler for concept approximation exploration."
   [ctx new-impl new-objs new-handler]
-  (let [[result new-col] (default-handler ctx new-impl)]
-    (if result
-      [result new-col]
-      (let [new-att  (first new-col),
-            att-objs (ask (str "Which of the objs " new-objs " definitively has the attribute " new-att "? ")
-                          #(read-string (str "#{" (read-line) "}"))
-                          #(subset? % new-objs)
-                          "Please enter only objects mentioned: ")]
-        (new-handler (map #(vector % new-att) att-objs))
-        [result new-col]))))
+  (when-let [[new-att new-att-objs] (default-handler ctx new-impl)]
+    (let [att-objs (ask (str "Which of the objs " new-objs " definitively has the attribute " new-att "? ")
+                        #(read-string (str "#{" (read-line) "}"))
+                        #(subset? % new-objs)
+                        "Please enter only objects mentioned: ")]
+      (new-handler (map #(vector % new-att) att-objs))
+      [new-att new-att-objs])))

 (defn explore-approximations
   "Performs concept approximation exploration and returns the final


Start to experiment with differen queue implementations.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -13,7 +13,7 @@
   (:require [dsbdp.data-processing-dsl :refer :all])
   (:import
     (dsbdp LocalTransferContainer ProcessingLoop)
-    (java.util.concurrent ArrayBlockingQueue BlockingQueue LinkedTransferQueue)))
+    (java.util.concurrent ArrayBlockingQueue BlockingQueue LinkedTransferQueue TransferQueue)))

@@ -21,10 +21,23 @@

+(defmacro create-queue
+  []
+  `(LinkedTransferQueue.))
+;  `(ArrayBlockingQueue. *queue-size*))
+
+(defn enqueue
+  [^TransferQueue queue data]
+;  [^BlockingQueue queue data]
+;  (.offer queue data))
+  (.tryTransfer queue data))
+
+
+
 (defn create-local-processing-element
   [^BlockingQueue in-queue f]
   (let [running (atom true)
-        out-queue (LinkedTransferQueue.)
+        out-queue (create-queue)
         proc-loop (ProcessingLoop.
                     (fn []
                       (try
@@ -32,7 +45,7 @@
                               new-out (f (.getIn c) (.getOut c))]
                           (if (not (nil? new-out))
                             (.setOut c new-out))
-                          (.put out-queue c))
+                          (enqueue out-queue c))
                         (catch InterruptedException e
                           (if @running
                             (throw e))))))]
@@ -55,7 +68,7 @@
 (defn create-local-processing-pipeline
   [fns out-fn]
   (let [running (atom true)
-        in-queue (LinkedTransferQueue.)
+        in-queue (create-queue)
         proc-elements (reduce
                         (fn [v f]
                           (conj v (create-local-processing-element (get-out-queue (last v)) f)))
@@ -79,7 +92,7 @@
                     (interrupt pe))
                   (.interrupt out-proc-loop))
      :in-fn (fn [in]
-              (.put in-queue (LocalTransferContainer. in nil)))}))
+              (enqueue in-queue (LocalTransferContainer. in nil)))}))

 (defn get-in-fn
   [obj]


Bump ClojureScript and boot-reload

Bump ClojureScript and boot-reload

--- resources/leiningen/new/lambone/common/build.boot
+++ resources/leiningen/new/lambone/common/build.boot
@@ -29,7 +29,7 @@
                           [adzerk/boot-test "1.1.1" :scope "test"]]))
 <% endif %><% if not all backend frontend %>
 (def backend-deps '[[org.clojure/clojure "1.8.0" :scope "provided"]
-                    [org.clojure/tools.namespace "0.2.10"]
+                    [org.clojure/tools.namespace "0.3.0-alpha3"]
                     [org.clojure/tools.reader "0.10.0"]
                     [org.clojure/tools.cli "0.3.3"]
                     [org.clojure/tools.logging "0.3.1"]
@@ -51,11 +51,11 @@
 ;; All the deps are "test" because they are only need for compiling to
 ;; JavaScript, not "real" project dependencies.
 (def frontend-deps (into common-deps
-                         '[[org.clojure/clojurescript "1.8.51" :scope "test"]
-                           [adzerk/cljs-console "0.1.1" :exclusions [adzerk/env] :scope "test"]
+                         '[[org.clojure/clojurescript "1.9.76" :scope "test"]
+                           [adzerk/cljs-console "0.1.1" :scope "test" :exclusions [adzerk/env]]
                            ;; dev only
                            [adzerk/boot-cljs "1.7.228-1" :scope "test"]
-                           [adzerk/boot-reload "0.4.9" :scope "test"]
+                           [adzerk/boot-reload "0.4.12" :scope "test"]
                            [deraen/boot-sass "0.2.1" :scope "test"]
                            [crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT" :scope "test"]
                            [org.slf4j/slf4j-nop "1.7.21" :scope "test"]


Improve CSS on columns.

Improve CSS on columns.

--- src-cljs/kixi/hecuba/tabs/hierarchy/datasets.cljs
+++ src-cljs/kixi/hecuba/tabs/hierarchy/datasets.cljs
@@ -208,7 +208,7 @@
   [:div
    (for [member members]
      (let [[type device_id] (string/split member #"-")]
-       [:div.col-md-7
+       [:div.row {:style {:min-height "100%"}}
         [:div.col-md-3 type]
         [:div.col-md-4 device_id]]))])


reverted to previous reduce attempt

reverted to previous reduce attempt

--- src/clj_hypergraph_db/model_parsing_functions.clj
+++ src/clj_hypergraph_db/model_parsing_functions.clj
@@ -70,12 +70,12 @@
     ;(info (def-attribute :Abstract))
     ;(map #(println (str %)) (read-string
     (info
-          (map
+          (reduce
             (fn
               [token]
               (clojure.string/replace text (str token) (str "clj_hypergraph_db.model_parsing_functions/" token)))
-            file))
-           ; (remove #{'parse} (keys (ns-publics 'clj_hypergraph_db.model_parsing_functions)))))
+            file
+           (remove #{'parse} (keys (ns-publics 'clj_hypergraph_db.model_parsing_functions)))))


rhythm reading exercise

rhythm reading exercise

--- src/cljs/daveconservatoire/site/ui/exercises.cljs
+++ src/cljs/daveconservatoire/site/ui/exercises.cljs
@@ -5,6 +5,7 @@
             [untangled.client.mutations :as um]
             [cljs.spec :as s]
             [daveconservatoire.audio.core :as audio]
+            [daveconservatoire.site.ui.vexflow :as vf]
             [daveconservatoire.site.ui.util :as u]))

 (defprotocol IExercise
@@ -63,14 +64,22 @@
   :args (s/cat :props (s/keys :opt [::progress-total ::progress-value]))
   :ret ::react-component)

+(defn prepare-notes [notes]
+  (->> notes
+       (into [] (map (fn [s]
+                       (let [[note duration] (if (vector? s) s [s 2])]
+                         {::audio/node-gen (->> note audio/semitone->note (get @audio/*sound-library*))
+                          ::audio/duration duration}))))))
+
 (defn play-notes [notes]
-  (let [nodes (->> notes
-                   (into [] (map (fn [s]
-                                   {::audio/node-gen (->> s audio/semitone->note (get @audio/*sound-library*))}))))]
-    (audio/play-regular-sequence nodes {::audio/time     (audio/current-time)
-                                        ::audio/interval 2})))
-
-(defn play-sound [c] (play-notes (-> (om/props c) ::notes)))
+  (let [nodes (prepare-notes notes)]
+    (audio/play-sequence nodes {::audio/time (audio/current-time)})))
+
+(defn play-fn [props] (get props ::play-notes play-notes))
+
+(defn play-sound [c]
+  (let [play (or (-> (om/props c) ::play-notes) play-notes)]
+    (play (-> (om/props c) ::notes))))

 (om/defui UserScore
   static om/IQuery
@@ -83,7 +92,7 @@
   [{:keys [state ref]} _ _]
   {:action
    (fn []
-     (let [{:keys [::ex-answer ::correct-answer ::streak-count ::class ::ex-total-questions] :as props} (get-in @state ref)]
+     (let [{:keys [::ex-answer ::correct-answer ::streak-count ::class] :as props} (get-in @state ref)]
        (if (= ex-answer correct-answer)
          (let [next-streak (inc streak-count)
                new-props (new-round class
@@ -91,7 +100,7 @@
                              {::streak-count next-streak
                               ::ex-answer    nil}))]
            (swap! state assoc-in ref new-props)
-           (play-notes (::notes new-props)))
+           ((play-fn new-props) (::notes new-props)))
          (swap! state update-in ref assoc ::streak-count 0))))

    :remote
@@ -309,8 +318,8 @@
     (new-round this
       (merge
         (uc/initial-state Exercise nil)
-        {::name        "reading-music"
-         ::options     ::option-type-text}
+        {::name    "reading-music"
+         ::options ::option-type-text}
         props)))

   static om/Ident
@@ -350,8 +359,8 @@
     (new-round this
       (merge
         (uc/initial-state Exercise nil)
-        {::name        "rhythm-math"
-         ::options     ::option-type-text}
+        {::name    "rhythm-math"
+         ::options ::option-type-text}
         props)))

   static om/Ident
@@ -382,6 +391,82 @@
             (dom/span #js {:key i}
               (dom/img #js {:src (str "/img/rhythmimages/" note ".jpg")}))))))))

+(def rhythm-combinations
+  [["w"]
+   ["h" "h"]
+   ["h" "q" "q"]
+   ["q" "h" "q"]
+   ["q" "q" "h"]
+   ["q" "q" "q" "q"]])
+
+(defn duration->seconds
+  ([v] (duration->seconds v 4))
+  ([v whole]
+   (case v
+     "w" (* whole 1)
+     "h" (* whole 0.5)
+     "q" (* whole 0.25))))
+
+(defn to-note [duration] {::vf/keys ["b/4"] ::vf/duration duration})
+
+(defn random-rhythm []
+  (->> (rand-nth rhythm-combinations)
+       (map to-note)))
+
+(defn random-bars [] (repeatedly #(hash-map ::vf/notes (random-rhythm))))
+
+(def rhytm-metronome (flatten1 (repeat 5 [["high" 1] ["low" 1] ["low" 1] ["low" 1]])))
+
+(om/defui ^:once RhythmReading
+  static uc/InitialAppState
+  (initial-state [this props]
+    (new-round this
+      (merge
+        (uc/initial-state Exercise nil)
+        {::name       "rhythm-reading"
+         ::options    [["0" "A"] ["1" "B"] ["2" "C"] ["3" "D"]]
+         ::play-notes (let [last-play (atom [])]
+                        (fn [notes]
+                          (let [time (audio/current-time)
+                                nodes (prepare-notes notes)
+                                metro (prepare-notes rhytm-metronome)]
+                            (audio/stop-all @last-play)
+                            (reset! last-play (concat (audio/play-sequence metro {::audio/time time})
+                                                      (audio/play-sequence nodes {::audio/time (+ time 4)}))))))}
+        props)))
+
+  static om/Ident
+  (ident [_ props] [:exercise/by-name (::name props)])
+
+  static om/IQuery
+  (query [_] '[*])
+
+  static IExercise
+  (new-round [_ props]
+    (let [rhytms (partition 4 (take 16 (random-bars)))
+          idx (rand-int 4)
+          notes (->> (nth rhytms idx)
+                     (map ::vf/notes)
+                     (flatten)
+                     (map (comp #(vector "B4" %)
+                                duration->seconds
+                                ::vf/duration)))]
+      (js/console.log "notes" notes)
+      (assoc props
+        ::rhytms rhytms
+        ::notes notes
+        ::correct-answer (str idx))))
+
+  Object
+  (render [this]
+    (let [{:keys [::rhytms] :as props} (om/props this)]
+      (exercise props
+        (dom/p #js {:key "p"} "Listen the sound clip and choose the correct rhythm. You will hear a metronome count in and then the piano will play the rhythm over this.")
+        (dom/div #js {:key "scores"}
+          (for [[i bars] (map vector (range) rhytms)]
+            (vf/score #::vf {:width 500 :height 110 :clef ::vf/treble :key i
+                             :bars  bars})))))))
+
 (def INTERVAL-NAMES
   {2  "Major 2nd"
    4  "Major 3rd"
@@ -467,6 +552,11 @@
    ::class RhythmMath
    ::props {}})

+(defmethod slug->exercise "rhythm-reading" [name]
+  {::name  name
+   ::class RhythmReading
+   ::props {}})
+
 (defmethod slug->exercise "intervals-1" [name]
   {::name  name
    ::class Intervals


language from brad

language from brad

--- src/cljs/main/broadfcui/common/notifications.cljs
+++ src/cljs/main/broadfcui/common/notifications.cljs
@@ -297,7 +297,7 @@
                            :text-align "center"
                            :font-weight "500"}}
             (if (common/has-terra-return?)
-              "Placeholder: Terra terra terra woooo! Under construction"
+              "This page is displaying in our legacy application. Please bear with us as we migrate these features fully into Terra"
               [:span {}
                "On May 1st FireCloud will get a new look as it becomes "
                [:a {:href "https://software.broadinstitute.org/firecloud/blog?id=23627"


carry-schema: remove provided scope from some deps

--- contrib/schema/project.clj
+++ contrib/schema/project.clj
@@ -1,5 +1,5 @@
 (defproject
-  carry-schema "0.1.0"
+  carry-schema "0.2.0"
   :description "Carry middleware for model validation using Schema."
   :url "https://github.com/metametadata/carry/tree/master/contrib/schema"
   :license {:name "MIT" :url "http://opensource.org/licenses/MIT"}
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                  [org.clojure/clojurescript "1.8.51" :scope "provided"]

-                 [prismatic/schema "1.1.0" :scope "provided"]]
+                 [prismatic/schema "1.1.0"]]

   :pedantic? :abort


Make the information sharing screen usable on tiny screens.

e.g. an iPhone app on an iPad
This doesn't make it *pretty*, just usable.

--- src/status_im/ui/screens/usage_data/styles.cljs
+++ src/status_im/ui/screens/usage_data/styles.cljs
@@ -11,14 +11,16 @@

 (def usage-data-view
   {:flex               1
+   :margin-top         (scaled-y 90)
    :background-color   colors/white
    :align-items        :center})

 (def image-container
   {:flex            1
+   ;; on screens less tall than iPhone 5, let's not show the image at all
+   :display (if (>= window-height 568) "flex" "none")
    :align-items     :center
    :justify-content :center
-   :margin-top    (scaled-y 90)
    :margin-bottom (scaled-y 90)})

 (def usage-data-image
@@ -68,4 +70,6 @@

 (def dont-share-button
   {:padding-horizontal  18
+   ;; don't do text wrap on super small devices
+   :min-width           130
    :width               (scaled-x 138)})


[#10444] Fix keycard pin changing when card is not tapped

--- src/status_im/hardwallet/common.cljs
+++ src/status_im/hardwallet/common.cljs
@@ -471,10 +471,13 @@
   (let [on-success (or on-success
                        (get-in db [:hardwallet :pin :on-verified]))
         on-failure (or on-failure
-                       (get-in db [:hardwallet :pin :on-verified-failure]))]
+                       (get-in db [:hardwallet :pin :on-verified-failure]))
+        pin-step   (or pin-step
+                       (get-in db [:hardwallet :pin :step]))]
     (fx/merge
      cofx
      {:db (update-in db [:hardwallet :pin] assoc
+                     :step pin-step
                      :on-verified on-success
                      :on-verified-failure on-failure)}
      (show-connection-sheet
@@ -486,5 +489,5 @@
            (fx/merge
             cofx
             {:db                    (assoc-in db [:hardwallet :pin :status] :verifying)
-             :hardwallet/verify-pin {:pin        pin
-                                     :pairing    pairing}})))}))))
+             :hardwallet/verify-pin {:pin     pin
+                                     :pairing pairing}})))}))))


Update Zencoder link (#1806)

Update Zencoder link (#1806)

--- src-cljs/frontend/components/project/common.cljs
+++ src-cljs/frontend/components/project/common.cljs
@@ -181,6 +181,4 @@
       [:blockquote
        [:i
         "The thing that sold us on CircleCI was the speed. Their tests run really really fast. We've never seen that before. One of our developers just pushes to branches so that CircleCI will run his tests, instead of testing on his laptop. The parallelization just works - we didn't have to tweak anything. Amazing service."]]
-      [:ul
-       [:li [:a {:href "http://zencoder.com/company/"} "Brandon Arbini"]]
-       [:li [:a {:href "http://zencoder.com/"} "Zencoder.com"]]]])])
+      [:p "Brandon Arbini, " [:a {:href "https://zencoder.com/en/"} "Zencoder.com"]]])])


add-subscriber and remove-subscriber are not side-effecting

--- support/src/figwheel/plugin/repl_driver.cljs
+++ support/src/figwheel/plugin/repl_driver.cljs
@@ -9,11 +9,11 @@
 (defn has-subscriber? [state subscriber]
   (boolean (some #(= subscriber %) state)))

-(defn add-subscriber! [state subscriber]
+(defn add-subscriber [state subscriber]
   (assert (not (has-subscriber? state subscriber)))
   (conj state subscriber))

-(defn remove-subscriber! [state subscriber]
+(defn remove-subscriber [state subscriber]
   (assert (has-subscriber? state subscriber))
   (remove #(= subscriber %) state))

@@ -33,10 +33,10 @@
 ; -- API available for client use -------------------------------------------------------------------------------------------

 (defn ^:export subscribe [subscriber-callback]
-  (swap! subscribers add-subscriber! subscriber-callback))
+  (swap! subscribers add-subscriber subscriber-callback))

 (defn ^:export unsubscribe [subscriber-callback]
-  (swap! subscribers remove-subscriber! subscriber-callback))
+  (swap! subscribers remove-subscriber subscriber-callback))

 (defn ^:export is-socket-connected []
   (socket/connected?))


Code refactoring and rescale y range slightly beyond range of input data.

--- metlog-vault/src-client/metlog.cljs
+++ metlog-vault/src-client/metlog.cljs
@@ -49,6 +49,11 @@
     {:max (apply Math/max ts)
      :min (apply Math/min ts)}))

+(defn rescale-range [ range factor ]
+  (let [ scaled-delta (* (/ (- factor 1) 2) (- (:max range) (:min range) )) ]
+    {:max (+ (:max range) scaled-delta)
+     :min (- (:min range) scaled-delta)}))
+
 (defn range-scale [ range val ]
   (/ (- val (:min range))
      (- (:max range) (:min range))))
@@ -66,26 +71,32 @@
 (def dtf-axis-label (time-format/formatter "MM-dd HH"))

 (def dtf-header (time-format/formatter "yyyy-MM-dd HH:mm"))
+
+(defn translate-point [ pt x-range y-range w h ]
+  [(* w (range-scale x-range (:t pt)))
+   (- h (* h (range-scale y-range (:val pt))))])
+
+(defn move-to [ ctx [ x y ] ] (.moveTo ctx x y))
+(defn line-to [ ctx [ x y ] ] (.lineTo ctx x y))
+
+(defn clip-rect [ ctx x y w h ]
+  (.beginPath ctx)
+  (.rect ctx x y w h)
+  (.clip ctx))

 (defn draw-tsplot-series [ ctx w h data ]
   (with-preserved-ctx ctx
     (aset ctx "strokeStyle" "#0000FF")
     (aset ctx "font" "12px Arial")
     (let [x-range (s-xrange data)
-          y-range (s-yrange data)]
+          y-range (rescale-range (s-yrange data) 1.2)]
       (when (> (count data) 0)
         (with-preserved-ctx ctx
+          (clip-rect ctx 0 0 w h)
           (.beginPath ctx)
-          (.rect ctx 0 0 w h)
-          (.clip ctx)
-          (.beginPath ctx)
-          (.moveTo ctx
-                   (* w (range-scale x-range (:t (first data))))
-                   (- h (* h (range-scale y-range (:val (first data))))))
+          (move-to ctx (translate-point (first data) x-range y-range w h))
           (doseq [ pt (rest data) ]
-            (.lineTo ctx
-                     (* w (range-scale x-range (:t pt)))
-                     (- h (* h (range-scale y-range (:val pt))))))
+            (line-to ctx (translate-point pt x-range y-range w h)))
           (.stroke ctx))
         (draw-tsplot-ylabel ctx (.toFixed (:max y-range) 2) -2 8)
         (draw-tsplot-ylabel ctx (.toFixed (:min y-range) 2) -2 (- h 8))


Asteroids can now be destroyed when hit.

--- Clojure/clojuroids.clj
+++ Clojure/clojuroids.clj
@@ -114,6 +114,31 @@
         :yv (* (:yv thing) eff)
         :av (* (:av thing) eff)))

+(defn rotate [x y a] [
+    (+ (* (Math/cos a) x) (* (Math/sin a) y))
+    (+ (* (- (Math/sin a)) x) (* (Math/cos a) y))])
+
+(defn collided? [bullet asteroid]
+    (let [
+        [x y] (rotate
+            (- (:x bullet) (:x asteroid))
+            (- (:y bullet) (:y asteroid))
+            (:a asteroid))
+        p (asteroid-shape (:radii asteroid))]
+        (.contains p x y)))
+
+(defn filter-collisions [bullets asteroids]
+    [
+        (filter
+            (fn [b] (nil? (some
+                (fn [a] (collided? b a))
+                asteroids)))
+            bullets)
+        (filter
+            (fn [a] (nil? (some
+                (fn [b] (collided? b a))
+                bullets)))
+            asteroids)])

 (defn generate-asteroid []
     {
@@ -123,7 +148,7 @@
         :yv (rand 10)
         :a 0.0
         :av (rand)
-        :radii (take 10 (repeatedly #(myrand 5 10)))
+        :radii (take 10 (repeatedly #(myrand 5 30)))
     })

 (defn default-state [] {
@@ -180,24 +205,30 @@
         new-time (now)
         time-step (+ (* 0.95 (:time-step state)) (* 0.05 (- new-time (:time state))))
         spawn-new-bullet (and (contains? keys-pressed KeyEvent/VK_SPACE) (>= new-time (:next-fire-time state)))
-        ]
-        (assoc state
-            :time new-time
-            :time-step time-step
-            :player (player-step (:player state) time-step keys-pressed)
-            :asteroids (map (fn [a] (asteroid-step a time-step)) (:asteroids state))
-            :bullets
-                (map (fn [b] (bullet-step b time-step))
-                    (concat
-                        (if spawn-new-bullet
-                            [(new-bullet (:player state))]
-                            [])
-                    (:bullets state)))
-            :next-fire-time
-                (if spawn-new-bullet
-                    (+ new-time fire-delay)
-                    (:next-fire-time state))
-)))
+        state
+            (assoc state
+                :time new-time
+                :time-step time-step
+                :player (player-step (:player state) time-step keys-pressed)
+                :asteroids (map (fn [a] (asteroid-step a time-step)) (:asteroids state))
+                :bullets
+                    (map (fn [b] (bullet-step b time-step))
+                        (concat
+                            (if spawn-new-bullet
+                                [(new-bullet (:player state))]
+                                [])
+                        (:bullets state)))
+                :next-fire-time
+                    (if spawn-new-bullet
+                        (+ new-time fire-delay)
+                        (:next-fire-time state)))
+        [fb fa]
+            (filter-collisions (:bullets state) (:asteroids state))
+        state
+            (assoc state
+                :bullets fb
+                :asteroids fa)]
+    state))

 (defn create-game []
     (let [


[#208] Make the duplicated logic move obvious

--- api/src/clojure/org/akvo/flow_api/unilog/unilog.clj
+++ api/src/clojure/org/akvo/flow_api/unilog/unilog.clj
@@ -39,17 +39,17 @@

 (def parse-json #(json/parse-string % true))

-(defn form-data [{:keys [formId id surveyId]}]
-  {:form-id formId
+(defn form-data [{:keys [formId id]}]
+  {:owner-id formId
    :id id})

 (defn form-instance-data [{:keys [formId formInstanceId]}]
-  {:form-id formId
+  {:owner-id formId
    :id formInstanceId})

 (defn datapoint-data [{:keys [id surveyId]}]
   {:id id
-   :survey-id surveyId})
+   :owner-id surveyId})

 (defn process-new-events [reducible]
   (let [pipeline (comp
@@ -80,23 +80,30 @@
          (let [form-deleted (set (keep ::form-deleted final))
                form-updated (apply disj (set (keep ::form-changed final)) form-deleted)
                form-instance-deleted (set (keep ::form-instance-deleted final))
-               form-instances-grouped-by-form (group-by :form-id
-                                                (remove
-                                                  (comp form-deleted :form-id)
-                                                  (remove
-                                                    (comp form-instance-deleted :id)
-                                                    (distinct (keep ::form-instance-changed final)))))
+               form-instance-changed (remove
+                                        (comp form-deleted :owner-id)
+                                        (remove
+                                          (comp form-instance-deleted :id)
+                                          (distinct (keep ::form-instance-changed final))))
+
+               survey-deleted (set (keep ::survey-deleted final))
+               survey-changed (apply disj (set (keep ::survey-changed final)) survey-deleted)
                data-point-deleted (set (keep ::data-point-deleted final))
-               data-point-changed (remove #(data-point-deleted (:id %)) (set (keep ::data-point-changed final)))
-               survey-deleted (set (keep ::survey-deleted final))
-               survey-changed (apply disj (set (keep ::survey-changed final)) survey-deleted)]
-           {::unilog-id (:id (last final))
-            ::form-instance-deleted form-instance-deleted
+               data-point-changed (remove
+                                    (comp survey-deleted :owner-id)
+                                    (remove
+                                      (comp data-point-deleted :id)
+                                      (distinct (keep ::data-point-changed final))))
+               ]
+           {:forms-to-load (apply conj form-updated (map :owner-id form-instance-changed))
+            :surveys-to-load (apply conj survey-changed (map :owner-id data-point-changed))
+
+            ::unilog-id (:id (last final))
             ::form-updated form-updated
             ::form-deleted form-deleted
-            :forms-to-load (apply conj form-updated (keys form-instances-grouped-by-form))
-            :surveys-to-load (apply conj survey-changed (map :survey-id data-point-changed))
-            ::forms-instances-grouped-by-form form-instances-grouped-by-form
+            ::form-instance-deleted form-instance-deleted
+            ;;::form-instance-changed form-instance-changed
+            ::forms-instances-grouped-by-form (group-by :owner-id form-instance-changed)
             ::data-point-changed data-point-changed
             ::data-point-deleted data-point-deleted
             ::survey-changed survey-changed
@@ -128,7 +135,7 @@
                                            :form-instance-ids (set (map :id form-instance))})))
                                 set)
    :data-point-changed (->> data-point-changed
-                            (filter (comp survey-id->survey :survey-id))
+                            (filter (comp survey-id->survey :owner-id))
                             (map :id)
                             set)
    :data-point-deleted data-point-deleted


Resolved merge conflict.

Resolved merge conflict.

--- src/cmr/search/services/parameter_validation.clj
+++ src/cmr/search/services/parameter_validation.clj
@@ -10,7 +10,6 @@
             [cmr.search.services.parameter-converters.orbit-number :as on]
             [cmr.search.services.messages.orbit-number-messages :as on-msg]
             [camel-snake-kebab :as csk]))
-

 (defn- concept-type->valid-param-names
   "A set of the valid parameter names for the given concept-type."
@@ -39,7 +38,6 @@
         ["page_size must be a number between 1 and 2000"]))
     []))

-
 (defn page-num-validation
   "Validates that the page-num (if present) is a number in the valid range."
   [concept-type params]
@@ -61,7 +59,6 @@
     (map #(str "Parameter [" (csk/->snake_case_string % )"] was not recognized.")
          (set/difference (set (keys params))
                          (concept-type->valid-param-names concept-type)))))
-

 (defn unrecognized-params-in-options-validation
   "Validates that no invalid parameters names in the options were supplied"
@@ -133,24 +130,6 @@
       [(attrib-msg/attributes-must-be-sequence-msg)])
     []))

-(defn boolean-value-validation
-  [concept-type params]
-  (let [bool-params (select-keys params [:downloadable])]
-    (mapcat
-      (fn [[key value]]
-        (if (or (= "true" value) (= "false" value))
-          []
-          [(format "Parameter %s must take value of true of false, but was %s" key value)]))
-      bool-params)))
-
-(defn orbit-number-str->orbit-number-map
-  "Convert an orbit-number string to a map with exact or range values."
-  [ons]
-  (if-let[[_ start stop] (re-find #"^(.*),(.*)$" ons)]
-    {:start-orbit-number (Float. start)
-     :stop-orbit-number (Float. stop)}
-    {:orbit-number (Float. ons)}))
-
 (defn orbit-number-validation
   "Validates that the orbital number is either a single number or a range in the format
   start,stop where start <= stop."
@@ -166,7 +145,6 @@
       (catch NumberFormatException e
         [(on-msg/invalid-orbit-number-msg)]))
     []))
-

 (defn boolean-value-validation
   [concept-type params]
@@ -187,10 +165,9 @@
    unrecognized-params-in-options-validation
    unrecognized-params-settings-in-options-validation
    temporal-format-validation
+   orbit-number-validation
    attribute-validation
    boolean-value-validation])
-   orbit-number-validation
-   attribute-validation])

 (defn validate-parameters
   "Validates parameters. Throws exceptions to send to the user. Returns parameters if validation


Fix reflection warnings in 'move'

Fix reflection warnings in 'move'

--- src/main/clojure/clojure/tools/namespace/move.clj
+++ src/main/clojure/clojure/tools/namespace/move.clj
@@ -34,10 +34,12 @@
 (defn- clojure-source-files [dirs]
   (->> dirs
        (map io/file)
-       (filter #(.exists %))
+       (filter #(.exists ^File %))
        (mapcat file-seq)
-       (filter #(and (.isFile %) (.endsWith (.getName %) ".clj")))
-       (map #(.getCanonicalFile %))))
+       (filter (fn [^File file]
+                 (and (.isFile file)
+                      (.endsWith (.getName file) ".clj"))))
+       (map #(.getCanonicalFile ^File %))))

 (def ^:private symbol-regex
   ;; LispReader.java uses #"[:]?([\D&&[^/]].*/)?([\D&&[^/]][^/]*)" but


fix for distingushing virtual devices from real ones

--- src/main/clojure/com/contentjon/hardware/udev.clj
+++ src/main/clojure/com/contentjon/hardware/udev.clj
@@ -125,6 +125,13 @@
   [device]
   (.udev_device_get_sysname library (:native device)))

+(defn- is-virtual?
+  "Returns if it is a virtual device, i.e. the sysfs-path starts with
+   /sys/devices/virtual, for example bridges, vlan-devices or loopback devices"
+  [device]
+  (let [sys-path (.udev_device_get_syspath library (:native device))]
+    (.startsWith sys-path "/sys/devices/virtual/")))
+
 (defn attribute
   "Returns a specific attribute of a device as a string"
   [device attribute]
@@ -168,7 +175,9 @@
 (defn device->map [device]
   (let [clazz      (property device class-property)
         attributes (class->attributes clazz)]
-    (into { :name (device-name device) }
+    (into { :name (device-name device)
+            :virtual (is-virtual? device)
+            }
           (map #(make-attribute device %) attributes))))

 (def make-device-map (comp device->map #(device %1 %2)))


RS + CW | #134 | Add functional test to ensure writer notes appear on annotations on a draft section page

--- test/objective8/functional/functional_tests.clj
+++ test/objective8/functional/functional_tests.clj
@@ -711,6 +711,16 @@
              (throw e)))
       => "Functional test writer note on annotation")

+(fact "Annotation writer note appears alongside the annotation"
+      (try (wd/to (str (:draft-url @journey-state) "/sections/" (:section-label @journey-state)))
+           (wait-for-title "Draft section | Objective[8]")
+           (screenshot "draft_section_with_annotation_with_writer_note")
+           (wd/page-source)
+        (catch Exception e
+          (screenshot "ERROR-annotation-writer-note-appears-alongside-the-annotation")
+          (throw e)))
+      => (contains "Functional test writer note on annotation"))
+
 (fact "User with admin credentials can remove an objective"
       (let [result (try
                      (wd/click ".func--objectives")


flip AWSAccessKeyId and AWSSecretKey properties in load-credentials

--- src/main/clj/com/climate/services/aws/common.clj
+++ src/main/clj/com/climate/services/aws/common.clj
@@ -50,8 +50,8 @@
                                 " => " props)
                      ; AWSSecretKey/AWSAccessKeyId -- this is the format used by AWS CloudWatch
                      ; access_key/secret_key -- this format is for the s3cmd .s3cfg file
-                     {:access_id (or (get props "accessKey") (get props "AWSSecretKey") (get props "access_key"))
-                      :private_key (or (get props "secretKey") (get props "AWSAccessKeyId") (get props "secret_key"))
+                     {:access_id (or (get props "accessKey") (get props "AWSAccessKeyId") (get props "access_key"))
+                      :private_key (or (get props "secretKey") (get props "AWSSecretKey") (get props "secret_key"))
                       :keypair (get props "keypair")})))]
     (when result (log/debug "Loaded aws-credentials" result))
     result))


Polish tests

Polish tests

--- test/cljc/reitit/exception_test.cljc
+++ test/cljc/reitit/exception_test.cljc
@@ -15,40 +15,35 @@
 (deftest errors-test

   (are [exception]
-    (are [error routes opts]
+    (are [error routes]
       (is (thrown-with-msg?
             ExceptionInfo
             error
             (r/router
               routes
-              (merge {:exception exception} opts))))
+              {:validate rs/validate
+               :exception exception})))

       #"Router contains conflicting route paths"
       [["/:a/1"]
        ["/1/:a"]]
-      nil

       #"Router contains conflicting route names"
       [["/kikka" ::kikka]
        ["/kukka" ::kikka]]
-      nil

       #":reitit.trie/multiple-terminators"
       [["/{a}.pdf"]
        ["/{a}-pdf"]]
-      nil

       #":reitit.trie/following-parameters"
       ["/{a}{b}"]
-      nil

       #":reitit.trie/unclosed-brackets"
       ["/api/{ipa"]
-      nil

       #"Invalid route data"
-      ["/api/ipa" {::roles #{:adminz}}]
-      {:validate rs/validate})
+      ["/api/ipa" {::roles #{:adminz}}])

     exception/exception
     pretty/exception))


Remove unused test file

Remove unused test file

--- src/test/clojure/clojure/data/xml/test_fresh.clj
+++ src/test/clojure/clojure/data/xml/test_fresh.clj
@@ -1,4 +0,0 @@
-(ns clojure.data.xml.test-fresh
-  (:require
-   [clojure.data.xml :refer :all]))
-


Clean up frontend.components.test-insights ns

--- test-cljs/frontend/components/test_insights.cljs
+++ test-cljs/frontend/components/test_insights.cljs
@@ -1,12 +1,9 @@
 (ns frontend.components.test-insights
-  (:require [cljs.test :refer-macros [are deftest is testing]]
+  (:require [cljs.test :refer-macros [are deftest testing]]
             [frontend.components.insights :as insights]
             [frontend.models.test-project :as test-project]
-            [frontend.stefon :as stefon]
             [frontend.test-utils :as test-utils]
             [frontend.timer :as timer]
-            [frontend.utils :as utils :refer [sel sel1]]
-            [frontend.utils.docs :as doc-utils]
             [goog.dom :as gdom]
             [om.core :as om :include-macros true]))


Show path in admin view mode

Show path in admin view mode

Show path in admin view mode

--- src/webapp/framework/client/components/admin.cljs
+++ src/webapp/framework/client/components/admin.cljs
@@ -159,7 +159,7 @@
 		 (c/map-many
 		  #(c/div
 				{:onClick (fn[x] (js/alert (pr-str (get  @data-views-v2 %))))}
-		      (pr-str (get  % :fields) (get  % :db-table) (get  % :where) (get  % :params) ))
+		      (pr-str (get  % :path) (get  % :fields) (get  % :db-table) (get  % :where) (get  % :params) ))
 		     ;(c/read-ui data-sources [:values])
 		     ;["s" "dd"]
 			(keys @data-views-v2)


filter out entries with no :cat:

filter out entries with no :cat:

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -80,6 +80,14 @@
                               phonize
                               ;; TODO: rewrite italian-specific-rules as (constrain-vals-if)(one or more)
                               italian-specific-rules)
+
+                 ;; filter out entries with no :cat.
+                 (filter-vals
+                  #(or (and (not (= :none (get-in % [:synsem :cat] :none)))
+                            (or (log/info (str "lexical entry has a cat - good : " (strip-refs %)))
+                                true))
+                       (and (log/warn (str "ignoring lexical entry with no :cat: " (strip-refs %)))
+                            false)))

                  (constrain-vals-if
                   (fn [val]
@@ -164,7 +172,6 @@
                  (if-then {:synsem {:cat :prep}}
                           preposition)

-
                  ;; filters out any verbs without an inflection: infinitive verbs should have inflection ':top',
                  ;; rather than not having any inflection.
                  (filter-vals


remove (atom)s

remove (atom)s

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -945,43 +945,35 @@
                          :sem {:pred :express}}}
    "essere"
    (let [essere-common
-         (let [infl (atom :top)
-               agr (atom :top)]
-           {:synsem {:agr agr
-                     :cat :verb
-                     :essere true
-                     :infl infl
-                     :subcat {:1 {:agr agr}}}
-            :italiano {:agr agr
-                       :future-stem "sar"
-                       :infinitive "essere"
-                       :infl infl
-                       :present {:1sing "sono"
-                                 :2sing "sei"
-                                 :3sing "è"
-                                 :1plur "siamo"
-                                 :2plur "siete"
-                                 :3plur "sono"}
-                       :passato "stato"
-                       :imperfect {:1sing "ero"
-                                   :2sing "eri"
-                                   :3sing "era"
-                                   :1plur "eravamo"
-                                   :2plur "eravate"
-                                   :3plur "erano"}
-                       :future {:1sing "sarò"
-                                :2sing "sarai"
-                                :3sing "sarà"
-                                :1plur "saremo"
-                                :2plur "sarete"
-                                :3plur "saranno"}
-
-                       :conditional {:1sing "sarei"
-                                     :2sing "saresti"
-                                     :3sing "sarebbe"
-                                     :1plur "saremmo"
-                                     :2plur "sareste"
-                                     :3plur "sarebbero"}}})]
+         {:synsem {:cat :verb
+                   :essere true}
+          :italiano {:future-stem "sar"
+                     :infinitive "essere"
+                     :present {:1sing "sono"
+                               :2sing "sei"
+                               :3sing "è"
+                               :1plur "siamo"
+                               :2plur "siete"
+                               :3plur "sono"}
+                     :passato "stato"
+                     :imperfect {:1sing "ero"
+                                 :2sing "eri"
+                                 :3sing "era"
+                                 :1plur "eravamo"
+                                 :2plur "eravate"
+                                 :3plur "erano"}
+                     :future {:1sing "sarò"
+                              :2sing "sarai"
+                              :3sing "sarà"
+                              :1plur "saremo"
+                              :2plur "sarete"
+                              :3plur "saranno"}
+                     :conditional {:1sing "sarei"
+                                   :2sing "saresti"
+                                   :3sing "sarebbe"
+                                   :1plur "saremmo"
+                                   :2plur "sareste"
+                                   :3plur "sarebbero"}}}]
      [;; essere: adjective
       ;; TODO: unify essere-adjective, essere-prepositional-phrase
       ;; and essere-intensifier into one lexical entry.


pronouns and proper nouns have semantic number and gender

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -182,6 +182,29 @@
                  :synsem {:cat cat
                           :agr agr
                           :subcat {:1 {:agr agr}}}})))
+
+      ;; pronouns have semantic number and gender.
+      (default
+       (let [gender (atom :top)
+             number (atom :top)]
+         {:synsem {:cat :noun
+                   :pronoun true
+                   :agr {:gender gender
+                         :number number}
+                   :sem {:gender gender
+                         :number number}}}))
+
+      ;; propernouns have semantic number and gender.
+      (default
+       (let [gender (atom :top)
+             number (atom :top)]
+         {:synsem {:cat :noun
+                   :propernoun true
+                   :agr {:gender gender
+                         :number number}
+                   :sem {:gender gender
+                         :number number}}}))
+
       ;; </noun default rules>

       ;; <verb default rules>