Update vulnerable jackson-databind dependency (#928)

Close #925

Update vulnerable jackson-databind dependency.

§ QA
No QA is needed.

§ Release Notes
intern: Bump vulnerable jackson-databind 2.9.1 dependency
§ Squashed Commits

--- project.clj
+++ project.clj
@@ -104,6 +104,11 @@
                  [args4j "2.32"] ;org.onyxplatform/onyx-kafka > threatgrid/ctim
                  [com.stuartsierra/component "0.3.2"] ;org.onyxplatform/onyx-kafka internal override
                  [org.onyxplatform/onyx-kafka "0.14.5.0"]
+                 ;; Notes on jackson-databind:
+                 ;; - overrides org.onyxplatform/onyx-kafka and others
+                 ;; - some 2.9.x versions of jackson-databind and earlier have known exploits
+                 ;; - 2.10.2 is the same as cheshire's jackson-core dependency
+                 [com.fasterxml.jackson.core/jackson-databind "2.10.2"]
                  [zookeeper-clj "0.9.4"]

                  ;; GraphQL


Bump codox dependency tp 0.6.4

Bump codox dependency tp 0.6.4

--- project.clj
+++ project.clj
@@ -10,7 +10,7 @@
      [ring/ring-servlet "1.2.0-beta1"]]
   :plugins
     [[lein-sub "0.2.1"]
-     [codox "0.6.3"]]
+     [codox "0.6.4"]]
   :sub
     ["ring-core"
      "ring-devel"


Fixup the Clojurescript source-paths to allow for .cljc files to be loaded.

--- project.clj
+++ project.clj
@@ -61,19 +61,20 @@
                    :repl-options {:init-ns          user
                                   :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
   :cljsbuild {
-              :builds [{:id "devcards"
-                        :source-paths ["src/cljs"]
-                        :figwheel { :devcards true }
-                        :compiler {:main                 "word-finder.core"
-                                   :source-paths         ["src/cljs"]
-                                   :asset-path           "js/compiled/devcards_out"
-                                   :output-to            "resources/public/js/compiled/word_finder_devcards.js"
-                                   :output-dir           "resources/public/js/compiled/devcards_out"
-                                   :source-map-timestamp true }}
+              :builds [{:id           "devcards"
+                        :source-paths ["src/cljs" "src/clj"]
+                        :figwheel     { :devcards true }
+                        :compiler     {:main                 "word-finder.core"
+                                       :source-paths         ["src/cljs" "src/clj"]
+                                       :asset-path           "js/compiled/devcards_out"
+                                       :output-to            "resources/public/js/compiled/word_finder_devcards.js"
+                                       :output-dir           "resources/public/js/compiled/devcards_out"
+                                       :source-map-timestamp true }}
                        {:id "dev"
-                        :source-paths ["src/cljs"]
+                        :source-paths ["src/cljs" "src/clj"]
                         :figwheel true
                         :compiler {:main                 "word-finder.core"
+                                   :source-paths         ["src/cljs" "src/clj"]
                                    :asset-path           "js/compiled/out"
                                    :output-to            "resources/public/js/compiled/word_finder.js"
                                    :output-dir           "resources/public/js/compiled/out"


bump version

bump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sync "0.9.45"
+(defproject sync "0.9.46-SNAPSHOT"
   :description "sync is a Leiningen plugin to sync same code base between different clojure projects"
   :url "https://github.com/otto-de/leinsync"
   :license {:name "Apache License 2.0"


Fix deps

Fix deps

--- project.clj
+++ project.clj
@@ -6,7 +6,7 @@
   :dependencies [[org.clojure/clojure "1.8.0"]

                  [com.stuartsierra/component "0.3.2"]
-                 [org.clojure/tools.nrepl "0.2.12"]
+                 [org.clojure/tools.nrepl "0.2.13"]

                  ; Dependecy conflict overrides
                  [org.clojure/tools.reader "1.0.0-beta3"]


Switch back to -server for jvm

Switch back to -server for jvm

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (defproject parbench "1.3.2"
   :description "Parallel HTTP Benchmarker/Visualizer"
   :main parbench.core
-  :jvm-opts ["-client"]
+  :jvm-opts ["-server"]
   :dependencies [[org.clojure/clojure "1.3.0"]
                  [org.clojure/tools.cli "0.2.1"]
                  [noir-async "0.1.2"]


Bump to release Precipice version

Bump to release Precipice version

--- project.clj
+++ project.clj
@@ -8,6 +8,6 @@
                                   [clj-http "1.0.1"]
                                   [criterium "0.4.3"]]}}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [net.uncontended/precipice-core "0.5.2-SNAPSHOT"]])
+                 [net.uncontended/precipice-core "0.5.2"]])


add jvmopts to change line separator

add jvmopts to change line separator

--- project.clj
+++ project.clj
@@ -13,5 +13,6 @@
                  [http.async.client "0.5.2"]
                  [twitter-streaming-client "0.3.1"]
                  [twitter-api "0.7.5"]]
-
+
+  :jvm-opts ["-Dline.separator=\"\n\""]
   :main real-dashboard.core )


Version 0.8.0-SNAPSHOT

Version 0.8.0-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject jcf/lein-template "0.7.0"
+(defproject jcf/lein-template "0.8.0-SNAPSHOT"
   :description "A Leiningen template I use for quickly creating a reloadable, REPL-driven Clojure app."
   :url "https://github.com/jcf/lein-template"
   :license {:name "The MIT License"


Cut Overseer 0.2.0

Cut Overseer 0.2.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject io.framed/overseer "0.1.0"
+(defproject io.framed/overseer "0.2.0"
   :description "A framework for defining and running expressive job pipelines"
   :url "https://github.com/framed-data/overseer"
   :license {:name "MIT License"


bumped to 0.3.27 version

bumped to 0.3.27 version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject wit/duckling "0.3.26"
+(defproject wit/duckling "0.3.27"
   :description "Date & Number parser"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}


Version 2.0.41

Version 2.0.41

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojush "2.0.41-SNAPSHOT"
+(defproject clojush "2.0.41"
   :description "The Push programming language and the PushGP genetic programming
                 system implemented in Clojure.
                 See http://hampshire.edu/lspector/push.html"


bump version number for release

bump version number for release

--- project.clj
+++ project.clj
@@ -1,8 +1,8 @@
-(defproject yeller-timbre-appender "0.1.0-SNAPSHOT"
-  :description "FIXME: write description"
-  :url "http://example.com/FIXME"
+(defproject yeller-timbre-appender "0.4.1"
+  :description "A timbre appender that sends exceptions to yellerapp.com"
+  :url "https://github.com/yeller/yeller-timbre-appender"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [com.taoensso/timbre "3.2.1"]
-                 [yeller-clojure-client "0.2.0-SNAPSHOT"]])
+                 [yeller-clojure-client "0.4.1"]])


Bump CLJ

Bump CLJ

--- project.clj
+++ project.clj
@@ -6,7 +6,7 @@

   :test-paths ["test/cljc"]

-  :dependencies [[org.clojure/clojure "1.9.0-beta1" :scope "provided"]
+  :dependencies [[org.clojure/clojure "1.9.0-beta2" :scope "provided"]
                  [org.clojure/clojurescript "1.9.946" :scope "provided"]
                  [clansi "1.0.0"]
                  [fipp "0.6.8"]


Bumped up the version number.

Bumped up the version number.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject appengine-magic "0.2.0"
+(defproject appengine-magic "0.2.1-SNAPSHOT"
   :description "Google App Engine library for Clojure."
   :repositories {"maven-gae-plugin" "http://maven-gae-plugin.googlecode.com/svn/repository"}
   :dependencies [[org.clojure/clojure "1.2.0"]


Revert "GG/CM - add lein ring server"

Revert "GG/CM - add lein ring server"

This reverts commit 941c3c6be3b722953ff061bc9a9a226755ea7691.

--- project.clj
+++ project.clj
@@ -14,10 +14,8 @@
                  [clj-oauth "1.5.1"]
                  [com.ashafa/clutch "0.4.0"]]
   :main d-cent.core
-  :ring {:handler d-cent.core/app :port 8080}
   :profiles {:dev {:dependencies [[midje "1.5.1"]
                                   [ring/ring-mock "0.2.0"]
                                   [javax.servlet/servlet-api "2.5"]]
-                   :plugins [[lein-ring "0.9.1"]
-                             [lein-midje "3.1.3"]
+                   :plugins [[lein-midje "3.1.3"]
                              [jonase/eastwood "0.2.1"]]}})


Bump lib

Bump lib

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.wsscode/pathom "2.2.0-beta9"
+(defproject com.wsscode/pathom "2.2.0-beta10"
   :description "A Clojure library designed to provide a collection of helper functions to support Clojure(script) graph parsers using\nom.next graph syntax."
   :url "https://github.com/wilkerlucio/pathom"
   :license {:name "Eclipse Public License"


move debugrepl to :production

move debugrepl to :production

--- project.clj
+++ project.clj
@@ -9,8 +9,9 @@
   :repositories {"twitter4j" "http://twitter4j.org/maven2"}
   :plugins [[lein-git-deps "0.0.1-SNAPSHOT"]
             [lein-environ "0.4.0"]]
-  :git-dependencies [["https://github.com/Prismatic/hiphip.git" "master"]
-                     ["https://github.com/GeorgeJahad/debug-repl.git" "master"]]
+  :git-dependencies [
+    ["https://github.com/Prismatic/hiphip.git" "master"]
+  ]
   :dependencies [[commons-collections/commons-collections "3.2.1"]
                  [cheshire "5.3.1"]
                  [net.mikera/core.matrix "0.19.0"]
@@ -34,16 +35,24 @@
       :dependencies [
         [org.clojure/tools.trace "0.7.6"]
         [criterium "0.4.2"]
-        [org.clojure/clojure "1.5.1"]]
+        [org.clojure/clojure "1.5.1"]
+      ]
+      :git-dependencies [
+        ["https://github.com/GeorgeJahad/debug-repl.git" "master"]
+      ]
       :env {
-        :dev-mongolab-uri "db/mongo.db"}}
+        :dev-mongolab-uri "db/mongo.db"}
+      }
     :production {
       :dependencies [
         [org.clojure/tools.trace "0.7.6"]
         [criterium "0.4.2"]
-        [org.clojure/clojure "1.5.1"]]
+        [org.clojure/clojure "1.5.1"]
+      ]
       :env {
-        :dev-mongolab-uri "db/mongo.db"}}}
-
+        :dev-mongolab-uri "db/mongo.db"
+      }
+    }
+  }
 )


Version 1.5.11-SNAPSHOT

Version 1.5.11-SNAPSHOT

--- project.clj
+++ project.clj
@@ -2,7 +2,7 @@
 (def ks-version "1.3.0")
 (def jetty-version "9.2.10.v20150310")

-(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.5.10"
+(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.5.11-SNAPSHOT"
   :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."
   :url "https://github.com/puppetlabs/trapperkeeper-webserver-jetty9"
   :license {:name "Apache License, Version 2.0"


Update dependency.

Update dependency.

--- project.clj
+++ project.clj
@@ -23,7 +23,7 @@
     [http-kit "2.1.19"] ; Web Server http://http-kit.org/
     [compojure "1.3.1"] ; Web routing https://github.com/weavejester/compojure
     [enlive "1.1.5"] ; HTML Templating system for Clojure https://github.com/cgrand/enlive
-    [com.taoensso/carmine "2.8.0"] ; Redis client for Clojure https://github.com/ptaoussanis/carmine
+    [com.taoensso/carmine "2.9.0"] ; Redis client for Clojure https://github.com/ptaoussanis/carmine
     [clj-time "0.9.0-beta1"] ; Clojure date/time library https://github.com/clj-time/clj-time
     [environ "1.0.0"] ; Get environment settings from different sources https://github.com/weavejester/environ
     [cheshire "5.4.0"] ; JSON de/encoding https://github.com/dakrone/cheshire


Version 3.14.3-1-SNAPSHOT [ci skip]

Version 3.14.3-1-SNAPSHOT [ci skip]

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


lein-release plugin: preparing 0.2.0 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/ring-middleware "0.2.0-SNAPSHOT"
+(defproject puppetlabs/ring-middleware "0.2.0"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.logging "0.2.6"]
                  [ring "1.3.0"]


Updated blog description.

Updated blog description.

--- project.clj
+++ project.clj
@@ -25,7 +25,7 @@
   :dragon {
     :domain "clojang.lfe.io"
     :name "The Clojang Blog"
-    :description "News, Information, & Tutorials for the Clojang Collection"
+    :description "News, Information, & Tutorials for the Clojang Library Collection"
     :dev-port 5097
     :output-dir "docs"
     :posts-path "/archives"


Update to Aeron 0.2.2.

Update to Aeron 0.2.2.

--- project.clj
+++ project.clj
@@ -20,7 +20,7 @@
                  [com.stuartsierra/component "0.3.0"]
                  [com.taoensso/timbre "4.1.4"]
                  [com.taoensso/nippy "2.10.0"]
-                 [uk.co.real-logic/aeron-all "0.2.1"]
+                 [uk.co.real-logic/aeron-all "0.2.2"]
                  [prismatic/schema "1.0.3"]
                  [org.apache.zookeeper/zookeeper "3.4.6"
                   :exclusions [org.slf4j/slf4j-log4j12]]


Version 0.2.45

Version 0.2.45

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


Bump version to 0.1.1 release

Bump version to 0.1.1 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject michaelrkytch/streamsum "0.1.1-SNAPSHOT"
+(defproject michaelrkytch/streamsum "0.1.1"
   :description "Configuration-driven summarization of event streams."
   :url "https://github.com/michaelrkytch/streamsum"
   :license {:name "Eclipse Public License"


Version 0.4.0

Version 0.4.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lein-droid/lein-droid "0.4.0-SNAPSHOT"
+(defproject lein-droid/lein-droid "0.4.0"
   :description "Plugin for easy Clojure/Android development and deployment"
   :url "https://github.com/clojure-android/lein-droid"
   :license {:name "Eclipse Public License"


Version 1.4.1

Version 1.4.1

--- project.clj
+++ project.clj
@@ -2,7 +2,7 @@
 (def ks-version "1.0.0")
 (def jetty-version "9.2.10.v20150310")

-(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.4.1-SNAPSHOT"
+(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.4.1"
   :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."
   :url "https://github.com/puppetlabs/trapperkeeper-webserver-jetty9"
   :license {:name "Apache License, Version 2.0"


Upgrade the lein-git-version plugin

Upgrade the lein-git-version plugin

--- project.clj
+++ project.clj
@@ -37,7 +37,7 @@
             [lein-cljsbuild "1.1.1"]
             [lein-asset-minifier "0.4.6"
              :exclusions [org.clojure/clojure]]
-            [org.clojars.cvillecsteele/lein-git-version "1.0.3"]]
+            [org.clojars.cvillecsteele/lein-git-version "1.2.7"]]

   :ring {:handler hyphen-keeper.handler/app
          :uberwar-name "hyphen-keeper.war"}
@@ -94,6 +94,8 @@
    :css-dirs ["resources/public/css"]
    :ring-handler hyphen-keeper.handler/site}

+  :git-version {:root-ns "hyphen-keeper"
+                :path "env/prod/clj/hyphen_keeper"}
   :immutant {:war {:context-path "/hyphenations"
                    :name "%p%v%t"
                    :nrepl {:port 40021


Revert version to make sure release script works

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-datomic "0.8.11.2-SNAPSHOT"
+(defproject org.onyxplatform/onyx-datomic "0.8.11.1-SNAPSHOT"
   :description "Onyx plugin for Datomic"
   :url "https://github.com/onyx-platform/onyx-datomic"
   :license {:name "Eclipse Public License"


add test for the preceding change

add test for the preceding change

--- test/babel/test/es.cljc
+++ test/babel/test/es.cljc
@@ -22,6 +22,16 @@
     (is (or (= "yo dormiría" (fo result))
             (= "dormiría" (fo result))))))

+(deftest zar-preterito
+  (let [result (engine/generate
+                {:root {:espanol {:espanol "abrazar"}}
+                 :synsem {:sem {:subj {:pred :I}}
+                          :infl :preterito}}
+                esg/small
+                :enrich true)]
+    (is (or (= "yo abracé" (fo result))
+            (= "abracé" (fo result))))))
+
 (deftest llamarse
   (let [result (engine/expression esg/small {:synsem {:sem {:pred :be-called}}})]
     (is (not (empty? (fo result))))))


use println rather than log/info for benchmark

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -199,11 +199,14 @@
            (fo (first result))))))

 (defn run-benchmark []
-  (repeatedly #(time
-                (fo
-                 (first
-                  (parse
-                   (let [expression (generate :top)
-                         surface (fo expression)]
-                     (log/info (str "expression: "  surface))
-                     surface)))))))
+  (repeatedly #(let [debug (println "starting generation")
+                     expr (time (generate :top))]
+                 (println (str "generated expression: " (fo expr)))
+                 (let [parsed (time (first (take 1 (parse (fo expr)))))]
+                   (println (str "parsed: " (fo parsed)))
+                   (println "")))))
+
+
+
+
+


simplify: remove (generate-with-medium) since it's equivalent to (generate)

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -18,9 +18,6 @@
    [clojure.string :as string]
    [clojure.set :as set]
    [dag_unify.core :refer [copy fail? get-in strip-refs unifyc]]))
-
-(defn generate-with-medium [spec]
-  (generate spec :model (medium)))

 (deftest analyze-1
   (let [singular (analyze "compito")
@@ -285,7 +282,7 @@
 (defn roundtrip-parsing [n]
   (take n
         (repeatedly #(let [generated
-                           (fo (generate-with-medium {:synsem {:cat :verb
+                           (fo (generate {:synsem {:cat :verb
                                                                :subcat '()}}))
                            parsed (reduce concat (map :parses (parse generated medium)))]
                        (log/info (str "generated: " generated))
@@ -317,7 +314,7 @@
                         :subj {:pred :città}
                         :obj {:pred :calzoni}}}}]
     (is (or true ;; test won't complete (yet) without disabling with this 'or true'.
-            (not (nil? (generate-with-medium synsem)))))))
+            (not (nil? (generate synsem)))))))

 (deftest casa-parse
   (is (not (empty?
@@ -332,7 +329,7 @@
     (is (= "loro gestiscono" (fo result)))))

 (deftest casa-generate
-  (let [result (generate-with-medium {:synsem {:cat :noun
+  (let [result (generate {:synsem {:cat :noun
                                                :agr {:number :sing}
                                                :sem {:pred :house
                                                      :mod '()
@@ -341,7 +338,7 @@
     (is (= (get-in result [:synsem :sem :mod]) '()))))

 (deftest case-generate
-  (let [result (generate-with-medium {:synsem {:cat :noun
+  (let [result (generate {:synsem {:cat :noun
                                                :agr {:number :plur}
                                                :sem {:pred :house
                                                      :mod '()
@@ -350,7 +347,7 @@
     (is (= (get-in result [:synsem :sem :mod]) '()))))

 (deftest alla-casa-generate
-  (let [result (generate-with-medium
+  (let [result (generate
                 {:comp {:synsem {:agr {:number :sing}
                                  :reflexive false}}
                  ;; TODO: the above is needed to prevent "a" + reflexive pronoun:
@@ -363,7 +360,7 @@
     (is (= (fo result) "alla casa"))))

 (deftest a-casa-generate
-  (let [result (generate-with-medium
+  (let [result (generate
                 {:comp {:synsem {:pronoun false}}
                  ;; TODO: the above is needed to prevent "a" + reflexive pronoun:
                  ;; eliminate this need.
@@ -380,7 +377,7 @@

 ;; TODO: what is this test doing that the preceding test is not doing?
 (deftest a-casa-generate-2
-  (let [result (generate-with-medium
+  (let [result (generate
                 {:modified false
                  :synsem {:cat :verb
                           :sem {:tense :present
@@ -445,7 +442,7 @@

 (deftest davanti-il-tavolo
   (let [parse-result (mapcat :parses (parse "davanti il tavolo"))
-        gen-result (generate-with-medium {:synsem {:cat :prep
+        gen-result (generate {:synsem {:cat :prep
                                                    :sem {:pred :in-front-of
                                                          :obj {:pred :table
                                                                :number :sing
@@ -460,7 +457,7 @@

 (deftest davanti-lo-studente
   (let [parse-result (mapcat :parses (parse "davanti lo studente"))
-        gen-result (generate-with-medium {:synsem {:cat :prep
+        gen-result (generate {:synsem {:cat :prep
                                                    :sem {:pred :in-front-of
                                                          :obj {:pred :student
                                                                :number :sing
@@ -474,7 +471,7 @@
            (fo gen-result)))))

 (deftest davanti-il-tavolo
-  (let [expr (generate-with-medium {:synsem {:cat :prep
+  (let [expr (generate {:synsem {:cat :prep
                                              :sem {:pred :in-front-of
                                                    :reflexive false
                                                    :obj {:pred :table
@@ -486,7 +483,7 @@
            "davanti il tavolo"))))

 (deftest furniture-sentence
-  (let [expr (generate-with-medium {:synsem {:sem {:obj {:pred :table :mod '() :spec {:def :def}
+  (let [expr (generate {:synsem {:sem {:obj {:pred :table :mod '() :spec {:def :def}
                                                          :number :sing}
                                                    :pred :in-front-of
                                                    :subj {:pred :chair :mod '() :spec {:def :def}


Split reduce arguments to multiple lines

--- boot/worker/src/boot/jgit.clj
+++ boot/worker/src/boot/jgit.clj
@@ -72,7 +72,9 @@
                 (condp instance? t
                   ObjectIdRef$PeeledTag (assoc m (subs (.getName t) 10) (.getName (.getPeeledObjectId (.peel r t))))
                   ObjectIdRef$Unpeeled (assoc m (subs (.getName t) 10) (.getName (.getObjectId (.peel r t))))
-                  ObjectIdRef$PeeledNonTag m)) {} (.call (.tagList repo))))))
+                  ObjectIdRef$PeeledNonTag m))
+              {}
+              (.call (.tagList repo))))))

 (defn tag
   [name message]


Add aln test

Add aln test

--- test/clj_bwa/t_core.clj
+++ test/clj_bwa/t_core.clj
@@ -1,4 +1,5 @@
 (ns clj-bwa.t-core
+  "Tests for clj-bwa.core."
   (:require [midje.sweet :refer :all]
             [clojure.java.io :as io]
             [me.raynes.fs :as fs]
@@ -9,7 +10,7 @@
   `(binding [*out* (clojure.java.io/writer ~f)]
      ~@body))

-(def temp-dir (.getPath (io/file (System/getProperty "java.io.tmpdir") "cljam-test")))
+(def temp-dir (.getPath (io/file (System/getProperty "java.io.tmpdir") "clj-bwa-test")))

 (defn prepare-cache!
   []
@@ -24,8 +25,21 @@
       (.delete dir))))

 (def temp-out (str temp-dir "/out"))
+
+;; Test resources
+;; --------------
+
 (def test-fa-file "test-resources/test.fa")
+(def test-db-files ["test-resources/test.fa.amb"
+                    "test-resources/test.fa.ann"
+                    "test-resources/test.fa.bwt"
+                    "test-resources/test.fa.pac"])
+(def test-fq-file "test-resources/test.fq")
+
 (def temp-fa-file (str temp-dir "/test.fa"))
+
+;; index test
+;; ----------

 (with-state-changes [(before :facts (do (prepare-cache!)
                                         (fs/copy test-fa-file
@@ -39,5 +53,19 @@
     (with-out-file temp-out
       (bwa/index temp-fa-file (str temp-dir "/test3.fa") :is false)) => anything
     (with-out-file temp-out
-      (bwa/index temp-fa-file (str temp-dir "/test4.fa") :auto true)) => anything
-      ))
+      (bwa/index temp-fa-file (str temp-dir "/test4.fa") :auto true)) => anything))
+
+;; aln test
+;; --------
+
+(with-state-changes [(before :facts (do (prepare-cache!)
+                                        (doseq [f test-db-files]
+                                          (fs/copy f (str temp-dir "/" (fs/base-name f))))
+                                        (fs/copy test-fq-file (str temp-dir "/test.fq"))))
+                     (after :facts (clean-cache!))]
+  (fact "about aln"
+    (with-out-file temp-out
+      (bwa/aln (str temp-dir "/test.fa")
+               (str temp-dir "/test.fq")
+               (str temp-dir "/test.sai")
+               (bwa/aln-option))) => anything))


Fix issue with checking args when there are none

--- boot/core/src/boot/cli.clj
+++ boot/core/src/boot/cli.clj
@@ -146,8 +146,9 @@
                   (partition-by string?)
                   (mapcat (partial take 2))
                   (filter symbol?))]
-    (assert (apply distinct? opts) "cli options must be unique")
-    (assert (not-any? #{'h 'help} opts) "the -h/--help cli option is reserved")))
+    (when (seq opts)
+      (assert (apply distinct? opts) "cli options must be unique")
+      (assert (not-any? #{'h 'help} opts) "the -h/--help cli option is reserved"))))

 (defmacro clifn [& forms]
   (let [[doc argspecs & body]


[#1949] Auth "GET /visualisations/:id" (coming and outcoming data!)

--- backend/src/akvo/lumen/endpoint/visualisation.clj
+++ backend/src/akvo/lumen/endpoint/visualisation.clj
@@ -52,10 +52,16 @@
    ;; todo: fix path routing inconsistency here
    ["/:id" ["" {:get {:parameters {:path-params {:id string?}}
                       :handler (fn [{tenant :tenant
+                                     auth-service :auth-service
                                      {:keys [id]} :path-params}]
-                                 (if-let [res (visualisation/fetch (p/connection tenant-manager tenant) id)]
-                                     (lib/ok res)
-                                     (lib/not-found {:error "Not found"})))}
+                                 (if (p/allow? auth-service (l.auth/ids ::visualisation.s/id id))
+                                   (if-let [res (visualisation/fetch (p/connection tenant-manager tenant) id)]
+                                     (let [ids (l.auth/ids ::visualisation.s/visualisation res)]
+                                       (if (p/allow? auth-service ids)
+                                        (lib/ok res)
+                                        (lib/not-authorized ids)))
+                                     (lib/not-found {:error "Not found"}))
+                                   (lib/not-authorized {:id id})))}
                   :put {:parameters {:body map?
                                      :path-params {:id string?}}
                         :handler (fn [{tenant :tenant


spinner that doesn't spin

spinner that doesn't spin

--- frontend/components/common.cljs
+++ frontend/components/common.cljs
@@ -85,6 +85,7 @@
    :pass {:paths [(:turn ico-paths (:check ico-paths))]}
    :fail {:paths [(:turn ico-paths) (:times ico-paths)]}
    :queued {:paths [(:turn ico-paths) (:clock ico-paths)]}
+   :logo-light {:paths [(:slim_turn ico-paths) (:slim_circle ico-paths)]}
    :busy-light {:paths [(:slim_turn ico-paths) (:slim_circle ico-paths)]
                 :d "600ms"
                 :v "0 50 50;360 50 50"


data dependencies

data dependencies

--- frontend/components/errors.cljs
+++ frontend/components/errors.cljs
@@ -1,5 +1,7 @@
 (ns frontend.components.errors
   (:require [frontend.state :as state]
+            [frontend.async :refer [put!]]
+            [frontend.components.common :as common]
             [frontend.utils :as utils :include-macros true]
             [frontend.utils.github :as gh-utils]
             [om.core :as om :include-macros true])
@@ -12,7 +14,8 @@
       (let [status (get-in app [:navigation-data :status])
             logged-in? (get-in app state/user-path)
             build-page? (get-in app [:navigation-data :build-page?])
-            dashboard-page? (get-in app [:navigation-data :dashboard-page?])]
+            dashboard-page? (get-in app [:navigation-data :dashboard-page?])
+            controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.page.error
           [:div.banner


Make main vararg

Make main vararg

--- src/clojure/funcatron/tron/routers/shim_router.clj
+++ src/clojure/funcatron/tron/routers/shim_router.clj
@@ -265,7 +265,7 @@

 (defn -main
   "The uberjar entrypoint"
-  [args]
+  [& args]
   (run-server)
   (setup 54657)
   )


Remove incorrected docstring sentence.

Remove incorrected docstring sentence.

--- src/main/clojure/clojure/test/check/rose_tree.cljc
+++ src/main/clojure/clojure/test/check/rose_tree.cljc
@@ -86,8 +86,7 @@

 (defn filter
   "Returns a new Rose tree whose values pass `pred`. Values who
-  do not pass `pred` have their children cut out as well.
-  Takes a list of roses, not a rose"
+  do not pass `pred` have their children cut out as well."
   {:no-doc true}
   [pred rose]
   (make-rose (root rose)


Rename seasons atom to chapters

Rename seasons atom to chapters

--- src/teach_by_friends/shared/scenes/new_design.cljs
+++ src/teach_by_friends/shared/scenes/new_design.cljs
@@ -3,7 +3,7 @@
 						[clojure.string :as string]
 						[reagent.core :as r]))

-(defn nav-bar [seasons]
+(defn nav-bar []
 	[ui/view {:style {:flex             3
 										:flex-direction   "row"
 										:align-items      "center"
@@ -16,7 +16,7 @@
 		[ui/text {:style {:color     "white"
 											:font-size 30}}
 		 (string/upper-case
-			 (str "season " (:title (first (filter #(:active? %) seasons)))))]]
+			 (str "season " "one"))]]
 	 [ui/view {:style {:flex        1
 										 :align-items "center"}}
 		[ui/text {:style {:color "white"}} "S"]]])
@@ -61,7 +61,7 @@
 						 seasons-list))]))

 (defn new-design-scene []
-	(let [seasons (r/atom '({:active? false
+	(let [chapters (r/atom '({:active? false
 													 :title   "one"}
 													 {:active? false
 														:title   "two"}
@@ -85,8 +85,8 @@
 			[ui/view {:style {:flex           1
 												:flex-direction "column"
 												:align-items    "stretch"}}
-			 [nav-bar @seasons]
-			 [seasons-bar @seasons #(swap! seasons (fn [a]
+			 [nav-bar]
+			 [seasons-bar @chapters #(swap! chapters (fn [a]
 																							 (->> a
 																										(map-indexed (fn [index i] (assoc i :active? (= index %)))))))]
 			 [ui/scroll-view {:style {:flex 12}}]])))


Refactor namespace

Refactor namespace

--- jar-prslib/src/clj/sixsq/slipstream/prs/core.clj
+++ jar-prslib/src/clj/sixsq/slipstream/prs/core.clj
@@ -5,7 +5,7 @@
   {:doc/format :markdown}
   (:require
     [clojure.data.json :as json]
-    [sixsq.slipstream.client.api.utils.http-sync :as http]
+    [sixsq.slipstream.client.impl.utils.http-sync :as http]
     [clojure.tools.logging :as log]))

 (defn call-prs


0.1.0-snapshot doesn't exist on clojars

0.1.0-snapshot doesn't exist on clojars

--- labs/architecture-examples/om/project.clj
+++ labs/architecture-examples/om/project.clj
@@ -8,7 +8,7 @@
                  [org.clojure/clojurescript "0.0-2138"]
                  [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                  [secretary "0.4.0"]
-                 [om "0.1.0-SNAPSHOT"]]
+                 [om "0.1.5"]]

   :plugins [[lein-cljsbuild "1.0.1"]]


fix gnupg

fix gnupg

--- main/src/dda/pallet/dda_user_crate/infra/gpg.clj
+++ main/src/dda/pallet/dda_user_crate/infra/gpg.clj
@@ -83,10 +83,10 @@
       :script-env {:HOME user-home}}
      (actions/exec-checked-script
       "import & trust gpg key"
-      ("echo" "$(whoami)" ">" "log.txt")
-      ("gpgconf" "--kill" "gpg-agent")
-      ("gpgconf" "--launch" "gpg-agent")
-      ("gpg" "--import" ~(str user-home "/pub.key"))
-      ("echo" ~passphrase "|" "/usr/lib/gnupg/gpg-preset-passphrase" "--preset" ~public-key-id)
-      ("gpg" "--batch" "--import" ~(str user-home "/priv.key"))
-      ("/usr/lib/gpg-trust-all.sh")))))
+      ("su" ~user-name "-c" "\"gpg" "--import" ~(str user-home "/pub.key\""))
+      ("su" ~user-name "-c" "\"gpgconf" "--kill" "gpg-agent\"")
+      ("su" ~user-name "-c" "\"gpgconf" "--launch" "gpg-agent\"")
+      ("su" ~user-name "-c" "\"echo" ~passphrase "|"
+            "/usr/lib/gnupg/gpg-preset-passphrase" "--preset" ~public-key-id "\"")
+      ("su" ~user-name "-c" "\"gpg" "--batch" "--import" ~(str user-home "/priv.key\""))
+      ("su" ~user-name "-c" "\"/usr/lib/gpg-trust-all.sh\"")))))


CMR-1805: Removed unneeded bindings

CMR-1805: Removed unneeded bindings

--- search-app/src/cmr/search/services/query_service.clj
+++ search-app/src/cmr/search/services/query_service.clj
@@ -154,8 +154,7 @@
   "Executes a search for concepts using the given parameters. The concepts will be returned with
   concept id and native provider id along with hit count and timing info."
   [context concept-type params]
-  (let [all-revisions-index? (= "true" (:all-revisions params))
-        [query-creation-time query] (u/time-execution
+  (let [[query-creation-time query] (u/time-execution
                                       (->> params
                                            sanitize-params
                                            ;; handle legacy parameters
@@ -175,8 +174,7 @@
   "Executes a search for concepts using the given JSON. The concepts will be returned with
   concept id and native provider id along with hit count and timing info."
   [context concept-type params json-query]
-  (let [all-revisions-index? (= "true" (:all-revisions params))
-        [query-creation-time query] (u/time-execution
+  (let [[query-creation-time query] (u/time-execution
                                       (-> (jp/parse-json-query concept-type
                                                                (sanitize-params params)
                                                                json-query)))


fixed accessors

fixed accessors

--- src/org/domaindrivenarchitecture/pallet/crate/user.clj
+++ src/org/domaindrivenarchitecture/pallet/crate/user.clj
@@ -54,15 +54,15 @@

 (defn users-authorized-key-ids
   [username-key global-config]
-  (:authorized-key-ids username-key :authorized-key-ids global-config))
+  (-> global-config :os-user username-key :authorized-key-ids))

 (defn ssh-key-config
   [global-config]
-  (:ssh-keys global-config))
+  (-> global-config :ssh-keys))

 (defn pallet-user-encrypted-password
   [username-key global-config]
-  (:encrypted-password username-key :os-user global-config)
+  (-> global-config :os-user username-key :encrypted-password)
   )

 (defn add-authorized-keys-to-user


Fix typo in comment.

Fix typo in comment.

--- clstreams/test/clstreams/kstreams/serdes_test.clj
+++ clstreams/test/clstreams/kstreams/serdes_test.clj
@@ -29,7 +29,7 @@

 (deftest test-edn-serde
   (let [serde (sut/edn-serde)]
-    ; These check should work without =, but an apparent bug makes
-    ; them fail mysteriously.
+    ; These checks should work without =, but an apparent bug makes
+    ; them fail misteriously.
     (is (= (instance? EDNSerializer (.serializer serde)) true))
     (is (= (instance? EDNDeserializer (.deserializer serde)) true))))


Updating

Updating

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject tsmarsh/stl-collector "0.2.0"
+(defproject tsmarsh/stl-collector "0.2.1"
   :description "Library for collecting multiple STL files into a single STL file"
   :url "http://tailoredshapes.com/"
   :license {:name "BSD"


Drop down to :whitespace optimization

Drop down to :whitespace optimization

:advanced was causing a problem in the code, not sure why.

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


Update project version to 0.2.0.

Update project version to 0.2.0.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject stencil "0.2.0-SNAPSHOT"
+(defproject stencil "0.2.0"
   :description "Mustache in Clojure"
   :dependencies [[clojure "1.3.0"]
                  [slingshot "0.8.0"]]


version 0.0.4

version 0.0.4

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject ads-txt-crawler "0.0.3"
+(defproject ads-txt-crawler "0.0.4"
   :description "An implementation of a crawler for Ads.txt files written in Clojure"
   :url "https://github.com/bradlucas/ads-txt-crawler"
   :license {:name "Eclipse Public License"


0.3.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sormilla "0.2.1-SNAPSHOT"
+(defproject sormilla "0.3.0"
   :dependencies [[org.clojure/clojure "1.5.1"]
                  [rogerallen/leaplib "0.8.1"]
                  [rogerallen/leaplib-natives "0.8.1"]


shorten the copy a bit

shorten the copy a bit

--- src-cljs/frontend/components/integrations.cljs
+++ src-cljs/frontend/components/integrations.cljs
@@ -231,7 +231,7 @@
                     :target "_blank"
                     :role "button"}
                 "Slack's integrations page"]
-               ", then scroll to the end and add a new incoming webhook. "
+               ", scroll to the end and add a new incoming webhook. "
                "Choose a channel, create the hook, then copy the webhook url."]]
              (om/build slack-form app)))
           (for [slack-hook hooks]


Hide OSS containers message in Enterprise.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -862,9 +862,10 @@
               (when-not piggiebacked?
                 (list " at $" container-cost " per container"))
               " for more parallelism and shorter queue times."))])
-        (when  (pm/freemium? plan)
+        (when (pm/freemium? plan)
           [:p (str (pm/freemium-containers plan) " container is free, forever.")])
-        [:p "Additionally, projects that are public on GitHub will build with " pm/oss-containers " extra containers -- our gift to free and open source software."]]]))))
+        (when-not (config/enterprise?)
+          [:p "Additionally, projects that are public on GitHub will build with " pm/oss-containers " extra containers -- our gift to free and open source software."])]]))))

 (def main-component
   {:overview overview


Version 0.1.0

Version 0.1.0

--- metlog-agent/project.clj
+++ metlog-agent/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-agent "0.1.0-SNAPSHOT"
+(defproject metlog-agent "0.1.0"
   :description "Metlog agent - polls data sources for upload to vault."

   :license {:name "Eclipse Public License"


(MAINT) Allow stderr/out in combined output test to be in either order

Previously, the `combines-stderr-and-stdout-correctly` test expected the
output order in which stderr and stdout was captured to match the order
in which the spawned executable wrote to each stream.  The order in
which the Java process receives content from the streams, however, is
not guaranteed to match the order in which the content was originally
written.  For this reason, the test was changed to allow the content
from the streams to arrive in either order.

--- test/unit/puppetlabs/puppetserver/shell_utils_test.clj
+++ test/unit/puppetlabs/puppetserver/shell_utils_test.clj
@@ -47,7 +47,14 @@
                                                  " baz")
                                             options)]
      (testing "combined info echoed to stdout and stderr captured as output"
-       (is (= "to out: baz\nto err: baz\n" (.getOutput results))))
+       (let [output (.getOutput results)]
+         ;; Allow stdout and stderr messages to come in either order since
+         ;; the order in which they are read from the different stream
+         ;; consuming threads is not reliable.
+         (is (or (= "to out: baz\nto err: baz\n" output)
+                 (= "to err: baz\nto out: baz\n" output))
+             (format "Output produced, '%s', did not match expected output"
+                     output))))
      (testing "only info echoed to stderr captured as error"
        (is (= "to err: baz\n" (.getError results))))
      (testing "only stderr info (and not stdout info) is logged"


Fully qualifying the sh call for use under lein run


More --help cleanup

More --help cleanup

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- testdata/example02/client/cljs/src/example02/main.cljs
+++ testdata/example02/client/cljs/src/example02/main.cljs
@@ -48,9 +48,9 @@
 (defn prep-usage [msg] (->> msg flatten (string/join \newline)))

 (defn usage [options-summary]
-  (prep-usage ["Usage: example02 [general-options]"
+  (prep-usage ["Usage: example02 [options]"
                ""
-               "General Options:"
+               "Options Summary:"
                options-summary
                ""
                ]))


loading docker

loading docker

--- src/celestial/workflows.clj
+++ src/celestial/workflows.clj
@@ -17,7 +17,8 @@
     [slingshot.slingshot :only  [throw+ try+]]
     [celestial.model :only (vconstruct pconstruct rconstruct)])
   (:require ; loading defmethods
-    proxmox.provider aws.provider vc.provider physical.provider
+    proxmox.provider aws.provider vc.provider
+    physical.provider docker.provider
     celestial.puppet_standalone
     remote.capistrano remote.ruby
     [celestial.persistency :as p]


add setval convenience function to api

add setval convenience function to api

--- src/clj/com/rpl/specter.clj
+++ src/clj/com/rpl/specter.clj
@@ -55,6 +55,8 @@
                  (apply update-fn (conj vals structure)))
                ))))

+(defn setval [selector val structure]
+  (update selector (fn [_] val) structure))

 (defn replace-in [selector update-fn structure & {:keys [merge-fn] :or {merge-fn concat}}]
   "Returns [new structure [<user-ret> <user-ret>...]"


Uppercase IDX field on serialization

Uppercase IDX field on serialization

--- src/cljam/io/vcf/writer.clj
+++ src/cljam/io/vcf/writer.clj
@@ -70,7 +70,7 @@
         (:url m) (conj (str "URL=" (:url m)))
         (:species m) (conj (str "species=\"" (:species m) "\""))
         (:taxonomy m) (conj (str "taxonomy=" (:taxonomy m)))
-        (:idx m) (conj (str "idx=" (:idx m))))
+        (:idx m) (conj (str "IDX=" (:idx m))))
       (pack-meta-info m [:id :length :assembly :md-5 :url :species :taxonomy :idx])))

 (defn- stringify-meta-info-info
@@ -82,7 +82,7 @@
       (cond->
         (:source m) (conj (str "Source=\"" (:source m) "\""))
         (:version m) (conj (str "Version=\"" (:version m) "\""))
-        (:idx m) (conj (str "idx=" (:idx m))))
+        (:idx m) (conj (str "IDX=" (:idx m))))
       (pack-meta-info m [:id :number :type :description :source :version :idx])))

 (defn- stringify-meta-info-filter
@@ -90,7 +90,7 @@
   (-> [(str "ID=" (:id m))
        (str "Description=\"" (:description m) "\"")]
       (cond->
-        (:idx m) (conj (str "idx=" (:idx m))))
+        (:idx m) (conj (str "IDX=" (:idx m))))
       (pack-meta-info m [:id :description :idx])))

 (defn- stringify-meta-info-format
@@ -100,7 +100,7 @@
        (str "Type=" (nil->dot (:type m)))
        (str "Description=\"" (:description m) "\"")]
       (cond->
-        (:idx m) (conj (str "idx=" (:idx m))))
+        (:idx m) (conj (str "IDX=" (:idx m))))
       (pack-meta-info m [:id :number :type :description :idx])))

 (defn- stringify-meta-info-alt


Whitespace fix

Whitespace fix

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -43,9 +43,9 @@
 (def transit-writer
   (transit/writer :json
                   {:handlers
-                   {goog.Uri                   (dato-transit/URIHandler.)
-                    datascript.core/Datom      (dato-transit/DatomHandler.)
-                    datascript.btset/Iter (transit/VectorHandler.) }}))
+                   {goog.Uri              (dato-transit/URIHandler.)
+                    datascript.core/Datom (dato-transit/DatomHandler.)
+                    datascript.btset/Iter (transit/VectorHandler.)}}))

 (defn tx-report->transaction [report]
   (mapv dsu/datom->transaction (:tx-data report)))


Added possibility to draw single points

Added possibility to draw single points

--- src/cljs/drawer/canvas.cljs
+++ src/cljs/drawer/canvas.cljs
@@ -97,13 +97,23 @@
   (let [points (obj :points2d)
         start (points 0)]
     (.beginPath ctx)
-    (.moveTo ctx (start 0) (start 1))
-    (doseq [point points]
-      (.lineTo ctx (point 0) (point 1)))
-    (.lineTo ctx (start 0) (start 1))
-    (.stroke ctx)
-    (.closePath ctx)
-    (draw-center obj ctx)))
+    (condp = (count points)
+      1 (do (.arc ctx (start 0) (start 1) 2 0 (* 2 (.-PI js/Math)))
+            (.stroke ctx)
+            (.closePath ctx))
+      2 (do (.moveTo ctx (start 0) (start 1))
+            (.lineTo ctx ((points 1) 0) ((points 1) 1))
+            (.stroke ctx)
+            (.closePath ctx)
+            (draw-center obj ctx))
+      ;; More than 2 points
+      (do (.moveTo ctx (start 0) (start 1))
+          (doseq [point points]
+            (.lineTo ctx (point 0) (point 1)))
+          (.lineTo ctx (start 0) (start 1))
+          (.stroke ctx)
+          (.closePath ctx)
+          (draw-center obj ctx)))))

 (defn- clear
   "Clear the canvas but keep its settings."


Dead code

Dead code

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -8,8 +8,6 @@
 (def board-width 16)
 (def board-height 11)
 (def init-block-count 12) ;; Init blocks for red, blue, green, gray
-
-(def scale-factor 100)

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


Latest changes.

Latest changes.

--- src/cljx/numerics/roots.clj
+++ src/cljx/numerics/roots.clj
@@ -3,16 +3,16 @@
 (defn early-exit [xfx] (when (== 0 (second xfx)) xfx))

 (defn bracket [step-func f bounds tol]
-  (let [[l u :as lu] (map (juxt identity f) bounds)]
-    (or (early-exit l) (early-exit u)
+  (let [lu (map (juxt identity f) bounds)]
+    (or (some identity (map early-exit lu))
         (when (neg? (apply * (map second lu)))
-          (loop [[xl fxl :as l] l [xu _ :as u] u]
-            (let [[_ fxm :as m] (step-func f l u)]
+          (loop [[l u] lu]
+            (let [m (step-func f l u)]
               (cond
-                (== 0.0 fxm) m
-                (<= (Math/abs (- xl xu)) tol) (min-key #(-> % second Math/abs) l m u)
-                (neg? (* fxl fxm)) (recur l m)
-                :else (recur m u))))))))
+                (early-exit m) m
+                (<= (Math/abs (- (l 0) (u 0))) tol) (min-key #(-> % second Math/abs) l m u)
+                (neg? (* (l 1) (m 1))) (recur [l m])
+                :else (recur [m u]))))))))

 (defn midpoint [f [xl _] [xh _]] ((juxt identity f) (* 0.5 (+ xl xh))))
 (defn secant [f [xl fxl] [xh fxh]] ((juxt identity f) (- xh (/ (* fxh (- xh xl)) (- fxh fxl)))))
@@ -22,10 +22,13 @@

 (prn (bisect #(+ 0.1 (Math/sin %)) [-1 1] 1E-10))
 (prn (bisect #(Math/sin %) [0.4 1] 1E-10))
+(prn (bisect #(Math/sin %) [-1 1] 1E-10))
 (prn (bisect #(Math/sin %) [0 1] 1E-10))
 (prn (bisect #(Math/sin %) [0 0] 1E-10))
+(prn (bisect #(Math/sin %) [-9 0] 1E-10))
 (prn (false-pos #(Math/sin %) [-3 0] 1E-10))
 (prn (false-pos #(+ 0.1 (Math/sin %)) [-1 1] 1E-10))
+(prn (false-pos #(+ 0.1 (Math/tan %)) [-1 1] 1E-10))

 (defn secant-step
   ([f x dx] (secant-step [f [x (f x)] [(+ x dx) (f (+ x dx))]]))


Calculation of compatible subcontexts of a reduced context added.

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -6,7 +6,8 @@
    :constructors { [ Object Object Object ] [] }
    :state state)
   (:use [clojure.contrib.str-utils :only (str-join)]
-	conexp.base))
+	conexp.base)
+  (:require [clojure.contrib.graph :as graph]))

 (defn Context-init [objects attributes incidence]
   [ [] {:objects objects :attributes attributes :incidence incidence} ])
@@ -526,4 +527,37 @@
 				     (I_2 [g_2,m_2]))])]
     (make-context new-objs new-atts new-inz)))

+(defn compatible-subcontexts
+  "Returns all compatible subcontexts of ctx. ctx has to be reduced."
+  [ctx]
+  (if (not (reduced? ctx))
+    (illegal-argument "Context given to compatible-subcontexts has to be reduced."))
+  (let [up-arrows        (up-arrows ctx)
+	down-arrows      (down-arrows ctx)
+	subcontext-graph (graph/transitive-closure
+			  (struct graph/directed-graph
+				  (disjoint-union (objects ctx) (attributes ctx))
+				  (fn [[x idx]]
+				    (condp = idx
+				      0 (for [[g m] up-arrows
+					      :when (= g x)]
+					  [m 1])
+				      1 (for [[g m] down-arrows
+					      :when (= m x)]
+					  [g 0])))))
+	down-down        (set-of [g m] [m (attributes ctx)
+					[g idx] (graph/get-neighbors subcontext-graph [m 1])
+					:when (= idx 0)])
+	compatible-ctx   (make-context (objects ctx)
+				       (attributes ctx)
+				       (fn [g m]
+					 (not (contains? down-down [g m]))))]
+    (for [[G-H N] (concepts compatible-ctx)]
+      (let [objs (difference (objects ctx) G-H)
+	    atts N
+	    inz  (set-of [g m] [[g m] (incidence ctx)
+				:when (and (contains? objs g)
+					   (contains? atts m))])]
+	(make-context objs atts inz)))))
+
 nil


Aligned relations type-methods and aspect-super+ in terms of type erasure and itds.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -398,21 +398,15 @@
     (equals ?methods (vec (.getDeclaredMethods ?resolvedtype)))))

-;TODO: configured not to erase generic types (first boolean),
-;      and not to consider declare parent itds
-;      -> current reasoning: no equivalent for fields+
-;
-;      might want to reconsider
-;      (note that there is also an unrelated ITD getter)
 (defn
   type-methods+
   "Relation between a type and all of its declared and inherited methods (as known to the weaver).
-   Does not include methods added through an ITD."
+   Includes methods added through an ITD."
   ;;see org.apectj.weaver.ResolvedType.getMethods(boolean wantGenerics, boolean wantDeclaredParents)
   [?resolvedtype ?methods]
   (all
     (type ?resolvedtype)
-    (equals ?methods (vec (iterator-seq (.getMethods ?resolvedtype true false))))))
+    (equals ?methods (vec (iterator-seq (.getMethods ?resolvedtype true true))))))

 (defn
   type-method
@@ -472,8 +466,6 @@
 ;  type-member
 ;  "Relation between a type and one of its declared members as known to the weaver."

-
-
 (defn-
   resolvedmember-synthetic?
   [?resolvedmember ?syntheticbool]
@@ -559,7 +551,7 @@
     (succeeds (.isClass  ?ancestor))))

-;todo: wantgenerics is false, check whether this is compatible with the types returned by the other predicates
+;todo: wantgenerics is true, check whether this is compatible with the types returned by the other predicates
 ;(i.e., test with a parameterized aspec)
 (defn
   aspect-super+
@@ -570,7 +562,7 @@
   (all
     (!= ?type ?aspect)
     (aspect ?aspect)
-    (contains (iterator-seq (.getHierarchy ?aspect false true)) ?type)))
+    (contains (iterator-seq (.getHierarchy ?aspect true true)) ?type)))

 (defn
   aspect-superaspect+


use schemas

use schemas

--- src/ctia/flows/autoload.clj
+++ src/ctia/flows/autoload.clj
@@ -1,9 +1,9 @@
 (ns ctia.flows.autoload
   (:require
    [leiningen.core.project :as p]
+   [schema.core :as s]
    [ctia.flows.hooks :as h]
-   [ctia.flows.hook-protocol :refer [Hook]]
-   ))
+   [ctia.flows.hook-protocol :refer [Hook]]))

 (defrecord ProxyJ [o]
   Hook
@@ -12,9 +12,10 @@
     (h/from-java-handle o type-name stored-object prev-object))
   (destroy [_] (doto (.destroy o))))

-(defn add-record
+(s/defn add-record :- (s/eq nil)
   "Given a `record` symbol it load it "
-  [hook-cls hook-type]
+  [hook-cls :- s/Symbol
+   hook-type :- s/Keyword]
   (let [hook-obj (do (eval `(do
                               (require '[~(symbol
                                            (first (clojure.string/split (str hook-cls) #"/")))])
@@ -24,24 +25,28 @@
       (binding [*out* *err*]
         (println hook-cls " doesn't satisfies `ctia.flows.hooks/Hook` protcol!")))))

-(defn add-java-class [hook-cls hook-type]
+(s/defn add-java-class :- (s/eq nil)
+  "Add a java class as Hook"
+  [hook-cls :- s/Symbol
+   hook-type :- s/Keyword]
   (let [hook-obj (eval `(new ~hook-cls))]
-    (cond
-      (instance? ctia.Hook hook-obj) (h/add-hook! hook-type (ProxyJ. hook-obj))
-      :else (binding [*out* *err*]
-              (println hook-cls "isn't an instance of `ctia.Hook`!")))))
+    (if (instance? ctia.Hook hook-obj)
+      (h/add-hook! hook-type (ProxyJ. hook-obj))
+      (binding [*out* *err*]
+        (println hook-cls "isn't an instance of `ctia.Hook`!")))))

-(defn load-hooks! [hooks]
+(s/defn load-hooks! :- (s/eq nil)
+  [hooks :- [{s/Keyword s/Symbol}]]
   (doseq [[hook-type hook-classes] hooks]
     (doseq [hook-cls hook-classes]
       (if (.contains (str hook-cls) "/")
         (add-record hook-cls hook-type)
         (add-java-class hook-cls hook-type)))))

-(defn autoload-hooks!
+(s/defn autoload-hooks! :- (s/eq nil)
   "Should retrieve a list of Hook classes from `project.cljs`.
   All these classes must implement the `Hook` java interface."
   ([] (load-hooks! (:hooks-classes (p/read))))
-  ([profiles] (load-hooks! (:hooks-classes (try (p/read "project.clj" profiles)
+  ([profiles :- [s/Keyword]] (load-hooks! (:hooks-classes (try (p/read "project.clj" profiles)
                                                 (finally
                                                   nil))))))


Add smart spacing for adapters that follow up on eachother

--- src/gigrig/positioning.cljs
+++ src/gigrig/positioning.cljs
@@ -30,6 +30,9 @@
   (some (partial = (gzip/loc-type loc)) (map :key ADAPTERS)))

 (defn- children-y
+  "Returns the vertical displacement for new children. Takes into
+  account other siblings that have children and adds extra
+  displacement to prevent collision"
   [loc]
   (let [branches-to-the-right
         (count (filter #(some (partial = (first %)) [:distributor :isolator]) (zip/rights loc)))]
@@ -37,10 +40,22 @@
       ADAPTER-OFFSET
       (+ CHILDREN-OFFSET (* branches-to-the-right CHILD-VERTICAL-STEP)))))

+(defn child-x
+  "Returns the x position for a child. Takes into account other
+  siblings and their children"
+  [loc]
+  (max
+   ;; The x value of the right wall of the sibling to the left
+   (box/right (-> loc zip/left gzip/box-meta))
+   ;; The x value of the right wall of the previous sibling's child if adapter
+   (when (adapter? (zip/left loc))
+     (+ 7 (box/right (if-let [child (-> loc zip/left zip/down)]
+                       (-> child gzip/box-meta)))))))
+
 (defn- align
   "Calculates the box data for the given child"
   [loc x y]
-  (let [x (+ CHILD-SPACING (if (= (zip/leftmost loc) loc) x (box/right (-> loc zip/left gzip/box-meta))))
+  (let [x (+ CHILD-SPACING (if (= (zip/leftmost loc) loc) x (child-x loc)))
         new-loc (gzip/set-meta loc (box loc x y))]
     (if (zip/branch? new-loc)
       (emplace new-loc x y)


cleanup

cleanup

--- backend/test/lambdaui/common/summaries_test.clj
+++ backend/test/lambdaui/common/summaries_test.clj
@@ -1,9 +1,7 @@
 (ns lambdaui.common.summaries-test
   (:use [clojure.test]
         [lambdaui.fixtures.pipelines])
-  (:require [lambdaui.common.summaries :as testee]
-
-            )
+  (:require [lambdaui.common.summaries :as testee])
   (:import (org.joda.time DateTime)))

 (deftest summaries-test


CMR-4384: Added comment.

CMR-4384: Added comment.

--- indexer-app/src/cmr/indexer/data/concepts/variable.clj
+++ indexer-app/src/cmr/indexer/data/concepts/variable.clj
@@ -15,8 +15,9 @@
         {:keys [variable-name measurement]} extra-fields
         science-keywords (mapcat science-keyword-util/science-keyword->keywords
                                  (:ScienceKeywords parsed-concept))
-        keyword-text (keyword-util/field-values->keyword-text
-                      (flatten (conj [variable-name measurement] science-keywords)))]
+        ;; keyword values that are used to index the keyword field
+        keyword-values (flatten (conj [variable-name measurement]
+                                      science-keywords))]
     (if deleted
       ;; This is only called by re-indexing (bulk indexing)
       ;; Regular deleted variables would have gone through the index-service/delete-concept path.
@@ -31,7 +32,7 @@
        :provider-id.lowercase (string/lower-case provider-id)
        :native-id native-id
        :native-id.lowercase (string/lower-case native-id)
-       :keyword keyword-text})))
+       :keyword (keyword-util/field-values->keyword-text keyword-values)})))

 (defn- variable-association->variable-concept
   "Returns the variable concept and variable association for the given variable association."


Fix sequence printing bug

Fix sequence printing bug

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@8124 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- buildscripts/buildcheck/src/buildcheck/core.clj
+++ buildscripts/buildcheck/src/buildcheck/core.clj
@@ -1,5 +1,7 @@
 (ns buildcheck.core
-  (:import (java.io File))
+  (:import (java.io File)
+           (java.text SimpleDateFormat)
+           (java.util Calendar Date))
   (:use [local-file :only (file*)]
         [clj-mail.core])
   (:gen-class))
@@ -7,6 +9,16 @@
 (def micromanager (file* "../.."))

 (def MS-PER-HOUR (* 60 60 1000))
+
+(def today-token
+  (let [format (SimpleDateFormat. "yyyyMMdd")
+        one-hour-ago (doto (Calendar/getInstance)
+                       (.add Calendar/HOUR -1))]
+    (.format format (.getTime one-hour-ago))))
+
+(def yyyymmdd (SimpleDateFormat. "yyyyMMdd"))
+
+(doto (Calendar/getInstance) (.add Calendar/HOUR -1))

 (defn result-file [bits mode]
   (File. micromanager (str "/result" bits (name mode) ".txt")))
@@ -19,8 +31,6 @@
   (for [error errors]
     (let [prefix (ffirst (re-seq #"\n([1-9]|[0-9][1-9]|[0-9][0-9][1-9])>" error))
           pattern (re-pattern (str prefix "[^\\n]+"))]
-      (println prefix)
-      (println "pattern:" pattern)
       (when prefix
           (re-seq (re-pattern pattern) result-text)))))

@@ -56,6 +66,14 @@
       (file-seq dir))
     time-limit-hours))

+(defn exe-on-server? [bits date-token]
+  (let [txt (slurp "http://valelab.ucsf.edu/~MM/nightlyBuilds/1.4/Windows/")
+        pattern (re-pattern (str "MMSetup" bits "BIT_[^\\s]+?_" date-token ".exe"))]
+    (re-find pattern txt)))
+
+(defn str-lines [sequence]
+  (apply str (interpose "\n" sequence)))
+
 (defn report-build-errors [bits mode]
   (let [f (result-file bits mode)
         result-txt (slurp f)
@@ -65,26 +83,41 @@
                                          32 "bin_Win32"
                                          64 "bin_x64")) 24)
         javac-errs (javac-errors result-txt)
-        outdated-jars (old-jars (File. micromanager "Install_AllPlatforms") 24)]
+        outdated-jars (old-jars (File. micromanager "Install_AllPlatforms") 24)
+        installer-ok (exe-on-server? bits today-token)]
     (when-not (and (empty? vs-error-text) (empty? outdated-dlls)
-                   (empty? javac-errs) (empty? outdated-jars))
-      (println (str "\n\nMICROMANAGER " bits "-bit "
-                    ({:inc "INCREMENTAL" :full "FULL"} mode)
-                    " BUILD ERROR REPORT"))
-      (println (str "For the full build output, see " (.getAbsolutePath f)))
-      (println "\nVisual Studio reported errors:")
-      (if-not (empty? vs-error-text) (println vs-error-text) (println "None."))
-      (println "\nOutdated device adapter DLLs:")
-      (if-not (empty? outdated-dlls) (dorun (map #(println (.getName %)) outdated-dlls)) (println "None."))
-      (println "\nErrors reported by java compiler:")
-      (if-not (empty? javac-errs) (dorun (map println javac-errs)) (println "None."))
-      (println "\nOutdated jar files:")
-      (if-not (empty? outdated-jars) (dorun (map #(println (.getName %)) outdated-jars)) (println "None."))
-      )))
+                   (empty? javac-errs) (empty? outdated-jars)
+                   installer-ok)
+      (str
+        "\n\nMICROMANAGER " bits "-bit "
+          ({:inc "INCREMENTAL" :full "FULL"} mode)
+          " BUILD ERROR REPORT\n"
+        "For the full build output, see " (.getAbsolutePath f)
+        "\n\nVisual Studio reported errors:"
+        (if-not (empty? vs-error-text)
+          vs-error-text
+          "None.")
+        "\n\nOutdated device adapter DLLs:\n"
+        (if-not (empty? outdated-dlls)
+          (str-lines "\n" (map #(.getName %) outdated-dlls))
+          "None.")
+          "\n\nErrors reported by java compiler:\n"
+        (if-not (empty? javac-errs)
+          (str-lines "\n" javac-errs)
+          "None.")
+        "\n\nOutdated jar files:\n"
+        (if-not (empty? outdated-jars)
+          (str-lines "\n" (map #(.getName %) outdated-jars))
+          "None.")
+        "\n\nIs installer download available on website?\n"
+        (if installer-ok
+          "Yes"
+          "No. (build missing)\n")
+      ))))

 (defn make-full-report [mode send?]
   (let [report
-        (with-out-str
+        (str
           (report-build-errors 32 mode)
           (report-build-errors 64 mode))]
     (if-not (empty? report)


editor.jump-to should only call jump-to once

--- src/lt/objs/jump_stack.cljs
+++ src/lt/objs/jump_stack.cljs
@@ -60,5 +60,4 @@
   :hidden true
   :exec (fn [file pos]
           (when-let [ed (lt.objs.editor.pool/last-active)]
-            (object/raise jump-stack :jump-stack.push! ed file pos))
-          (jump-to file pos))})
+            (object/raise jump-stack :jump-stack.push! ed file pos)))})


CMR-4064: Added support to extract UMM version used by preview gem from the gem.

--- collection-renderer-lib/src/cmr/collection_renderer/services/collection_renderer.clj
+++ collection-renderer-lib/src/cmr/collection_renderer/services/collection_renderer.clj
@@ -3,7 +3,9 @@
    MMT ERB code along with JRuby to generate it."
   (:require
    [clojure.java.io :as io]
+   [clojure.string :as str]
    [cmr.common.lifecycle :as l]
+   [cmr.common.log :refer (debug info warn error)]
    [cmr.umm-spec.migration.version-migration :as vm]
    [cmr.umm-spec.umm-json :as umm-json]
    [cmr.umm-spec.versioning :as umm-version])
@@ -24,11 +26,13 @@
   "The main ERB used to generate the Collection HTML."
   (io/resource "collection_preview/collection_preview.erb"))

-(def preview-gem-umm-schema-version
-  "Temporay def for the UMM schema version that is supported by the CMR preview gem.
-   This will be removed once CMR preview gem is fixed to include the UMM schema version
-   it supports in the gem. (MMT-921)"
-  "1.6")
+(def preview-gem-umm-version-config-file
+  "Defines the path to the UMM schema version config file within the preview gem."
+  "gems/cmr_metadata_preview-0.0.1/.umm-version")
+
+(def default-preview-gem-umm-version
+  "Default preview gem UMM schema version in case preview gem is mis-configured."
+  "1.8")

 (defn- create-jruby-runtime
   "Creates and initializes a JRuby runtime."
@@ -37,6 +41,19 @@
                   (getEngineByName "jruby"))]
     (.eval jruby (io/reader bootstrap-rb))
     jruby))
+
+(defn- get-preview-gem-umm-version
+  "Get the UMM schema version that is defined in preview gem."
+  []
+  (try
+    (-> preview-gem-umm-version-config-file
+        io/resource
+        slurp
+        str/trim)
+    (catch Exception e
+      (error "Failed to parse preview gem UMM version, will use the default version:"
+             default-preview-gem-umm-version
+             (.printStackTrace e)))))

 ;; Allows easily evaluating Ruby code in the Clojure REPL.
 (comment
@@ -56,11 +73,14 @@
   l/Lifecycle

   (start
-    [this _system]
-    (assoc this :jruby-runtime (create-jruby-runtime)))
+   [this _system]
+   (-> this
+       (assoc :jruby-runtime (create-jruby-runtime))
+       (assoc :preview-gem-umm-version
+              (or (get-preview-gem-umm-version) default-preview-gem-umm-version))))
   (stop
-    [this _system]
-    (dissoc this :jruby-runtime)))
+   [this _system]
+   (dissoc this :jruby-runtime)))

 (defn create-collection-renderer
   "Returns an instance of the collection renderer component."
@@ -84,6 +104,10 @@
   [context]
   (get-in context [:system :public-conf :relative-root-url]))

+(defn- context->preview-gem-umm-version
+  [context]
+  (get-in context [:system system-key :preview-gem-umm-version]))
+
 (defn render-collection
   "Renders a UMM-C collection record and returns the HTML as a string."
   [context collection]
@@ -91,7 +115,7 @@
                   (vm/migrate-umm context
                                   :collection
                                   umm-version/current-version
-                                  preview-gem-umm-schema-version
+                                  (context->preview-gem-umm-version context)
                                   collection))]
     (render-erb (context->jruby-runtime context)
                 collection-preview-erb


improve docs

improve docs

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@9450 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- plugins/SlideExplorer2/src/slide_explorer/cache.clj
+++ plugins/SlideExplorer2/src/slide_explorer/cache.clj
@@ -5,18 +5,23 @@
            (java.io File)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Immutable LRU cache
+;; Immutable LRU (Least Recently Used) cache
 ;; based on, but different from, clojure.core.cache by @fogus
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn lru-map [base limit]
+(defn lru-map
+  "Factory method for producing a persistent map,
+   with metadata that allows LRU policy."
+  [base limit]
   (with-meta base
              {::lru {:limit limit
                      :tick 0
                      :priority {}}}))

 (defn remove-lru-excess [lru-map]
+  "Updates a LRU metadata map by removing the oldest item,
+   if there are too many items."
   (let [{:keys [priority tick limit]} (::lru (meta lru-map))]
     (if (<= (count lru-map) limit)
       lru-map
@@ -24,35 +29,47 @@
         (vary-meta (dissoc lru-map old-key)
                    update-in [::lru :priority] dissoc old-key)))))

-(defn hit-lru-metadata [lru-meta key]
+(defn update-lru-metadata
+  "Update a LRU metadata map to make key the most recent item."
+  [lru-meta key]
   (let [tick+ (inc (get-in lru-meta [::lru :tick]))]
     (-> lru-meta
         (assoc-in [::lru :tick] tick+)
         (update-in [::lru :priority] assoc key tick+))))

-(defn remove-item [lru-map key]
+(defn hit-item
+  "Updates lru-map's metadata so that key is the most recently used item."
+  [lru-map key]
+  (vary-meta lru-map update-lru-metadata key))
+
+(defn remove-item
+  "Remove an item from the LRU persistent map. Like dissoc."
+  [lru-map key]
   (-> lru-map
       (dissoc key val)
       (vary-meta update-in [::lru :priority] dissoc key)))

-(defn add-item [lru-map key val]
+(defn add-item
+  "Add an item to the LRU persistent map. Like assoc."
+  [lru-map key val]
   (-> lru-map
       (assoc key val)
-      (vary-meta hit-lru-metadata key)
+      (hit-item key)
       remove-lru-excess))
-
-(defn hit-item [lru-map key]
-  (vary-meta lru-map hit-lru-metadata key))
-

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; image-cache consists of an agent
 ;; that contains a map
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def file-service (Executors/newFixedThreadPool 1))
+(def file-service
+  "All file i/o runs on this thread."
+  (Executors/newFixedThreadPool 1))

-(defn- key-map-to-file-name [cache-agent key-map]
+(defn- key-map-to-file-name
+  "Convert the map used as a key in image cache to a file name. Uses
+   the directory stored in the agent's metadata."
+  [cache-agent key-map]
   (let [dir (-> cache-agent meta ::cache :directory)]
     (str dir "/"
          (apply str
@@ -61,35 +78,43 @@
          ".tif")))

 (defn add-image
+  "Add an image to the cache at key. Will be held in memory and saved to disk."
   [cache-agent key image]
   (send-off cache-agent add-item key image)
   (.submit file-service #(image/write-processor (key-map-to-file-name cache-agent key) image))
   nil)

 (defn get-image
+  "Get the image located at key. If image is in memory, will return it. If image
+   is not in memory, nil will be returned, but the image will be added to
+   the map asynchronously so that the next get-image request will return the image
+   in memory."
   [cache-agent key]
-  (send-off cache-agent hit-item key)
-  (or (clojure.core/get @cache-agent key)
-      (do
-        (.submit file-service
+  (if-let [mem-val (clojure.core/get @cache-agent key)]
+    (do (send-off cache-agent hit-item key)
+        mem-val)
+    (do (.submit file-service
                  #(let [image (image/read-processor (key-map-to-file-name cache-agent key))]
                     (send-off cache-agent add-item key image)))
         nil)))

 (defn has-image
+  "Checks if the cache-agent has an image in memory or on disk."
   [cache-agent key]
   (or (not (nil? (@cache-agent key)))
       (.exists (File. (key-map-to-file-name cache-agent key)))))
+
+(defn add-images-changed-watch
+  "Adds a watch that is only triggered when images have changed."
+  [cache-agent key fun]
+  (add-watch cache-agent key (fn [key reference old new]
+                               (when (not= old new)
+                                 (fun key reference old new)))))

 (defn image-cache
   "Creates an image cache that uses a LRU policy to store memory-cache-size
    images in memory, and also stores all images on disk in TIFF files in the
-   specified directory. Calls to .get never block: if the image is not
-   in memory, nil is returned instead, but the image is then loaded
-   into memory in the background, so that the next time .get is called,
-   the image will be returned. The clojure.core function add-watch may
-   be used to provide a callback when the image has been loaded into
-   memory."
+   specified directory."
   [dir memory-cache-size]
   (doto (agent (lru-map {} memory-cache-size))
     (reset-meta! {::cache {:directory dir}})))


updating all library versions

updating all library versions

--- chesire-cat/project.clj
+++ chesire-cat/project.clj
@@ -1,20 +1,20 @@
-(defproject chesire-cat "0.1.0-SNAPSHOT"
+(defproject chesire-cat "1.0.0"
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
   :min-lein-version "2.0.0"
-  :dependencies [[org.clojure/clojure "1.7.0"]
-                 [compojure "1.3.1"]
-                 [ring/ring-defaults "0.1.2"]
-                 [cheshire "5.5.0"]
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [compojure "1.5.1"]
+                 [ring/ring-defaults "0.2.1"]
+                 [cheshire "5.6.3"]
                  [ring/ring-json "0.4.0"]
-                 [org.clojure/clojurescript "1.7.48"]
+                 [org.clojure/clojurescript "1.9.229"]
                  ]
-  :plugins [[lein-ring "0.8.13"]
-            [lein-cljsbuild "1.1.0"]]
+  :plugins [[lein-ring "0.9.7"]
+            [lein-cljsbuild "1.1.4"]]
   :ring {:handler chesire-cat.handler/app}
   :profiles
   {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
-                        [ring-mock "0.1.5"]]}}
+                        [ring-mock "0.3.0"]]}}
   :cljsbuild {
               :builds [{
                         :source-paths ["src-cljs"]


Changed :random meta-error category to :rand, and added :rand-bit which will be 0 or 1.

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -40,7 +40,8 @@
 ;                          (= cat :compressibility) 555 ;;TMH fix later
                           (= cat :total-error) (:total-error ind)
                           (= cat :unsolved-cases) (count (filter #(> % error-threshold) (:errors ind)))
-                          (= cat :random) (lrand)
+                          (= cat :rand) (lrand)
+                          (= cat :rand-bit (lrand-nth [0 1]))
                           :else (throw (Exception. (str "Unrecognized meta category: " cat)))))]
     (doall (map meta-error-fn meta-error-categories))))

@@ -125,3 +126,4 @@
             me (calculate-meta-errors new-ind argmap)]
         (assoc new-ind :meta-errors me)))))

+


Formatting

Formatting

--- src/cljs/cglossa/search_inputs/cwb/shared.cljs
+++ src/cljs/cglossa/search_inputs/cwb/shared.cljs
@@ -18,7 +18,7 @@
       (str/replace #"(</s_id>)\}\}" "}}$1")))

 (defn- search! [{:keys [search-queries]} {:keys [corpus search-results]}]
-  (let [queries    @search-queries
+  (let [queries     @search-queries
         first-query (:query (first queries))]
     (when (and first-query
                (not= first-query "\"\""))


Correct a typo

Correct a typo

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -299,7 +299,7 @@
        (when retry-policy
          (.setRetryPolicy built-statement retry-policy))
        (when consistency-level
-         (.setConsistencyLevel built-statement consistency-level*))
+         (.setConsistencyLevel built-statement consistency-level))
        (if *async*
          (AsyncResult. (.executeAsync session built-statement))
          (-> (.execute session built-statement)


Added ccp prefix to id set triples rule

Added ccp prefix to id set triples rule

--- kabob-build/src/main/clojure/edu/ucdenver/ccp/kabob/build/id_sets/id_set_triples.clj
+++ kabob-build/src/main/clojure/edu/ucdenver/ccp/kabob/build/id_sets/id_set_triples.clj
@@ -28,6 +28,7 @@
        "PREFIX franzOption_logQuery: <franz:yes> \n "
        "PREFIX skos: <http://www.w3.org/2004/02/skos/core#> \n"
        "PREFIX obo: <http://purl.obolibrary.org/obo/> \n"
+       "PREFIX ccp: <http://ccp.ucdenver.edu/obo/ext/> \n"
        ;; "PREFIX franzOption_chunkProcessingAllowed: <franz:yes> \n"
        ;; "PREFIX franzOption_chunkProcessingSize: <franz:500000> \n"
        ))


remove use of :alias in ns

remove use of :alias in ns

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -42,8 +42,9 @@
             [clojure.java.io :as io]
             [clojure.tools.reader :as reader]
             [clojure.tools.reader.reader-types :as readers])
-  (:import cljs.tagged_literals.JSValue)
-  (:alias c.c clojure.core))
+  (:import cljs.tagged_literals.JSValue))
+
+(alias 'c.c 'clojure.core)

 (def specials
   "Set of the special forms for clojurescript"


Undo parallelization on partition creation.

--- src/merkle_db/partition.clj
+++ src/merkle_db/partition.clj
@@ -121,53 +121,44 @@
         (::node/data)))))

-; TODO: copy of this method that uses futures moved to 'load' ns?
 (defn partition-records
   "Divides the given (possibly lazy) sequence of records into one or more
   partitions. Returns a sequence of node data for the persisted partitions."
   [store params records]
   (let [part-size (max-limit params)
         threshold (+ part-size (min-limit params))
-        save-part! (fn [rs]
-                     (future
-                       ; TODO: callback on partition creation?
-                       ;(do (printf "~") (flush))
-                       (let [start (System/nanoTime)
-                             part (from-records store params rs)
-                             elapsed (/ (- (System/nanoTime) start) 1e6)]
-                         #_#_
-                         (printf "%d records => part in %.2f ms\n"
-                                 (count rs) elapsed)
-                         (flush)
-                         part)))]
+        save-part! (fn save-part!
+                     [rs]
+                     ; TODO: callback on partition creation?
+                     (let [start (System/nanoTime)
+                           part (from-records store params rs)
+                           elapsed (/ (- (System/nanoTime) start) 1e6)]
+                       #_#_
+                       (printf "%d records => part in %.2f ms\n"
+                               (count rs) elapsed)
+                       (flush)
+                       part))]
     (loop [partitions []
-           futures []
            pending []
            records (patch/remove-tombstones records)]
       (cond
-        ; Futures are full, so block.
-        (< 6 (count futures))
-          (recur (conj partitions @(first futures))
-                 (vec (rest futures))
-                 pending
-                 records)
         ; Enough pending records to serialize a full partition.
         (<= threshold (count pending))
           (let [[output remnant] (split-at part-size pending)
-                pending-part (save-part! output)]
-            (recur partitions (conj futures pending-part) (vec remnant) records))
+                part (save-part! output)]
+            (recur (conj partitions part) (vec remnant) records))
         ; Pull next record into pending.
         (seq records)
-          (recur partitions futures (conj pending (first records)) (next records))
+          (recur partitions (conj pending (first records)) (next records))
         ; No more records, but too many pending to fit in one partition.
         (< part-size (count pending))
           (let [[output remnant] (split-at (int (Math/ceil (/ (count pending) 2))) pending)
-                pending-part (save-part! output)]
-            (recur partitions (conj futures pending-part) (vec remnant) nil))
+                part (save-part! output)]
+            (recur (conj partitions part) (vec remnant) nil))
         ; Emit one final partition.
         :else
           (let [part (save-part! pending)]
-            (concat partitions (map deref (conj futures part))))))))
+            (conj partitions part))))))


small fix to remove reference to file not checked in yet.

--- src/metabase/models/org.clj
+++ src/metabase/models/org.clj
@@ -1,6 +1,6 @@
 (ns metabase.models.org
   (:use korma.core
-        [metabase.models.org-perm :only (OrgPerm)]))
+        ))

 (defentity Org
   (table :core_organization)
@@ -11,4 +11,4 @@
 ;    :logo_url
 ;    :inherits
 ;    :slug)
-  (has-many OrgPerm {:fk :organization_id}))
+  )


Printing helpful failure messages is a pain in the butt.

--- src/midje/util/checkers.clj
+++ src/midje/util/checkers.clj
@@ -241,6 +241,18 @@

 (defn- midje-classification [thing] (if (map? thing) ::map ::not-map))

+(defmulti collection-string
+  "Given a list of stringified elements, convert them into appropriate
+   collection text."
+  (fn [midje-classification elements] midje-classification))
+
+(defmethod collection-string ::map [midje-classification elements]
+   (str "{" (apply str (interpose ", " (sort elements))) "}"))
+
+(defmethod collection-string ::not-map [midje-classification elements]
+   (str "[" (apply str (interpose " " elements)) "]"))
+;;-
+
 (defmulti best-actual-match
   "Describe the best actuals found in the comparison."
   (fn [midje-classification comparison] midje-classification))
@@ -255,12 +267,46 @@
                          (sort (map (fn [[k v]] (str (pr-str k) " " (pr-str v)))
                                     (:actual-found comparison)))))
        "}."))
-
+;;-

 (defmulti best-expected-match
   "Describe the best list of expected values found in the comparison."
   (fn [midje-classification comparison expected] midje-classification))
+
+(defn- best-expected-match-wrapper
+  [midje-classification comparison expected element-maker suffix]
+  (if (not-any? inexact-checker? expected)
+    nil
+    [(str "      It matched: "
+          (collection-string midje-classification
+                             (map element-maker
+                                  (:expected-found comparison)))
+          suffix
+          ".")]))
+
+(defmethod best-expected-match ::not-map [midje-classification comparison expected]
+   (best-expected-match-wrapper midje-classification
+                                comparison
+                                expected
+                                #(cond (and (fn? %) (:name (meta %)))
+                                       (:name (meta %))
+
+                                       :else
+                                       (pr-str %))
+                                " (in that order)"))
+
+(defmethod best-expected-match ::map [midje-classification comparison expected]
+   (best-expected-match-wrapper midje-classification
+                                comparison
+                                (vals expected)
+                                (fn [[k v]]
+                                  (if (and (fn? v) (:name (meta v)))
+                                    (str (pr-str k) " " (:name (meta v)))
+                                    (str (pr-str k) " " (pr-str v))))
+                                ""))
+
+;;-

 (defmulti compare-results
   (fn [midje-classification actual expected looseness]
@@ -446,37 +492,7 @@
  ;;

-

-(defmethod best-expected-match ::not-map [midje-classification comparison expected]
-  (if (or (some extended-fn? expected)
-          (some regex? expected))
-    (str "      It matched: ["
-         (apply str
-                (interpose " "
-                           (map #(cond (and (fn? %) (:name (meta %)))
-                                       (:name (meta %))
-
-                                       :else
-                                       (pr-str %))
-                                (:expected-found comparison))))
-         "] (in that order)")))
-
-(defmethod best-expected-match ::map [midje-classification comparison expected]
-  (if (or (some extended-fn? (vals expected))
-          (some regex? (vals expected)))
-    (str "      It matched: {"
-         (apply str
-                (interpose ", "
-                           (sort (map (fn [[k v]]
-                                        (cond (and (fn? v) (:name (meta v)))
-                                              (str (pr-str k) " " (:name (meta v)))
-
-                                              :else
-                                              (str (pr-str k) " " (pr-str v))))
-                                      (:expected-found comparison)))))
-         "}.")))
-

 ;; TODO: try different combinations?
 (defn map-comparison--one-permutation [midje-classification actual expected keys]
@@ -508,15 +524,11 @@

 (defn match? [midje-classification actual expected looseness]
-;  (println 'map-match actual expected looseness)
-  (let [comparison (compare-results midje-classification actual expected looseness)
-        mismatch-description (fn [comparison expected]
-                               (cons (best-actual-match midje-classification comparison)
-                                     (when (some inexact-checker?)
-                                       (best-expected-match midje-classification
-                                                            comparison expected))))]
+  (let [comparison (compare-results midje-classification actual expected looseness)]
     (or (total-match? comparison)
-        (apply noted-falsehood (mismatch-description comparison expected)))))
+        (apply noted-falsehood
+               (cons (best-actual-match midje-classification comparison)
+                     (best-expected-match midje-classification comparison expected))))))

 (defn- actual-x-contains? [actual expected looseness]


Maintenance - Found a bug in a test; commented out & created a ticket.

--- system-int-test/test/cmr/system_int_test/search/collection_humanized_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_humanized_search_test.clj
@@ -108,8 +108,10 @@
   (search/refresh-collection-metadata-cache)
   (testing "Humanizer report batches"
     (let [report-lines (str/split (search/get-humanizers-report) #"\n")]
-      (is (= (count report-lines) (+ 2 (hrs/humanizer-report-collection-batch-size))))
-      (doall
+      ;; XXX the following have been commented out due to unpredictable errors
+      ;;     a bug was filed for this under CMR-4461.
+      #_(is (= (count report-lines) (+ 2 (hrs/humanizer-report-collection-batch-size))))
+      #_(doall
         (for [actual-line (rest report-lines)
               n (inc hrs/humanizer-report-collection-batch-size)]
           (is (= actual-line) (str "PROV1,C1200000001-PROV1,B,"n",AM-1,Terra")))))))


WIP: Replace printer using Fipp

WIP: Replace printer using Fipp

--- src/pinpointer/printer.cljc
+++ src/pinpointer/printer.cljc
@@ -1,60 +1,83 @@
 (ns pinpointer.printer
   (:refer-clojure :exclude [pr prn pr-str])
-  (:require [clojure.core :as c]))
+  (:require [fipp.edn :as edn]
+            [fipp.engine :as fipp]
+            [fipp.visit :as visit]))

-(declare pr)
+(def ^:dynamic *trace*)

-(defn- print-sequential [begin print-one sep end sequence]
-  (print begin)
-  (loop [[x & xs :as xxs] (seq sequence)]
-    (when xxs
-      (print-one x)
-      (when xs
-        (print sep)
-        (recur xs))))
-  (print end))
+(defn- wrap-highlighting [f]
+  (bound-fn [& args]
+    (if (empty? *trace*)
+      [:group "<<<" (apply f args) ">>>"]
+      (apply f args))))

-(defn print-seq [s]
-  (print-sequential \( pr \space \) s))
+(defn- with-trace-pop [x f]
+  #_(clojure.core/prn :trace *trace*)
+  #_(clojure.core/prn :x x)
+  (if (= x (:val (first *trace*)))
+    (binding [*trace* (rest *trace*)]
+      (f))
+    (f)))

-(defn- print-vector [v]
-  (print-sequential \[ pr \space \] v))
+(defrecord HighlightPrinter [base-printer]
+  visit/IVisitor
+  (visit-unknown [this x]
+    ((wrap-highlighting visit/visit-unknown) base-printer x))
+  (visit-nil [this]
+    ((wrap-highlighting visit/visit-nil) base-printer))
+  (visit-boolean [this x]
+    ((wrap-highlighting visit/visit-boolean) base-printer x))
+  (visit-string [this x]
+    ((wrap-highlighting visit/visit-string) base-printer x))
+  (visit-character [this x]
+    ((wrap-highlighting visit/visit-character) base-printer x))
+  (visit-symbol [this x]
+    ((wrap-highlighting visit/visit-symbol) base-printer x))
+  (visit-keyword [this x]
+    ((wrap-highlighting visit/visit-keyword) base-printer x))
+  (visit-number [this x]
+    ((wrap-highlighting visit/visit-number) base-printer x))
+  (visit-seq [this x]
+    (with-trace-pop x
+      (wrap-highlighting
+        #(edn/pretty-coll this "(" x :line ")" visit/visit))))
+  (visit-vector [this x]
+    (with-trace-pop x
+      (wrap-highlighting
+        #(edn/pretty-coll this "[" x :line "]" visit/visit))))
+  (visit-map [this x]
+    (with-trace-pop x
+      (wrap-highlighting
+        #(edn/pretty-coll this "{" x [:span "," :line] "}"
+           (fn [printer [k v]]
+             [:span (visit/visit printer k) " " (visit/visit printer v)])))))
+  (visit-set [this x]
+    (with-trace-pop x
+      (wrap-highlighting
+        #(edn/pretty-coll this "#{" x :line "}" visit/visit))))
+  (visit-tagged [this x]
+    ((wrap-highlighting visit/visit-tagged) base-printer x))
+  (visit-meta [this meta x]
+    ((wrap-highlighting #(visit/visit-meta %1 meta %2)) base-printer x))
+  (visit-var [this x]
+    ((wrap-highlighting visit/visit-var) base-printer x))
+  (visit-pattern [this x]
+    ((wrap-highlighting visit/visit-pattern) base-printer x))
+  (visit-record [this x]
+    ((wrap-highlighting visit/visit-record) base-printer x))
+  )

-(defn- print-prefix-map [prefix m print-one]
-  (print-sequential
-    (str prefix "{")
-    (fn [e]
-      (print-one (key e))
-      (print \space)
-      (print-one (val e)))
-    ", "
-    "}"
-    (seq m)))
+(defn highlight-printer []
+  (let [base-printer (edn/map->EdnPrinter {:symbols {}})]
+    (->HighlightPrinter base-printer)))

-(defn- print-simple-map [m print-one]
-  (print-prefix-map nil m print-one))
+(defn pprint [x trace]
+  (let [printer (highlight-printer)]
+    (binding [*trace* trace]
+      (fipp/pprint-document (visit/visit printer x) {}))))

-(defn- print-map [m]
-  (let [[ns lift-map] (#'c/lift-ns m)]
-    (if ns
-      (print-prefix-map (str "#:" ns) lift-map pr)
-      (print-simple-map m pr))))
-
-(defn- print-set [s]
-  (print-sequential "#{" pr \space \} (seq s)))
-
-(defn- print-record [r]
-  (print \#)
-  (print (.getName (class r)))
-  (print-simple-map r pr))
-
-(defn pr [x]
-  (cond (record? x) (print-record x)
-        (seq? x) (print-seq x)
-        (vector? x) (print-vector x)
-        (map? x) (print-map x)
-        (set? x) (print-set x)
-        :else (c/pr x)))
+(defn pr [x])

 (defn prn [x]
   (pr x)


explain *1 in usage

explain *1 in usage

--- examples/gyptis-usage/src/gyptis_usage/core.clj
+++ examples/gyptis-usage/src/gyptis_usage/core.clj
@@ -30,7 +30,7 @@
            (title "Fibonacci: F(2)=1, F(3)=2, F(4)=3, F(5)=5, F(6)=8")))

 ;; add mouse-over interactions
-(plot! (-> *1
+(plot! (-> *1 ; `plot!' returns the generated spec which the REPL then binds to *1
            (assoc-in [:marks 0 :properties :hover] {:fill {:value "red"}})
            (title "Fibonacci with hover interactions")))


[output tests] change layer name expectations in tokenize, note: this breaks test, will need to catch it up

--- keras/src/think/cortex/keras/core.clj
+++ keras/src/think/cortex/keras/core.clj
@@ -22,7 +22,7 @@

 (defmulti model-item->desc
-  "Multimethod that dispatched on keyword version of Keras model item key
+  "Multimethod that dispatches on keyword version of Keras model item key
   to generate the corresponding Cortex description for the item/layer."
   (fn [item]
     (keyword (:class_name item))))
@@ -373,13 +373,18 @@
     (load-weights-for-description desc-seq weight-hdf5-fname)))

 (defn tokenize-output-name
+  "Parses the layer type and position per layer in the outputs file based on Keras
+  naming conventions, returns as a map with `:index` and `:layer-type` keys or
+  throws an exception if unable to parse."
   [out-name]
-  (let [parts
-        (string/split out-name #"_")]
-    (if (= (count parts) 4)
+  (let [parts (string/split out-name #"_")]
+    (if (= (count parts) 2)
       {:index (Long/parseLong (parts 1))
-       :layer-type (keyword (parts 3))}
-      (throw (Exception. (format "fixme: %s" out-name))))))
+       :layer-type (keyword (parts 0))}
+      (throw (ex-info "Expected format 'layertype_index' where index is an unsigned integer."
+                {:cause      :bad-layer-name
+                 :layer-name out-name
+                 :parsed-as  parts})))))

 (defn layer-output->ordered-data
   [layer-outputs]


:bug: Fixes problem with thumbnails in preview

--- frontend/src/app/main/ui/viewer/thumbnails.cljs
+++ frontend/src/app/main/ui/viewer/thumbnails.cljs
@@ -98,6 +98,7 @@
   (let [expanded? (mf/use-state false)
         container (mf/use-ref)
         page-id   (get-in data [:page :id])
+        file-id   (get-in data [:file :id])

         on-close #(st/emit! dv/toggle-thumbnails-panel)
         selected (mf/use-var false)
@@ -110,7 +111,8 @@
         on-item-click
         (fn [event index]
           (compare-and-set! selected false true)
-          (st/emit! (rt/nav :viewer {:page-id page-id} {:index index}))
+          (st/emit! (rt/nav :viewer {:file-id file-id
+                                     :page-id page-id} {:index index}))
           (when @expanded?
             (on-close)))]
     [:& dropdown' {:on-close on-close


cleanup

cleanup

--- src/sormilla/drone_comm.clj
+++ src/sormilla/drone_comm.clj
@@ -75,21 +75,6 @@

 (defn send-hover []
   (send-at "AT*PCMD" [0 0.0 0.0 0.0 0.0]))
-
-#_(do
-  (trim)
-  (println "prepare....")
-  (Thread/sleep 5000)
-  (println "takeoff")
-  (takeoff)
-  (Thread/sleep 8000)
-  (println "land")
-  (land)
-  (Thread/sleep 8000)
-  (println "emerg")
-  (emergency)
-  (Thread/sleep 1000)
-  (println "bye"))

 ;;
 ;; Dump:
@@ -255,19 +240,15 @@
       new-options
       (parse-options ba next-offset new-options))))

-(defn parse-navdata [navdata-bytes]
-  (let [header       (get-int navdata-bytes 0)
-        state        (get-int navdata-bytes 4)
-        seqnum       (get-int navdata-bytes 8)
-        vision-flag  (= (get-int navdata-bytes 12) 1)
-        pstate       (parse-nav-state state)
-        options      (parse-options navdata-bytes 16 {})]
-    (merge
-      {:header header
-       :seq-num seqnum
-       :vision-flag vision-flag}
-      pstate
-      options)))
+
+(defn parse-navdata [navdata]
+  (when @navdata-logging? (log navdata))
+  (merge
+    {:header   (get-int navdata 0)
+     :seq-num  (get-int navdata 8)
+     :vision   (= (get-int navdata 12) 1)}
+    (parse-nav-state (get-int navdata 4))
+    (parse-options navdata 16 {})))

 (defonce ^DatagramSocket nav-socket (doto (DatagramSocket. 5554) (.setSoTimeout 1000)))
 (def trigger (DatagramPacket. (byte-array (map ubyte [0x01 0x00 0x00 0x00])) 4 drone-ip 5554))
@@ -278,6 +259,40 @@
       (doto nav-socket
         (.send trigger)
         (.receive packet))
-      (parse-navdata (.getData packet)))
+      (let [navdata (.getData packet)
+            navdata-len (.getLength packet)]
+        (log navdata navdata-len)
+        (parse-navdata navdata)))
     (catch java.net.SocketTimeoutException e
       nil)))
+
+;;
+;; Testing:
+;;
+
+(comment
+
+(do
+  (println "prepare....")
+  (Thread/sleep 5000)
+  (println "go!....")
+  (navdata-logging! true)
+  (Thread/sleep 500)
+  (enable-navdata)
+  (ctrl-ack)
+  (trim)
+  (Thread/sleep 500)
+  (println "takeoff")
+  (takeoff)
+  (Thread/sleep 8000)
+  (println "landing")
+  (land)
+  (Thread/sleep 4000)
+  (println "emerg")
+  (emergency)
+  (Thread/sleep 500)
+  (println "bye")
+  (navdata-logging! false))
+
+)
+


main.clj: Cleanup the forms.

main.clj: Cleanup the forms.

Use class btn for submit buttons and form-inline for the entry form.

--- src/statuses/views/main.clj
+++ src/statuses/views/main.clj
@@ -40,9 +40,9 @@

 (defn entry-form []
-  (form-to [:post base]
+  (form-to {:class "form-inline" } [:post base]
            (text-field {:class "input-xxlarge" :autofocus "autofocus" } "text")
-           (submit-button "Send update")))
+           (submit-button {:class "btn" } "Send update")))

 (defn reply-form [id author]
   (form-to [:post base]
@@ -50,7 +50,7 @@
                         :autofocus "autofocus"
                         :value (str "@" author) } "text")
            (hidden-field "reply-to" id)
-           (submit-button "Reply")))
+           (submit-button {:class "btn" } "Reply")))

 (defn list-page [items next request]
   (common/layout


Fixed missing fire icons on small viewports

- removed "hidden-xs" css class
- switched from `<i>` to `<span>` for the glyphicons as per recommendation of Bootstrap

--- src/statuses/views/main.clj
+++ src/statuses/views/main.clj
@@ -20,12 +20,12 @@
   [:i {:class (str "glyphicon glyphicon-" icon)}])

 (defn nav-links [request]
-  (list [:li [:a {:href base} [:i {:class "glyphicon glyphicon-th-list"}] "Everything"]]
-        [:li [:a {:href (str base "?query=@" (user request))} [:i {:class "glyphicon glyphicon-user"}] "Mentions"]]
-        [:li [:a {:href (str base "?format=atom")} [:i {:class "glyphicon glyphicon-fire hidden-xs"}] "Feed (all)"]]
-        [:li [:a {:href (str base "?format=atom&query=@" (user request))} [:i {:class "glyphicon glyphicon-fire hidden-xs"}] "Feed (mentions)"]]
-        [:li [:a {:href "/statuses/info"} [:i {:class "glyphicon glyphicon-info-sign"}] "Info"]]
-        [:li [:a {:href "https://github.com/innoq/statuses/issues"} [:i {:class "glyphicon glyphicon-question-sign"}] "Issue"]]))
+  (list [:li [:a {:href base} [:span {:class "glyphicon glyphicon-th-list"}] "Everything"]]
+        [:li [:a {:href (str base "?query=@" (user request))} [:span {:class "glyphicon glyphicon-user"}] "Mentions"]]
+        [:li [:a {:href (str base "?format=atom")} [:span {:class "glyphicon glyphicon-fire"}] "Feed (all)"]]
+        [:li [:a {:href (str base "?format=atom&query=@" (user request))} [:span {:class "glyphicon glyphicon-fire"}] "Feed (mentions)"]]
+        [:li [:a {:href "/statuses/info"} [:span {:class "glyphicon glyphicon-info-sign"}] "Info"]]
+        [:li [:a {:href "https://github.com/innoq/statuses/issues"} [:span {:class "glyphicon glyphicon-question-sign"}] "Issue"]]))

 (defn format-time [time]
   [:time {:datetime (time/time-to-utc time)} (time/time-to-human time)])


CW | 0 | fix for registering test user

CW | 0 | fix for registering test user

--- src/stonecutter/handler.clj
+++ src/stonecutter/handler.clj
@@ -18,8 +18,7 @@
             [stonecutter.routes :refer [routes path]]
             [stonecutter.logging :as log-config]
             [stonecutter.controller.user :as user]
-            [stonecutter.controller.oauth :as oauth]
-            [clauth.client :as client]))
+            [stonecutter.controller.oauth :as oauth]))

 (def translation-map
   (load-translations-from-file "en.yml"))
@@ -109,7 +108,7 @@
   (log-config/init-logger!)
   (disable-template-caching!)
   (s/setup-in-memory-stores!)
-  (let [user (user/register-user "user@email.com" "password")
-        client-details (client/register-client "MYAPP" "myapp.com")]
+  (let [user (clauth.user/register-user "user@email.com" "password")
+        client-details (clauth.client/register-client "MYAPP" "myapp.com")]
     (log/info (str "TEST USER DETAILS:" user))
     (log/info (str "TEST CLIENT DETAILS:" client-details))))