cljsbuild moved out of profiles

cljsbuild moved out of profiles

--- project.clj
+++ project.clj
@@ -39,21 +39,23 @@
                    :repl-options {:init-ns secret-shame.core
                                   :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
                    :source-paths ["dev"]
-                   :cljsbuild {:builds
-                               {:dev {
-                                      :source-paths ["src/cljs"]
-                                      :compiler {:pretty-print true
-                                                 :output-to "resources/public/js/app.js"
-                                                 :output-dir "resources/public/js/out"
-                                                 :libs [""]
-                                                 :optimizations :none
-                                                 :source-map true}}}}}
+                   :cljsbuild }
              :production {:environment {:env {:production true}}
                           :cljsbuild
-                          {:builds
-                           {:production {:source-paths ["src/cljs"]
-                                         :compiler {:output-to "resources/public/js/app.js"
-                                                    :optimizations :advanced
-                                                    :pretty-print false
-                                                    :preamble ["react/react.min.js"]
-                                                    :externs ["react/externs/react.js"]}}}}}})
+                          }}
+  :cljsbuild {:builds
+              {:dev {:source-paths ["src/cljs"]
+                     :compiler {:pretty-print true
+                                :output-to "resources/public/js/app.js"
+                                :output-dir "resources/public/js/out"
+                                :libs [""]
+                                :optimizations :none
+                                :source-map true}}
+               :production {:builds
+                            {:production {:source-paths ["src/cljs"]
+                                          :compiler {:output-to "resources/public/js/app.js"
+                                                     :optimizations :advanced
+                                                     :pretty-print false
+                                                     :preamble ["react/react.min.js"]
+                                                     :externs ["react/externs/react.js"]}}}}}})
+


Version 0.0.37

Version 0.0.37

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject pe-fp-rest "0.0.37-SNAPSHOT"
+(defproject pe-fp-rest "0.0.37"
   :description "A Clojure library providing a REST API interface on top of the fuel purchase abstractions."
   :url "https://github.com/evanspa/pe-fp-rest"
   :license {:name "MIT"


Next dev cycle

Next dev cycle

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


Bump jline2 version.

Bump jline2 version.

closes #173

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
   (defproject reply "0.3.8-SNAPSHOT"
     :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
     :dependencies [[org.clojure/clojure "1.4.0"]
-                   [jline "2.12.1"]
+                   [jline "2.14.5"]
                    [org.thnetos/cd-client "0.3.6"]
                    [clj-stacktrace "0.2.7"]
                    [org.clojure/tools.nrepl "0.2.8"]


rink-mock is useful to have around during development

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def jig-version "2.0.0-RC6")
+(def jig-version "2.0.0-RC8-SNAPSHOT")

 (defproject hecuba "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
@@ -27,7 +27,8 @@

   :source-paths ["src" "src-cljs"]

-  :profiles {:dev {:source-paths ["dev"]}
+  :profiles {:dev {:source-paths ["dev"]
+                   :dependencies [[ring-mock "0.1.5"]]}
              :uberjar {:main kixi.hecuba :aot [kixi.hecuba]}}

   )


Preparing for release

Preparing for release

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


upgrade dependencies.

upgrade dependencies.

--- project.clj
+++ project.clj
@@ -9,8 +9,8 @@
                  [version-clj "0.1.0"]
                  [clj-aws-s3 "0.3.7"]
                  [clj-time "0.6.0"]
-                 [clj-http "0.7.8"]
-                 [commons-codec "1.8"]
+                 [clj-http "0.7.9"]
+                 [commons-codec "1.9"]
                  [commons-logging "1.1.3"]]
   :exclusions [org.clojure/clojure]
   :repositories  {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}


Release version 0.10.0.0-beta1.

Release version 0.10.0.0-beta1.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-SNAPSHOT"
+(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-beta1"
   :description "An Onyx health and query HTTP server"
   :url "https://github.com/onyx-platform/onyx-peer-http-query"
   :license {:name "Eclipse Public License"
@@ -9,7 +9,7 @@
                  [ring-jetty-component "0.3.1"]
                  [cheshire "5.7.0"]
                  ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
-                 [org.onyxplatform/onyx "0.10.0-alpha7"]]
+                 [org.onyxplatform/onyx "0.10.0-beta1"]]
   :repositories {"snapshots" {:url "https://clojars.org/repo"
                               :username :env
                               :password :env


datomic update

datomic update

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@
                  [com.cemerick/friend "0.2.0" :exclusions [org.clojure/core.cache commons-codec]]
                  [clj-time "0.8.0"]
                  [com.taoensso/timbre "3.2.1"]
-                 [com.datomic/datomic-free "0.9.4815.12" :exclusions [org.clojure/clojure com.google.guava/guava commons-codec]]
+                 [com.datomic/datomic-free "0.9.4880.2" :exclusions [org.clojure/clojure com.google.guava/guava commons-codec]]
                  [org.clojure/core.match "0.2.1"]
                  ;; CLJS
                  [org.clojure/clojurescript "0.0-2277"]


Version 0.1.2-SNAPSHOT

Version 0.1.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.gfredericks/seventy-one "0.1.1"
+(defproject com.gfredericks/seventy-one "0.1.2-SNAPSHOT"
   :description "71 in Clojure"
   :url "https://github.com/gfredericks/seventy-one"
   :license {:name "Eclipse Public License"


Version 0.3.7

Version 0.3.7

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject ancient-clj "0.3.7-SNAPSHOT"
+(defproject ancient-clj "0.3.7"
   :description "Maven Version Utilities for Clojure"
   :url "https://github.com/xsc/ancient-clj"
   :license {:name "MIT License"


Version 0.0.4-SNAPSHOT

Version 0.0.4-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject pe-datomic-utils "0.0.3"
+(defproject pe-datomic-utils "0.0.4-SNAPSHOT"
   :description "A Clojure library of helper functions when working with Datomic."
   :url "https://github.com/evanspa/pe-datomic-utils"
   :license {:name "MIT"


Prepare for next release cycle.

Prepare for next release cycle.

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


release 1.7.3

release 1.7.3

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject babel "1.7.3-SNAPSHOT"
+(defproject babel "1.7.3"
   :description "A Clojure library for generation of expressions from grammars and lexicons."
   :url "http://github.com/ekoontz/babel"
   :license {:name "Proprietary: all rights reserved. No distribution allowed without consent of owners."}


Test against 1.6.0-beta2

Test against 1.6.0-beta2

--- project.clj
+++ project.clj
@@ -11,7 +11,7 @@
   :source-paths      ["src/clojure"]
   :java-source-paths ["src/java"]
   :profiles       {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
-                   :1.6 {:dependencies [[org.clojure/clojure "1.6.0-beta1"]]}
+                   :1.6 {:dependencies [[org.clojure/clojure "1.6.0-beta2"]]}
                    :master {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
                    :dev {:jvm-opts     ["-Dlog4j.configuration=log4j.properties.unit"
                                         "-Xmx2048m"


Begin work on next patch release.

Begin work on next patch release.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject inet.data "0.3.1"
+(defproject inet.data "0.3.2-SNAPSHOT"
   :description "Represent and manipulate various Internet entities as data."
   :url "http://github.com/llasram/inet.data"
   :license {:name "Eclipse Public License"


Upgrade cljs compiler to the last version.

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

   :jar-exclusions [#"\.swp|\.swo|user.clj"]
   :profiles {:dev {:dependencies [[org.clojure/clojure "1.6.0"]
-                                  [org.clojure/clojurescript "0.0-3126"]
+                                  [org.clojure/clojurescript "0.0-3196"]
                                   [funcool/cljs-testrunners "0.1.0-SNAPSHOT"]]
                    :codeina {:sources ["src"]
                              :language :clojurescript


Version 0.0.3-SNAPSHOT

Version 0.0.3-SNAPSHOT

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


Update dependencies.

Update dependencies.

--- project.clj
+++ project.clj
@@ -4,8 +4,8 @@
   :license {:name "Apache 2.0"
             :url "http://www.apache.org/licenses/LICENSE-2.0"}
   :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
-                 [buddy/buddy-sign "0.8.1"]
-                 [funcool/cuerdas "0.6.0"]
+                 [buddy/buddy-sign "0.9.0"]
+                 [funcool/cuerdas "0.7.1"]
                  [clout "2.1.2"]]
   :source-paths ["src"]
   :test-paths ["test"]


0.6.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject expound "0.5.1-SNAPSHOT"
+(defproject expound "0.6.0"
   :description "Human-optimized error messages for clojure.spec"
   :url "https://github.com/bhb/expound"
   :license {:name "Eclipse Public License"


Revert "Trying to add contrib dep to make lein-release work"

This reverts commit 73a2a0dfcc2468a48c352c5a1ca4ba4392d96301.

--- project.clj
+++ project.clj
@@ -11,8 +11,6 @@
                                   [cheshire "5.5.0"]
                                   [clj-http-lite "0.3.0"]
                                   ;; needed for java>=11:
-                                  [javax.xml.bind/jaxb-api "2.3.1"]
-                                  ;; needed for clj-release
-                                  [org.clojure/clojure-contrib "1.20"]]}}
+                                  [javax.xml.bind/jaxb-api "2.3.1"]]}}
   :repositories [["releases" {:url "http://clojars.org/repo" :creds :gpg}]]
   :plugins [[lein-codox "0.9.4"]])


Update project.clj (#111)

Update project.clj (#111)

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@
           :source-uri "https://github.com/brabster/crucible/blob/{version}/{filepath}#L{line}"}
   :plugins [[org.clojure/tools.cli "0.3.3" :exclusions [org.clojure/clojure]]
             [lein-ancient "0.6.10"]
-            [com.livingsocial/lein-dependency-check "0.2.2"]
+            [com.livingsocial/lein-dependency-check "0.2.3"]
             [lein-kibit "0.1.5" :exclusions [org.clojure/clojure
                                              org.clojure/tools.cli]]
             [jonase/eastwood "0.2.4"]


Update description in project.clj

Update description in project.clj

--- project.clj
+++ project.clj
@@ -1,5 +1,5 @@
 (defproject merkki "0.2.1"
-  :description "A Clojure library for generating Markdown formatted text."
+  :description "A Clojure(Script) library for generating Markdown formatted text."
   :url "http://github.com/jarcane/merkki"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-kafka "0.7.3"
+(defproject org.onyxplatform/onyx-kafka "0.7.4-SNAPSHOT"
   :description "Onyx plugin for Kafka"
   :url "https://github.com/MichaelDrogalis/onyx-kafka"
   :license {:name "Eclipse Public License"


Added main declaration to project.clj. Can now run the webapp with 'lein run '

--- project.clj
+++ project.clj
@@ -6,6 +6,7 @@
                  [hiccup "1.0.4"]
                  [ring/ring-jetty-adapter "1.1.6"]]
   :uberjar-name "todo-repl-webapp-standalone.jar"
+  :main todo-repl-webapp.handler
   :plugins [[lein-ring "0.8.5"]]
   :ring {:handler todo-repl-webapp.handler/app}
   :profiles


Version 0.0.21

Version 0.0.21

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


Update project plugins

Update project plugins

--- project.clj
+++ project.clj
@@ -7,9 +7,8 @@
   :dependencies     [[org.clojure/clojure "1.4.0"]
 		     [com.ning/async-http-client "1.7.10"]]
   :min-lein-version "2.0.0"
-  :plugins [[codox "0.6.1"]
-            [lein-difftest "1.3.3"
-             :exclusions [org.clojure/clojure org.clojure/clojure-contrib]]]
+  :plugins [[codox "0.8.12"]
+            [lein-difftest "2.0.0"]]
   :profiles {:dev
              {:resource-paths ["test-resources"],
               :dependencies


0.7.0 release.

0.7.0 release.

--- project.clj
+++ project.clj
@@ -1,10 +1,10 @@
-(defproject org.onyxplatform/onyx-datomic "0.7.0-SNAPSHOT"
+(defproject org.onyxplatform/onyx-datomic "0.7.0"
   :description "Onyx plugin for Datomic"
   :url "https://github.com/MichaelDrogalis/onyx-datomic"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.onyxplatform/onyx "0.7.0-SNAPSHOT"]]
+                 [org.onyxplatform/onyx "0.7.0"]]
   :profiles {:dev {:dependencies [[midje "1.6.2"]
                                   [com.datomic/datomic-free "0.9.5153"]]
                    :plugins [[lein-midje "3.1.3"]]}


Update Unison.

Update Unison.

--- project.clj
+++ project.clj
@@ -42,7 +42,7 @@
                    :plugins [[lein-midje "3.1.3"]
                              [lein-jammin "0.1.1"]
                              [lein-set-version "0.4.1"]
-                             [lonocloud/lein-unison "0.1.8"]
+                             [lonocloud/lein-unison "0.1.9"]
                              [codox "0.8.8"]]}
              :circle-ci {:jvm-opts ["-Xmx2500M"
                                     "-XX:+UnlockCommercialFeatures"
@@ -51,15 +51,18 @@
   :unison
   {:repos
    [{:git "git@onyx-kafka:onyx-platform/onyx-kafka.git"
+     :branch "compatibility"
+     :release-branch "master"
      :release-script "scripts/release.sh"
-     :branch "compatibility"
      :merge "master"}
     {:git "git@onyx-datomic:onyx-platform/onyx-datomic.git"
+     :branch "compatibility"
+     :release-branch "master"
      :release-script "scripts/release.sh"
-     :branch "compatibility"
      :merge "master"}
     {:git "git@onyx-sql:onyx-platform/onyx-sql.git"
+     :branch "compatibility"
+     :release-branch "master"
      :release-script "scripts/release.sh"
-     :branch "compatibility"
      :merge "master"}]}
   :codox {:output-dir "doc/api"})


clojure 1.7 profile

clojure 1.7 profile

--- project.clj
+++ project.clj
@@ -27,6 +27,8 @@
                [org.apache.spark/spark-streaming-kafka_2.10 "1.1.0"]
                [org.apache.spark/spark-streaming-flume_2.10 "1.1.0"]
                [org.apache.spark/spark-sql_2.10 "1.1.0"]]}
+             :clojure-1.7
+             {:dependencies [[org.clojure/clojure "1.7.0-alpha4"]]}
              :uberjar
              {:aot :all}}
   :source-paths ["src/clojure"]


Release 0.34.0

Release 0.34.0

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


version bump; latest ClojureScript version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.matthiasnehlsen/inspect "0.1.12"
+(defproject com.matthiasnehlsen/inspect "0.1.13"
   :description "Log to a web application to inspect what's going on in your application"
   :url "https://github.com/matthiasn/inspect"
   :license {:name "Eclipse Public License"
@@ -19,7 +19,7 @@
                  [ring "1.3.2"]
                  [ring/ring-defaults "0.1.4"]
                  [clj-time "0.9.0"]
-                 [org.clojure/clojurescript "0.0-3119"]
+                 [org.clojure/clojurescript "0.0-3126"]
                  [reagent "0.5.0"]
                  [com.stuartsierra/component "0.2.2"]]


Version 2.1.10-SNAPSHOT

Version 2.1.10-SNAPSHOT

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


prepare release 0.6.2

prepare release 0.6.2

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject chrisbetz/flambo "0.6.2-SNAPSHOT"
+(defproject chrisbetz/flambo "0.6.2"
             :description "A Clojure Library for Apache Spark"
             :url "https://github.com/chrisbetz/flambo"
             :license {:name "Eclipse Public License"


Upgrade core.async dep

Upgrade core.async dep

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@
                  [liberator "0.13"]
                  [org.clojure/clojure "1.9.0"]
                  [org.clojure/clojurescript "1.7.145" :scope "provided"]
-                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
+                 [org.clojure/core.async "0.4.474"]
                  [org.clojure/java.jdbc "0.3.7"]
                  [org.postgresql/postgresql "9.4-1201-jdbc41"]
                  [reagent "0.5.1"]


lein-release plugin: preparing 0.10 release

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


lein-release plugin: bumped version from 0.3.3 to 0.3.4-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.domaindrivenarchitecture/dda-user-crate "0.3.3"
+(defproject org.domaindrivenarchitecture/dda-user-crate "0.3.4-SNAPSHOT"
   :description "A crate to handle users"
   :url "https://www.domaindrivenarchitecture.org"
   :license {:name "Apache License, Version 2.0"


Try fix travis tests

Try fix travis tests

--- project.clj
+++ project.clj
@@ -95,6 +95,8 @@
           :plugins
             [[com.cemerick/piggieback "0.1.5-SNAPSHOT"]
              [lein-cljsbuild "1.0.6"]]}
+    :test {
+           :main robinson.core}
     :demos {:dependencies
               [[quil "2.2.6"]]}
     :uberjar {:aot [robinson.update


Add clj-ml dependency for patrec.

Add clj-ml dependency for patrec.

--- project.clj
+++ project.clj
@@ -11,7 +11,11 @@
                  [amalloy/ring-gzip-middleware "0.1.1"]
                  [fuziontech/ring-json-params "0.2.0"]
                  [com.cemerick/friend "0.0.8"]
-                 [svm-clj "0.0.1-SNAPSHOT"]
+                 ;[com.ml/libsvm "2.89"]
+                 ;[svm-clj "0.0.1-SNAPSHOT"]
+                 ;[edu.berkely.compbio/jlibsvm "0.902"]
+                 ;[clj-ml "0.0.3-SNAPSHOT"]
+                 [com.leadtune/clj-ml "0.2.1"]
                  ;[ring-middleware-format "0.1.1"]
                  ;[noir-cljs "0.2.5"]
                  [noir "1.2.2"]]


Bumb http-kit and clj-time

Bumb http-kit and clj-time

--- project.clj
+++ project.clj
@@ -6,8 +6,8 @@
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [clojure-csv/clojure-csv "2.0.1"]
-                 [http-kit "2.1.18"]
-                 [clj-time "0.8.0"]
+                 [http-kit "2.1.19"]
+                 [clj-time "0.9.0"]
                  [io.gatling/gatling-charts "2.0.3"
                    :exclusions [com.typesafe.akka/akka-actor_2.10
                                 org.jodd/jodd-lagarto


Added dev namespace.

Added dev namespace.

--- project.clj
+++ project.clj
@@ -1,11 +1,25 @@
+(defn get-prompt
+  [ns]
+  (str "\u001B[35m[\u001B[34m"
+       ns
+       "\u001B[35m]\u001B[33m λ\u001B[m=> "))
+
 (defproject gov.nasa.earthdata/cmr-edsc-stubs "0.1.0-SNAPSHOT"
   :description "Various Stubbed Data for CMR / EDSC"
   :url "http://example.com/FIXME"
   :license {:name "Apache License 2.0"
             :url "https://www.apache.org/licenses/LICENSE-2.0"}
   :dependencies [
+    [cheshire "5.8.0"]
     [gov.nasa.earthdata/cmr-client "0.2.0-SNAPSHOT"]
     [org.clojure/clojure "1.8.0"]
     [org.clojure/java.jdbc "0.7.1"]]
   :profiles {
-    :uberjar {:aot :all}})
+    :uberjar {:aot :all}
+    :dev {
+      :dependencies [
+        [org.clojure/tools.namespace "0.2.11"]]
+      :source-paths ["dev-resources/src"]
+      :repl-options {
+        :init-ns cmr-edsc-stubs.dev
+        :prompt ~get-prompt}}})


lein-release plugin: bumped version from 0.1.4 to 0.1.5-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lein-jslint "0.1.4"
+(defproject lein-jslint "0.1.5-SNAPSHOT"
   :description "A Leiningen plugin for running JS code through JSLint."
   :url "https://github.com/vbauer/lein-jslint"
   :license {:name "Eclipse Public License"


Update ElasticSearch to 1.7.3

Update ElasticSearch to 1.7.3

--- project.clj
+++ project.clj
@@ -21,7 +21,7 @@
                  [com.google.guava/guava "15.0"] ;; Cassandra still requires Guava 15
                  [org.yaml/snakeyaml "1.15"] ; >=1.11 required by r18n, used by some of our apps
                  [org.xerial.snappy/snappy-java "1.1.1.6"]
-                 [org.elasticsearch/elasticsearch "1.4.5" :exclusions [org.antlr/antlr-runtime]] ;; Cassandra requires [org.antlr/antlr "3.2"]
+                 [org.elasticsearch/elasticsearch "1.7.3" :exclusions [org.antlr/antlr-runtime]] ;; Cassandra requires [org.antlr/antlr "3.2"]
                  [clojurewerkz/elastisch "2.1.0" :exclusions [clj-http com.google.guava/guava org.antlr/antlr-runtime]] ;; Cassandra requires [org.antlr/antlr "3.2"]
                  [org.scala-lang/scala-library "2.9.2"]
                  [org.apache.kafka/kafka_2.9.2 "0.8.2.1"]


Update org.apache.logging.log4j/log4j-core to 2.17.0

--- project.clj
+++ project.clj
@@ -36,7 +36,7 @@
              :1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}
              :uberjar {:dependencies [[org.clojure/clojure "1.10.3"]
                                       [org.apache.logging.log4j/log4j-api "2.17.0"]
-                                      [org.apache.logging.log4j/log4j-core "2.14.1"]]
+                                      [org.apache.logging.log4j/log4j-core "2.17.0"]]
                        :resource-paths ["bin-resources"]
                        :main cljam.tools.main
                        :jvm-opts ["-Dclojure.compiler.direct-linking=true"]


maybe it's the OOM killer that's causing issues in CI?

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (defproject bifurcan "0.1.0-SNAPSHOT"
   :java-source-paths ["src"]
   :dependencies []
-  :plugins [#_[lein-virgil "0.1.0"]]
+  :plugins [[lein-virgil "0.1.0"]]
   :test-selectors {:default #(not
                                (some #{:benchmark :stress}
                                  (cons (:tag %) (keys %))))
@@ -11,4 +11,4 @@
   :profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0"]
                                   [org.clojure/test.check "0.9.0"]
                                   [criterium "0.4.3"]]}}
-  :jvm-opts ^:replace ["-server" "-XX:+UseG1GC" "-Xmx12g" "-XX:-OmitStackTraceInFastThrow"])
+  :jvm-opts ^:replace ["-server" "-XX:+UseG1GC" "-Xmx8g" "-XX:-OmitStackTraceInFastThrow"])


Update version

Update version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject jasmine-cljs "0.1.4"
+(defproject jasmine-cljs "0.1.5"
   :description "Library for working with jasmine"
   :url "http://github.com/cursivecode/jasmine-cljs"
   :license {:name "Eclipse Public License"


Deps: misc, incl. Nippy 2.6.0

Deps: misc, incl. Nippy 2.6.0

--- project.clj
+++ project.clj
@@ -11,9 +11,9 @@
                 *assert* true}
   :dependencies
   [[org.clojure/clojure         "1.4.0"]
-   [com.taoensso/encore         "0.9.7"]
-   [com.taoensso/timbre         "3.1.2"]
-   [com.taoensso/nippy          "2.6.0-beta2"]
+   [com.taoensso/encore         "1.1.0"]
+   [com.taoensso/timbre         "3.1.6"]
+   [com.taoensso/nippy          "2.6.0"]
    [commons-pool/commons-pool   "1.6"]
    [commons-codec/commons-codec "1.9"]
    [org.clojure/data.json       "0.2.4"]]
@@ -22,12 +22,12 @@
   :profiles
   {;; :default [:base :system :user :provided :dev]
    :1.5  {:dependencies [[org.clojure/clojure "1.5.1"]]}
-   :1.6  {:dependencies [[org.clojure/clojure "1.6.0-beta2"]]}
+   :1.6  {:dependencies [[org.clojure/clojure "1.6.0"]]}
    :test {:dependencies [[expectations            "1.4.56"]
                          [org.clojure/test.check  "0.5.7"]
-                         [com.taoensso/faraday    "1.2.0"]
+                         [com.taoensso/faraday    "1.3.0"]
                          [clj-aws-s3              "0.3.8"]
-                         [ring/ring-core          "1.2.1"]]
+                         [ring/ring-core          "1.2.2"]]
           :plugins [[lein-expectations "0.0.8"]
                     [lein-autoexpect   "1.2.2"]]}
    :dev* [:dev {:jvm-opts ^:replace ["-server"]


Fix internal doc links.

Fix internal doc links.

--- src/afterglow/effects/params.clj
+++ src/afterglow/effects/params.clj
@@ -585,7 +585,7 @@
   When it comes time to evaluate this parameter, any dynamic number
   parameters are evaluated, and the resulting numbers are scaled as a
   group (after evaluating `f` for every participating head or fixture)
-  so they fall within the range [`start`-`end`], which defaults
+  so they fall within the range [`:start`-`:end`], which defaults
   to [0-255].

   Useful things that `f` can do include calculating the distance of
@@ -593,8 +593,8 @@
   from some line, and so on. These can allow the creation of lighting
   gradients across all or part of a show. Spatial parameters make
   excellent building blocks
-  for [color](#build-color-param), [direction](#build-direction-param)
-  and [aim](#build-aim-param) parameters, as shown in the [wiki
+  for [color](#var-build-color-param), [direction](#var-build-direction-param)
+  and [aim](#var-build-aim-param) parameters, as shown in the [wiki
   examples](https://github.com/brunchboy/afterglow/wiki/Effect-Examples#spatial-effects).

   If you do not specify an explicit value for `:frame-dynamic`, this


Handle lane creation error in lane-pump.

--- src/cbfg/lane.cljs
+++ src/cbfg/lane.cljs
@@ -27,9 +27,11 @@
                 (if-let [lane-ch (get lane-chs (:lane m))]
                   (do (aput lane-pump lane-ch m)
                       (recur lane-chs tot-lane-chs))
-                  (let [lane-ch (make-lane-fn lane-pump (:lane m) out-ch)]
-                    (aput lane-pump lane-ch m)
-                    (recur (assoc lane-chs (:lane m) lane-ch)
-                           (inc tot-lane-chs)))))
+                  (if-let [lane-ch (make-lane-fn lane-pump (:lane m) out-ch)]
+                    (do (aput lane-pump lane-ch m)
+                        (recur (assoc lane-chs (:lane m) lane-ch)
+                               (inc tot-lane-chs)))
+                    (do (aput lane-pump out-ch (assoc m :status :error))
+                        (recur lane-chs tot-lane-chs))))) ; TODO: error code.
               (doseq [[lane-name lane-ch] lane-chs] ; Close lane-chs & exit.
                 (aclose lane-pump lane-ch)))))


make tag matching more flexible

make tag matching more flexible

--- src/chat/client/new-message.cljs
+++ src/chat/client/new-message.cljs
@@ -6,6 +6,12 @@
             [chat.client.dispatcher :refer [dispatch!]]
             [chat.client.store :as store])
   (:import [goog.events KeyCodes]))
+
+(defn fuzzy-matches?
+  [s m]
+  (letfn [(normalize [s]
+            (-> (.toLowerCase s) (string/replace #"\s" "")))]
+    (not= -1 (.indexOf (normalize s) (normalize m)))))

 (defn new-message-view [config owner]
   (reify
@@ -30,7 +36,7 @@
                          (remove (fn [t]
                                    (contains? thread-tag-ids (t :id))))
                          (filter (fn [t]
-                                   (not= -1 (.indexOf (t :name) partial-tag)))))
+                                   (fuzzy-matches? (t :name) partial-tag))))
             highlight-next!
             (fn []
               (om/update-state! owner :highlighted-result-index


dismiss invite form after invites have been sent

--- frontend/controllers/api.cljs
+++ frontend/controllers/api.cljs
@@ -214,4 +214,11 @@
   [target message status {:keys [resp context]} state]
   (if-not (= (:project-name context) (vcs-url/project-name (:vcs_url (get-in state state/build-path))))
     state
-    (assoc-in state state/build-github-users-path (vec (map-indexed (fn [i u] (assoc u :index i)) resp)))))
+    (-> state
+        (assoc-in state/build-github-users-path (vec (map-indexed (fn [i u] (assoc u :index i)) resp))))))
+
+(defmethod api-event [:invite-github-users :success]
+  [target message status {:keys [resp context]} state]
+  (if-not (= (:project-name context) (vcs-url/project-name (:vcs_url (get-in state state/build-path))))
+    state
+    (assoc-in state state/dismiss-invite-form-path true)))


fix fn name in report-to-ganglia

fix fn name in report-to-ganglia

--- elephantdb-server/src/clj/elephantdb/common/metrics.clj
+++ elephantdb-server/src/clj/elephantdb/common/metrics.clj
@@ -10,6 +10,6 @@

 (defn report-to-ganglia
   ([host port]
-     (report-to-graphite 1 TimeUnit/MINUTES host port))
+     (report-to-ganglia 1 TimeUnit/MINUTES host port))
   ([period unit host port]
      (GangliaReporter/enable period unit host port)))


deploy profile fix

deploy profile fix

--- release.clj
+++ release.clj
@@ -115,6 +115,6 @@
   (make-commit)
   (publish-npm)
   (github-release)
-  (sh "lein" "with-profile" "deploy" "deploy" "clojars"))
+  (sh "lein" "with-profile" "+deploy" "deploy" "clojars"))

 (-main)


CMR-1383 Updates ns docstring.

CMR-1383 Updates ns docstring.

--- ingest-app/src/cmr/ingest/services/provider_service.clj
+++ ingest-app/src/cmr/ingest/services/provider_service.clj
@@ -1,6 +1,7 @@
 (ns cmr.ingest.services.provider-service
   "Functions for CRUD operations on providers. All functions return
-  the underlying Metadata DB API response."
+  the underlying Metadata DB API clj-http response which can be used
+  as a Ring response."
   (:require [cmr.transmit.metadata-db :as mdb]
             [cmr.ingest.data.indexer :as indexer]))


:fallen_leaf:

--- src/insta/core.clj
+++ src/insta/core.clj
@@ -42,33 +42,18 @@

   ;; Parse options and store
   (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
-    ; (println options)
     (println errors)

     (let [client-id (:client-key options)
-          secret-key (:secret-key options)]
+          secret-key (:secret-key options)
+          tag-requester (insta.requester/tag-requester client-id secret-key)]

-      (println client-id)
-      (println secret-key)
-
-      ;; *_*
-      ;; o_o
-      ;; -_-
-      (let [tag-requester (insta.requester/tag-requester client-id secret-key)]
-        (println (tag-requester "yolo")))
-      ))
+      ;; 597d57d253d446a89bda86c03b129326
+      ;; 38a6ea19033641d987385bf8de52d16a
+      (println (tag-requester "yolo"))))

   ;; Run the server
   ; (run-server (site #'app-routes) {:port 8080})

-  ;; request tag information from instagram, then print
-  ; (println (request-tag "yolo"))
-  ; (println (request-tag "yolo"))
-
-
-  ;; 597d57d253d446a89bda86c03b129326
-  ;; 38a6ea19033641d987385bf8de52d16a
-
-
   ;; x_x
   (println "x_x"))


linear regression analysis used for determining ratio trend

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/wordcount_chart.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/wordcount_chart.cljs
@@ -30,14 +30,12 @@
     [:polygon {:transform arrowTrans :stroke "none" :fill color :points points}]))

 (defn bar [text cnt y h w idx]
-  (let [pos-slope (get @pos-trends text)]
+  (let [pos-slope (get @pos-trends text)
+        ratio-slope (get @ratio-trends text)]
     [:g
      [:text {:y (+ y 8) :x 138 :stroke "none" :fill "black" :dy ".35em" :textAnchor "end"} text]
-     [arrow 146 y (cond
-                   (pos? pos-slope) :UP
-                   (neg? pos-slope ) :DOWN
-                   :else :RIGHT)]
-     [arrow 160 y :RIGHT]
+     [arrow 146 y (cond (pos? pos-slope)   :UP       (neg? pos-slope )   :DOWN       :else :RIGHT)]
+     [arrow 160 y (cond (pos? ratio-slope) :RIGHT-UP (neg? ratio-slope ) :RIGHT-DOWN :else :RIGHT)]
      [:rect {:y y :x 168 :height 15 :width w :stroke "white" :fill "#428bca"}]
      (if (> w 50)
        [:text (merge text-defaults {:y (+ y 8) :x (+ w 160)}) cnt]
@@ -66,8 +64,12 @@
   "update wordcount chart"
   [words]
   (reset! items (vec (map-indexed vector words)))
-  (doseq [[idx [text cnt]] @items]
-    (let [slope (get (reg/linear-regression (take 3 (get @pos-items text))) 1)]
+  (let [items @items
+        total-cnt (apply + (map (fn [[_[_ cnt]]] cnt) items))]
+    (doseq [[idx [text cnt]] items]
       (swap! pos-items update-in [text] conj idx)
-      (swap! pos-trends assoc-in [text] slope))))
-
+      (swap! ratio-items update-in [text] conj (/ total-cnt cnt))
+      (swap! pos-trends assoc-in [text]
+             (get (reg/linear-regression (take 3 (get @pos-items text))) 1))
+      (swap! ratio-trends assoc-in [text]
+             (get (reg/linear-regression (take 1000 (get @ratio-items text))) 1)))))


Dates in and out.

Dates in and out.

--- src/datomish/sqlite_schema.cljc
+++ src/datomish/sqlite_schema.cljc
@@ -172,6 +172,9 @@
        Long
        (->SQLite [x] x)

+       java.util.Date
+       (->SQLite [x] (.getTime x))
+
        Float
        (->SQLite [x] x)

@@ -188,19 +191,11 @@
        boolean
        (->SQLite [x] (if x 1 0))

+       js/Date
+       (->SQLite [x] (.getTime x))
+
        number
        (->SQLite [x] x)]))
-
-(defn <-SQLite
-  "Transforms SQLite values to Clojure{Script}."
-  [valueType value]
-  (case valueType
-    :db.type/ref     value
-    :db.type/keyword (keyword (subs value 1))
-    :db.type/string  value
-    :db.type/boolean (not= value 0)
-    :db.type/long    value
-    :db.type/double  value))

 ;; Datomish rows are tagged with a numeric representation of :db/valueType:
 ;; The tag is used to limit queries, and therefore is placed carefully in the relevant indices to
@@ -266,3 +261,15 @@
     ;  4 value         ; JS doesn't have a Date representation.
     ; 13 value         ; Return the keyword string from the DB: ":foobar".
     value))
+
+(defn <-SQLite
+  "Transforms SQLite values to Clojure{Script}."
+  [valueType value]
+  (case valueType
+    :db.type/ref     value
+    :db.type/keyword (keyword (subs value 1))
+    :db.type/string  value
+    :db.type/boolean (not= value 0)
+    :db.type/long    value
+    :db.type/instant (<-tagged-SQLite 4 value)
+    :db.type/double  value))


Add duplicate file names handling strategy to localfs storage.

--- src/datoteka/storages/local.clj
+++ src/datoteka/storages/local.clj
@@ -53,16 +53,19 @@

 (defn- save
   [base path content]
-  ;; TODO: rename the file if it is already exists, the current
-  ;; implementation just silently overwrites the file.
   (let [^Path path (pt/-path path)
         ^Path fullpath (normalize-path base path)]
     (when-not (fs/exists? (.getParent fullpath))
       (fs/create-dir (.getParent fullpath)))
-    (with-open [^InputStream src (pt/-input-stream content)
-                ^OutputStream dst (io/output-stream fullpath)]
-      (io/copy src dst)
-      path)))
+    (loop [iteration nil]
+      (let [[basepath ext] (fs/split-ext fullpath)
+            candidate (fs/path (str basepath iteration ext))]
+        (if (fs/exists? candidate)
+          (recur (if (nil? iteration) 1 (inc iteration)))
+          (with-open [^InputStream src (pt/-input-stream content)
+                      ^OutputStream dst (io/output-stream candidate)]
+            (io/copy src dst)
+            (fs/relativize candidate base)))))))

 (defn- delete
   [base path]


CMR-5182 Addresses PR comment.

CMR-5182 Addresses PR comment.

--- access-control-app/int-test/cmr/access_control/int_test/acl_crud_test.clj
+++ access-control-app/int-test/cmr/access_control/int_test/acl_crud_test.clj
@@ -1042,7 +1042,6 @@
         (is (= ["Permission to delete ACL is denied"] (:errors body)))))))

 (deftest entry-titles-concept-ids-sync
-  ; (dev-sys-util/eval-in-dev-sys `(cmr.access-control.config/set-sync-entry-titles-concept-ids-collection-batch-size! 3))
   (let [token (e/login-guest (u/conn-context))
         make-catalog-item (fn [name coll-id]
                             (-> catalog-item-acl
@@ -1164,7 +1163,6 @@
              (actual->set
               (get-in (ac/get-acl (u/conn-context) (:concept_id acl4) {:token token})
                       [:catalog_item_identity :collection_identifier])))))))
-  ; (dev-sys-util/eval-in-dev-sys `(cmr.access-control.config/set-sync-entry-titles-concept-ids-collection-batch-size! 100)))

 (deftest CMR-5128-mmt-dashboard-acl-test
   (let [token (e/login (u/conn-context) "admin")


RandomAccessFile helper.

RandomAccessFile helper.

--- src/monocle/io.clj
+++ src/monocle/io.clj
@@ -1,17 +1,25 @@
 (ns monocle.io
   (:require [clojure.java.io :as io])
-  (:import (java.io RandomAccessFile)
+  (:import (java.io File RandomAccessFile)
            (org.apache.commons.io.input CountingInputStream)))

+(defn raf [f]
+  (if (or (instance? File f)
+          (string? f))
+    (RandomAccessFile. f "rw")
+    f))
+
 (defn slurp-offset [f]
-  (try
-    (.readLong f)
-    (catch Exception _
-      0)))
+  (let [f (raf f)]
+    (try
+      (.readLong f)
+      (catch Exception _
+        0))))

 (defn spit-offset [f n]
-  (.seek f 0)
-  (.writeLong f n))
+  (let [f (raf f)]
+    (.seek f 0)
+    (.writeLong f n)))

 (defn counting-stream-reader
   ([file]
@@ -26,7 +34,7 @@
   "This is only intended for use across JVMs!  Provides no protection
   against other threads."
   [bindings & body]
-  `(let [raf# (RandomAccessFile. ~(second bindings) "rw")
+  `(let [raf# (raf ~(second bindings))
          lock# (-> raf# .getChannel .lock)
          ~(first bindings) (slurp-offset raf#)
          ~(last bindings) (fn [n#] (spit-offset raf# n#))]


Cleanup

Cleanup

--- src/nansi/core.clj
+++ src/nansi/core.clj
@@ -25,7 +25,6 @@
 (def regex
   #"[├┘└┐┌┤]")

-;; (conj "zzzz" "a")
 (defn replace-char
   []
   (let [ascii (s/split-lines (slurp "partial.txt"))]
@@ -37,36 +36,28 @@
      '()
      ascii)))

-
 (def lines (reverse (replace-char)))
 (def longest-length (-> (sort-by count lines)
                         last
                         count))
+
 (defn get-padding
   []
   (for [line lines
         :let [padding-length (- longest-length (count line))]]
-    (apply str (repeat padding-length \space))
-    #_(take padding-length (repeatedly (fn [] " ")))))
-
-(def padding (get-padding))
+    (apply str (repeat padding-length \space))))

 (defn join-line-padding
   []
-  (map-indexed
-   (fn [idx line]
-     (str (nth padding idx) line))
-   lines)
-  )
+  (let [padding (get-padding)]
+    (map-indexed
+     (fn [idx line]
+       (str (nth padding idx) line))
+     lines)))

-;; (println (join-line-padding))
-;; (println lines)
-
-;; (println (first padding))
-(doseq [l (join-line-padding)]
-  (println l))
-;; (println (join-line-padding))

 (defn -main
   [& args]
-  (println "Hi!"))
+  (doseq [l (join-line-padding)]
+    (println l))
+  )


More in-progress integration changes

More in-progress integration changes

--- src/pamela/htn.clj
+++ src/pamela/htn.clj
@@ -1600,7 +1600,7 @@
               ;;     "TC" temporal-constraints)
               subtask
               (cond
-                (= :plant-fn-symbol type)
+                (#{:plant-fn-symbol :plant-fn-field} type)
                 ;; NOTE if this is a qualified non-this.fname
                 ;; THEN we *must* trace the non-this ancestry back
                 ;; to find the actual plant class BEFORE looking
@@ -1618,13 +1618,13 @@
                 ;; if the value of plant-fn-primitive? is nil we know
                 ;; we have the wrong plant-class (because the IR always
                 ;; has true or false)
-                (let [plant-class (if (= name 'this) pclass name)
+                (let [plant-class (if (= :plant-fn-symbol type)
+                                    (if (= name 'this) pclass name)
+                                    (get-in ir [pclass :fields :field :initial :pclass]))
                       plant-fn-primitive?
                       (get-in ir [plant-class :methods method :primitive])
-                      ;; non-primitive? (and (= name 'this)
-                      ;;                  (not plant-fn-primitive?))
                       [plant-class non-primitive?]
-                      (if (nil? plant-fn-primitive?)
+                      (if (nil? plant-fn-primitive?)  ;;TODO - Should error here
                         [::unknown false]
                         [plant-class (not plant-fn-primitive?)])
                       ;; The following would help expand non local plant
@@ -1648,51 +1648,22 @@
                       nt (if make-htn-method?
                            (htn-nonprimitive-task
                              {:pclass pclass
-                              :name (if (nil? plant-fn-primitive?)
-                                      method
-                                      mname) ;; FIX
-                              :arguments (if (nil? plant-fn-primitive?)
-                                           args
-                                           margs) ;; FIX
+                              :name mname
+                              :arguments margs
                               :irks irks-i}))
                       st (if make-htn-method? [task])]
                   ;; (println "  PLANT-FN-SYMBOL TASK" task)
                   ;; (println "  PLANT-FN-SYMBOL SUBTASKS" st)
                   (when make-htn-method? ;; make htn-method
                     (let [hm (htn-method {:pclass pclass
-                                          :name (if (nil? plant-fn-primitive?)
-                                                  method
-                                                  mname) ;; FIX
+                                          :name mname
+                                          :display-name display-name
                                           :nonprimitive-task nt
                                           :subtasks st
                                           :irks irks-i})]
                       ;; (println "HTN-METHOD" (with-out-str (pprint hm)))
                       ;; (pprint-htn-methods)
                       hm))
-                  task)
-
-                ;; if (symbol? mname) we need to make an htn-method
-                (= :plant-fn-field type)
-                (let [make-htn-method? (symbol? mname)
-                      task (htn-primitive-task
-                             {:pclass field
-                              :name method
-                              :arguments args
-                              :temporal-constraints temporal-constraints
-                              :irks irks-i})
-                      nt (if make-htn-method?
-                           (htn-nonprimitive-task
-                             {:pclass pclass :name mname
-                              :arguments margs
-                              :irks irks-i}))
-                      st (if make-htn-method? [task])]
-                  (when make-htn-method?
-                    (htn-method {:pclass pclass
-                                 :name mname
-                                 :display-name display-name
-                                 :nonprimitive-task nt
-                                 :subtasks st
-                                 :irks irks-i}))
                   task)

                 (#{:sequence :parallel} type)


added managed object creator to core

added managed object creator to core

--- dropwizard-clojure-core/src/clojure/dropwizard_clojure/core.clj
+++ dropwizard-clojure-core/src/clojure/dropwizard_clojure/core.clj
@@ -6,7 +6,8 @@
            [io.dropwizard Application]
            [io.dropwizard.setup Environment]
            [io.dropwizard.jersey.setup JerseyEnvironment]
-           [com.codahale.metrics.health HealthCheckRegistry]))
+           [com.codahale.metrics.health HealthCheckRegistry]
+           (io.dropwizard.lifecycle Managed)))

 (defprotocol ApplicationSetup
   (initialize [this bootstrap])
@@ -31,6 +32,11 @@
     (dorun (map #(.register jersey %) resources))
     env))

+
+(defn add-managed-object [^Environment e ^Managed m]
+  (.manage(.lifecycle e) m)
+  )
+
 (defn register-resource [app resource]
   (register-resources (env-from-app app) [resource]))

@@ -53,6 +59,8 @@
 (defn register-healthcheck [^Environment env hc-name hc]
   (add-healthcheck-to-registry (.healthChecks env) hc-name hc) env)

+
+
 (defn register-jackson-module [^Environment env mod]
   (.registerModule (.getObjectMapper env) mod)
   env)


Add greeting to match the normal one

Add greeting to match the normal one

--- src/reply/core.clj
+++ src/reply/core.clj
@@ -83,6 +83,7 @@
 (defn -main [& args]
   (set-break-handler! handle-ctrl-c)
   (setup-reader!)
+  (println "Clojure" (clojure-version))
   (repl :read jline-read
         :prompt (fn [] false)
         :need-prompt (fn [] false))


Adjust language in gathering notes

Adjust language in gathering notes

--- src/clj/chili_dog_night/data.clj
+++ src/clj/chili_dog_night/data.clj
@@ -21,7 +21,7 @@
                           " and "
                           (el/link-to "http://www.mediapost.com/publications/article/164602/hasbro-plays-product-placement-game.html#ixzz1hBGO1uEO" "Hasbro Product Placement")
                           [:br]
-                          "The implosion of the Republican party by the coward "
+                          "The assassination of the Republican party by the coward "
                           (el/link-to "http://www.rollingstone.com/politics/news/how-america-made-donald-trump-unstoppable-20160224?page=12" "Donald Trump")]}
                  {:date "2016/02/10"
                   :address "3828 Meridian Ave N, Seattle, WA 98103, USA"


Updated temp dir for unzipping gadm2 - uuid dirs were cluttering up /tmp

--- src/clj/forma/source/gadmiso.clj
+++ src/clj/forma/source/gadmiso.clj
@@ -33,7 +33,7 @@
   "Decompress gadm2.zip and return the output directory."
   [& [uuid]]
   (let [zip-name "gadm2.zip"
-        base-dir "/tmp"
+        base-dir "/tmp/gadm2"
         path (.getPath (io/resource zip-name))
         uuid (or uuid (utils/gen-uuid))
         decomp-dir (str base-dir "/" uuid)]


fix Tri-maf Contact

fix Tri-maf Contact

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -612,7 +612,7 @@
    "Tri-maf Contact"
    {:abilities [{:cost [:click 1] :msg "gain 2 [Credits]" :once :per-turn
                  :effect (effect (gain :credit 2))}]
-    :trash-effect {:effect (effect (damage :meat 3 {:unboostable true :card card}))}}
+    :leave-play (effect (damage :meat 3 {:unboostable true :card card}))}

    "Tyson Observatory"
    {:abilities [{:prompt "Choose a piece of Hardware" :msg (msg "adds " (:title target) " to their Grip")


be forgiving of keyword vs. string labels in kube provider

--- src/clj/shale/node_providers.clj
+++ src/clj/shale/node_providers.clj
@@ -87,7 +87,7 @@
                   :containers
                   (mapcat :ports)
                   (filter (fn [p]
-                            (-> p :name (= port-name))))
+                            (-> p :name (= (name port-name)))))
                   first)
         _ (assert port)
         port-num (:containerPort port)]


Give namespace prefixes to the evaluation page

--- src/clj/sparqlab/routes/home.clj
+++ src/clj/sparqlab/routes/home.clj
@@ -171,11 +171,15 @@
             all-selects? (= (get-in verdict [:query :query-type])
                             (get-in verdict [:canonical-query :query-type])
                             ::sparql/select)
+            prefixes (merge (get-in verdict [:query :prefixes])
+                            (get-in verdict [:canonical-query :prefixes])
+                            {"xsd" (prefix/xsd)})
             data (merge (i18n/base-locale request)
                         (i18n/base-evaluation-locale request)
                         exercise
                         verdict
                         {:all-selects? all-selects?
+                         :prefixes prefixes
                          :title (tr [:evaluation/title] [(:name exercise)])})]
         (cond-> (layout/render "evaluation.html" data)
           (and (:equal? verdict) (not= exercise-status "revealed")) (cookie/mark-exercise-as-solved id)))


investigating events

investigating events

--- src/cljs/om_lette/templater.cljs
+++ src/cljs/om_lette/templater.cljs
@@ -88,11 +88,6 @@
   [s]
   (.parse js/parser s))

-
-(defn eval-parsed-code
-  [pjs state]
-  (eval-parsed-cljs-code (js->clj pjs)
-                         state))

 (defn eval-parsed-cljs-code
   [c state]
@@ -107,6 +102,11 @@
                                  (rest c)))
         :default c))

+(defn eval-parsed-code
+  [pjs state]
+  (eval-parsed-cljs-code (js->clj pjs)
+                         state))
+
 (defn tokenize-string
   [p]
   (->> p
@@ -144,7 +144,9 @@
        first
        hick/as-hiccup
        (walk/postwalk (fn [t] (cond (string? t) (tokenize-string t)
-                                    (like-html-vec? t) (update-in t [1] grab-om-attrs [:om-if :om-repeat])
+                                    (like-html-vec? t) (-> t
+                                                           (update-in [1] grab-om-attrs [:om-if :om-repeat])
+                                                           (assoc-in [1 :on-click] #(.log js/console %)))
                                     :else t)))
        (walk/postwalk flatten-out)))


CMR-8616: Removing extra approval check

CMR-8616: Removing extra approval check

Since approval for generic documents is already being handled in the ingest application we should remove it from the indexer.

--- indexer-app/src/cmr/indexer/data/concepts/generic.clj
+++ indexer-app/src/cmr/indexer/data/concepts/generic.clj
@@ -4,8 +4,8 @@
    that can be indexed in lucine."
   (:require
    [cheshire.core :as json]
+   [clojure.java.io :as io]
    [cmr.common.concepts :as concepts]
-   [cmr.common.generics :as common-generic :refer [approved-generic?]]
    [cmr.common.mime-types :as mtype]
    [cmr.common.util :as util]
    [cmr.indexer.data.concepts.generic-util :as gen-util]
@@ -34,7 +34,7 @@
              :Configuration {:sub-fields [:s2] :format '%s == %s'}}
             {:l1 {:s1 'one' :s2 'two'}})"
   (fn [settings _] (or (:Indexer settings) :default)))
-
+
 (defmethod field->index "complex-field"
   ;; This is an example of a complex indexer which takes a list of sub fields and
   ;; combines them into one field"
@@ -79,50 +79,48 @@
         generic-assoc-ids (remove #(= concept-id %)
                                   (concat (mapv :associated-concept-id generic-associations)
                                           (mapv :source-concept-identifier generic-associations)))
-        long-name (:LongName parsed-concept) ; should this exist as a required field
-        ;; TODO: Generic work: Need to remove this section
-        ;; we already have checked for approval in the ingest application.
+        long-name (:LongName parsed-concept)
+        ;; We have already checked for approval in the ingest application.
         gen-name (util/safe-lowercase (get-in parsed-concept [:MetadataSpecification :Name]))
         gen-ver (get-in parsed-concept [:MetadataSpecification :Version])
-        approved (approved-generic? (keyword gen-name) gen-ver)]
-    (when approved
-      (let [index-data-file (format "schemas/%s/v%s/index.json" gen-name gen-ver)
-            index-file-raw (slurp (clojure.java.io/resource index-data-file))
-            index-data (json/parse-string index-file-raw true)
-            schema-keys [:LongName
-                         :Version
-                         :Description
-                         :RelatedURLs]
-            keyword-values (keyword-util/concept-keys->keyword-text
-                            parsed-concept schema-keys)
-            common-doc ;; fields common to all generic documents
-            {:concept-id concept-id
-             :revision-id revision-id
-             :deleted deleted
-             :gen-name gen-name
-             :gen-name-lowercase (util/safe-lowercase gen-name)
-             :gen-version gen-ver
-             :generic-type (str gen-name " " gen-ver)
-             :provider-id provider-id
-             :provider-id-lowercase (util/safe-lowercase provider-id)
-             :keyword keyword-values
-             :user-id user-id
-             :revision-date revision-date
-             :native-id native-id
-             :native-id-lowercase native-id
-             :associations-gzip-b64 (associations->gzip-base64-str generic-assoc-ids)}
-             configs (gen-util/only-elastic-preferences (:Indexes index-data))
+        index-data-file (format "schemas/%s/v%s/index.json" gen-name gen-ver)
+        index-file-raw (slurp (io/resource index-data-file))
+        index-data (json/parse-string index-file-raw true)
+        schema-keys [:LongName
+                     :Version
+                     :Description
+                     :RelatedURLs]
+        keyword-values (keyword-util/concept-keys->keyword-text
+                        parsed-concept schema-keys)
+        common-doc ;; fields common to all generic documents
+        {:concept-id concept-id
+         :revision-id revision-id
+         :deleted deleted
+         :gen-name gen-name
+         :gen-name-lowercase (util/safe-lowercase gen-name)
+         :gen-version gen-ver
+         :generic-type (str gen-name " " gen-ver)
+         :provider-id provider-id
+         :provider-id-lowercase (util/safe-lowercase provider-id)
+         :keyword keyword-values
+         :user-id user-id
+         :revision-date revision-date
+         :native-id native-id
+         :native-id-lowercase native-id
+         :associations-gzip-b64 (associations->gzip-base64-str generic-assoc-ids)}
+        configs (gen-util/only-elastic-preferences (:Indexes index-data))
              ;; now add the configured indexes
-             doc (reduce
-                  (fn [data, config] (into data (field->index config parsed-concept)))
-                  common-doc
-                  configs)]
-             (if deleted
-               (assoc common-doc :metadata-format (name (mtype/format-key (:mime-type extra-fields)))
-                      :gen-type-lowercase (util/safe-lowercase gen-name)
-                      :long-name long-name
-                      :long-name-lowercase (util/safe-lowercase long-name))
-               doc)))))
+        doc (reduce
+             (fn [data, config] (into data (field->index config parsed-concept)))
+             common-doc
+             configs)]
+      (if deleted
+        (assoc common-doc :metadata-format (name (mtype/format-key (:mime-type extra-fields)))
+               :gen-type-lowercase (util/safe-lowercase gen-name)
+               :long-name long-name
+               :long-name-lowercase (util/safe-lowercase long-name))
+        doc)
+      ))

 (doseq [concept-type (concepts/get-generic-concept-types-array)]
   (defmethod esearch/parsed-concept->elastic-doc concept-type


moving a comment

moving a comment

--- src/Makefile.boot
+++ src/Makefile.boot
@@ -51,14 +51,13 @@
 	  $(addprefix --no_extract , $(NO_EXTRACT))

 # We first lax type-check each file, producing a .checked.lax file
+# We touch the file, because if F* determined that the .checked.lax
+# file was already up to date, it doesn't touch it. Touching it here
+# ensures that if this rule is successful then %.checked.lax is more
+# recent than its dependences.
 %.checked.lax: %
 	$(FSTAR_C) $*
-	touch $@      #we touch the file, because if F* determined
-		      #that the .checked.lax file was already up to
-		      #date, it doesn't touch it. Touching it here
-		      #ensures that if this rule is successful then
-		      #%.checked.lax is more recent than its
-		      #dependences
+	touch $@

 # And then, in a separate invocation, from each .checked.lax we
 # extract an .ml file


Remove one more loop/recur

Remove one more loop/recur

--- server/src/bond/views/redis.clj
+++ server/src/bond/views/redis.clj
@@ -45,12 +45,7 @@

 (defn get-hit-list [num]
   "Get all hits from Redis up to `num`."
-  (loop [count num result '()]
-        (if (zero? count)
-          result
-          (recur
-            (dec count)
-            (cons (hgetall (str "hit:" (Integer/toString count))) result)))))
+  (map (fn [x] (hgetall (str "hit:" (Integer/toString x)))) (range 1 num)))

 (defn date-to-string [d]
   "Convert a clj-time datetime object to string."


Preparing for spatial distribution parameters.

--- src/afterglow/effects/params.clj
+++ src/afterglow/effects/params.clj
@@ -292,9 +292,6 @@
               (build-oscillated-param osc :min (resolve-unless-frame-dynamic min show snapshot)
                                       :max (resolve-unless-frame-dynamic max show snapshot)
                                       :metronome metronome :frame-dynamic dyn))))))))
-
-;; TODO metronome parameters, with access to the show metronome and other metronome variables
-

 (defn interpret-color
   "Accept a color as either
@@ -439,4 +436,12 @@
           (evaluate-for-head [this show snapshot head] (eval-fn show snapshot head))
           (resolve-non-frame-dynamic-elements-for-head [this show snapshot head] (resolve-fn show snapshot head)))))))

-;; TODO some kind of random parameter?
+(defn build-linear-spatial-param
+  "Returns a dynamic number parameter related to the physical
+  arrangement of the supplied fixture heads."
+  {:doc/format :markdown}
+  [heads & {:keys [start end circular] :or {start 0 end 255 }}]
+  {:pre [(some? *show*) (seq? heads)]}
+)
+
+;; TODO: some kind of random parameter?


Reorder some example code

Reorder some example code

--- examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs
+++ examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs
@@ -6,6 +6,14 @@
             [reitit.frontend :as rf]
             [reitit.frontend.controllers :as rfc]
             [reitit.frontend.easy :as rfe]))
+
+;;; Effects ;;;
+
+;; Triggering navigation from events.
+
+(re-frame/reg-fx :push-state
+  (fn [route]
+    (apply rfe/push-state route)))

 ;;; Events ;;;

@@ -16,7 +24,7 @@
       {:current-route nil})))

 (re-frame/reg-event-fx ::push-state
-  (fn [db [_ & route]]
+  (fn [_ [_ & route]]
     {:push-state route}))

 (re-frame/reg-event-db ::navigated
@@ -48,14 +56,6 @@
 (defn sub-page2 []
   [:div
    [:h1 "This is sub-page 2"]])
-
-;;; Effects ;;;
-
-;; Triggering navigation from events.
-
-(re-frame/reg-fx :push-state
-  (fn [route]
-    (apply rfe/push-state route)))

 ;;; Routes ;;;


server.clj: enable auto-refresh in the fast mode

Enable auto-reloading of the blog's changed page in the browser if in the fast serve mode.

It only makes sense in the fast mode because the ring refresh middleware kicks in soon after it detects any change in the output dir - likely a while before Cryogen gets to compiling the page the user is currently viewing/editing - and thus it will try to load a url that it not yet available, resulting in Not Found.

--- src/leiningen/new/cryogen/src/cryogen/server.clj
+++ src/leiningen/new/cryogen/src/cryogen/server.clj
@@ -1,32 +1,38 @@
 (ns cryogen.server
-  (:require
-   [clojure.string :as string]
-   [compojure.core :refer [GET defroutes]]
-   [compojure.route :as route]
-   [ring.util.response :refer [redirect file-response]]
-   [ring.util.codec :refer [url-decode]]
-   [ring.server.standalone :as ring-server]
-   [cryogen-core.watcher :refer [start-watcher! start-watcher-for-changes!]]
-   [cryogen-core.plugins :refer [load-plugins]]
-   [cryogen-core.compiler :refer [compile-assets-timed]]
-   [cryogen-core.config :refer [resolve-config]]
-   [cryogen-core.io :refer [path]]))
+  (:require
+    [compojure.core :refer [GET defroutes]]
+    [compojure.route :as route]
+    [ring.util.response :refer [redirect file-response]]
+    [ring.util.codec :refer [url-decode]]
+    [ring.server.standalone :as ring-server]
+    [cryogen-core.watcher :refer [start-watcher! start-watcher-for-changes!]]
+    [cryogen-core.plugins :refer [load-plugins]]
+    [cryogen-core.compiler :refer [compile-assets-timed]]
+    [cryogen-core.config :refer [resolve-config]]
+    [cryogen-core.io :refer [path]]
+    [clojure.string :as string])
+  (:import (java.io File)))
+
+(def resolved-config (delay (resolve-config)))
+
+(def extra-config-dev
+  "Add dev-time configuration overrides here, such as `:hide-future-posts? false`"
+  {})

 (defn init [fast?]
-  (println "Init: fast compile enabled = " (boolean fast?))
   (load-plugins)
-  (compile-assets-timed)
-  (let [ignored-files (-> (resolve-config) :ignored-files)]
+  (compile-assets-timed extra-config-dev)
+  (let [ignored-files (-> @resolved-config :ignored-files)]
     (run!
       #(if fast?
-         (start-watcher-for-changes! % ignored-files compile-assets-timed {})
+         (start-watcher-for-changes! % ignored-files compile-assets-timed extra-config-dev)
          (start-watcher! % ignored-files compile-assets-timed))
       ["content" "themes"])))

 (defn wrap-subdirectories
   [handler]
   (fn [request]
-    (let [{:keys [clean-urls blog-prefix public-dest]} (resolve-config)
+    (let [{:keys [clean-urls blog-prefix public-dest]} @resolved-config
           req-uri (.substring (url-decode (:uri request)) 1)
           res-path (if (or (.endsWith req-uri "/")
                            (.endsWith req-uri ".html")
@@ -46,8 +52,15 @@
                                             (path (str req-uri ".html")))
                        :dirty (path (str req-uri ".html")))
                      req-uri)]
-      (or (file-response res-path {:root public-dest})
-          (handler request)))))
+        (or (let [rsp (file-response res-path {:root public-dest})
+                  body (:body rsp)]
+              ;; Add content-type; it cannot be derived from the extension if `:[no-]trailing-slash`
+              (cond-> rsp
+                      (and body
+                           (instance? File body)
+                           (string/ends-with? (.getName body) ".html"))
+                      (assoc-in [:headers "Content-Type"] "text/html")))
+            (handler request)))))

 (defroutes routes
   (GET "/" [] (redirect (let [config (resolve-config)]
@@ -61,10 +74,22 @@

 (defn serve
   "Entrypoint for running via tools-deps (clojure)"
-  [{:keys [fast] :as opts}]
+  [{:keys [fast join?] :as opts}]
   (ring-server/serve
     handler
-    (merge {:init (partial init fast)} opts)))
+    (merge
+      {:join? (if (some? join?) join? true)
+       :init (partial init fast)
+       :open-browser? true
+       :auto-refresh? fast ; w/o fast it would often try to reload the page before it has been fully compiled
+       :refresh-paths [(:public-dest @resolved-config)]}
+      opts)))

 (defn -main [& args]
-  (serve {:port 3000, :fast ((set args) "fast")}))
+  (serve {:port 3000 :fast ((set args) "fast")}))
+
+(comment
+  (def srv (serve {:join? false, :fast true}))
+  (.stop srv)
+
+  ,)


improved multimethod support

improved multimethod support

--- src/com/billpiel/sayid/trace.clj
+++ src/com/billpiel/sayid/trace.clj
@@ -106,14 +106,47 @@

 ;; mk-fn-tree + start-trace + binding + end-trace = 345ms

+(defn shallow-tracer-multifn*
+  [workspace qual-sym meta' original-fn]
+  (fn tracing-wrapper [& args]
+    (let [dispatch-fn (.-dispatchFn original-fn)
+          dispatch-val (trace-fn-call workspace
+                                      (symbol (format "%s-DISPATCHER" qual-sym))
+                                      dispatch-fn
+                                      args
+                                      {})
+          target-fn (.getMethod original-fn dispatch-val)]
+      (trace-fn-call workspace
+                     qual-sym
+                     target-fn
+                     args
+                     meta'))))
+
+(defn shallow-tracer-multifn
+  [{:keys [workspace qual-sym meta']} original-fn]
+  (let [mfn (new clojure.lang.MultiFn
+                 (str qual-sym)
+                 (fn [& args] nil)
+                 nil
+                 (clojure.lang.Var/create))]
+    (.addMethod mfn
+                nil
+                (shallow-tracer-multifn* workspace
+                                         qual-sym
+                                         meta'
+                                         original-fn))
+    mfn))
+
 (defn ^{::trace-type :fn} shallow-tracer
-  [{:keys [workspace qual-sym meta']} original-fn]
-  (fn tracing-wrapper [& args]
-    (trace-fn-call workspace
-                   qual-sym
-                   original-fn
-                   args
-                   meta')))
+  [{:keys [workspace qual-sym meta'] :as m} original-fn]
+  (if (= (type original-fn) clojure.lang.MultiFn)
+    (shallow-tracer-multifn m original-fn)
+    (fn tracing-wrapper [& args]
+      (trace-fn-call workspace
+                     qual-sym
+                     original-fn
+                     args
+                     meta'))))

 (defn apply-trace-to-var
   [^clojure.lang.Var v tracer-fn workspace]


adding support for the harmonic mean reducer

--- src/anyviz/views.clj
+++ src/anyviz/views.clj
@@ -34,7 +34,7 @@

 (def match-operators ["=","!=","<","<=",">",">="])
 (def group-times ["year","month","day","hour","minute"])
-(def reduce-operators ["count","min","max","sum","avg","stdev","range","variance"])
+(def reduce-operators ["count","min","max","sum","avg","harmonicmean","stdev","variance","range"])
 (def date-periods ["all time","last year","last 6 months","last 30 days","last 7 days","last day","last hour"])
 (def graph-types ["spline","column","line","area","bar","areaspline","scatter"])
 (def bs-columns ["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"])


removed unused println

removed unused println

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -413,7 +413,6 @@
                          (map #(when (= (:login %) selected-org) {:selected-org (:login %) :show-upsell? (:show_upsell? %)}))
                          (filter some?)
                          (first))]
-            (println selected-org)
             (if (or (= selected-org (:login user)) (:show-upsell? org))
               (om/build payment-plan {:selected-org selected-org
                                       :view view})))]]]])))


Blinken should refresh itself

Blinken should refresh itself

I accidently committed the removal of the refresh meta tag. It is most
definitely a requirement that this page should refresh itself so I am
adding it back.

--- src/govuk/blinken/dashboard.clj
+++ src/govuk/blinken/dashboard.clj
@@ -91,7 +91,7 @@
    [:head
     [:title  "Blinken"]
     [:meta {:name "viewport" :content "width=device-width"}]
-    (comment [:meta {:http-equiv "refresh" :content "10"}])
+    [:meta {:http-equiv "refresh" :content "10"}]
     (page/include-css "/static/main.css")
     (page/include-css "/static/dashboard.css")
     (page/include-css "/static/detail.css")]


Refactor to call handler instead of dispatch, when possible

--- src/braid/client/dispatcher.cljs
+++ src/braid/client/dispatcher.cljs
@@ -211,12 +211,12 @@

 (defmethod handler :add-notification-rule [state [_ rule]]
   (let [current-rules (get (helpers/get-user-preferences state) :notification-rules [])]
-    (dispatch! :set-preference [:notification-rules (conj current-rules rule)])))
+    (handler state [:set-preference [:notification-rules (conj current-rules rule)]])))

 (defmethod handler :remove-notification-rule [state [_ rule]]
   (let [new-rules (->> (get (helpers/get-user-preferences state) :notification-rules [])
                        (into [] (remove (partial = rule))))]
-    (dispatch! :set-preference [:notification-rules new-rules])))
+    (handler state [:set-preference [:notification-rules new-rules]])))

 (defmethod handler :clear-search-error [state _]
   (helpers/clear-search-error state))
@@ -303,10 +303,11 @@
   (helpers/focus-thread state thread-id))

 (defmethod handler :clear-inbox [state [_ _]]
-  (let [open-thread-ids (map :id (helpers/get-open-threads state))]
-    (doseq [id open-thread-ids]
-      (dispatch! :hide-thread {:thread-id id :local-only? false})))
-  state)
+  (->> (helpers/get-open-threads state)
+       (map :id )
+       (reduce (fn [state id]
+                 (handler state [:hide-thread {:thread-id id :local-only? false}]))
+               state)))

 (defmethod handler :invite [state [_ data]]
   (let [invite (schema/make-invitation data)]
@@ -384,8 +385,7 @@
 (defmethod handler :create-upload [state [_ {:keys [url thread-id group-id]}]]
   (sync/chsk-send! [:braid.server/create-upload
                     (schema/make-upload {:url url :thread-id thread-id})])
-  (dispatch! :new-message {:content url :thread-id thread-id :group-id group-id})
-  state)
+  (handler state [:new-message {:content url :thread-id thread-id :group-id group-id}]))

 (defmethod handler :get-group-uploads [state [_ {:keys [group-id on-success on-error]}]]
   (sync/chsk-send!
@@ -466,9 +466,9 @@
           tags))

 (defmethod handler :notify-if-client-out-of-date [state [_ server-checksum]]
-  (when (not= (aget js/window "checksum") server-checksum)
-    (dispatch! :display-error [:client-out-of-date "Client out of date - please refresh" :info]))
-  state)
+  (if (not= (aget js/window "checksum") server-checksum)
+    (handler state [:display-error [:client-out-of-date "Client out of date - please refresh" :info]])
+    state))

 (defmethod handler :set-init-data [state [_ data]]
   (-> state


+ "gli" -> "i"

+ "gli" -> "i"

--- src/babel/italiano/morphology/determiners.cljc
+++ src/babel/italiano/morphology/determiners.cljc
@@ -9,6 +9,12 @@

 (def replace-patterns
   [
+
+   {:p [#"^gli$" "i"] ;; "gli" -> "i"
+    :u {:synsem {:cat :det
+                 :agr {:number :plur
+                       :gender :masc}}}}
+
    {:p [#"^l$" "la"] ;; "l'" -> "la"
     :u {:synsem {:cat :det
                  :agr {:number :sing


omit incorrect/unwanted type hint

omit incorrect/unwanted type hint

--- src/asphalt/core.clj
+++ src/asphalt/core.clj
@@ -186,7 +186,7 @@
         (let [^Connection connection data-source-or-connection]
           (.setAutoCommit connection false)
           (when-not (nil? transaction-isolation)
-            (.setTransactionIsolation connection ^int (i/resolve-txn-isolation transaction-isolation)))
+            (.setTransactionIsolation connection (i/resolve-txn-isolation transaction-isolation)))
           (try
             (let [result (connection-worker connection)]
               (.commit connection)
@@ -220,7 +220,7 @@
     (if (instance? DataSource data-source)
       (with-open [^Connection connection (.getConnection ^DataSource data-source)]
         (.setAutoCommit connection false)
-        (.setTransactionIsolation connection ^int (i/resolve-txn-isolation isolation))
+        (.setTransactionIsolation connection (i/resolve-txn-isolation isolation))
         (try
           (let [result (f connection)]
             (.commit connection)


formatting

formatting

--- src/chat/server/email_digest.clj
+++ src/chat/server/email_digest.clj
@@ -19,7 +19,8 @@
 ; finding data

 (defn thread-unseen?
-  "A thread is unseen if it's last-open-at is prior to any of the messages' created-at"
+  "A thread is unseen if it's last-open-at is prior to any of the messages'
+  created-at"
   [thread]
   (let [last-open (to-date-time (thread :last-open-at))]
     (some (fn [{:keys [created-at]}]
@@ -51,8 +52,9 @@
             (-> content
                 (string/replace tag-re
                                 (comp (partial str "#") id->tag str->uuid second))
-                (string/replace mention-re
-                                (comp (partial str "@") id->nick str->uuid second))))
+                (string/replace
+                  mention-re
+                  (comp (partial str "@") id->nick str->uuid second))))
           pretty-time (comp
                         (partial format/unparse (format/formatter "h:mm MMM d"))
                         to-date-time)]
@@ -62,18 +64,22 @@
               (filter (partial last-message-after? cutoff))
               (map
                 (fn [t]
-                  (let [thread-last-open (to-date-time (db/thread-last-open-at t user-id))]
+                  (let [thread-last-open (to-date-time
+                                           (db/thread-last-open-at t user-id))]
                     (update t :messages
                             (partial map
                                      (fn [{sender-id :user-id :as m}]
                                        (-> m
                                            (update :content parse-tags-and-metions)
                                            (assoc :unseen
-                                             (if (time/before? (to-date-time (m :created-at)) thread-last-open)
+                                             (if (time/before?
+                                                   (to-date-time (m :created-at))
+                                                   thread-last-open)
                                                "seen" "unseen"))
                                            (update :created-at pretty-time)
                                            (assoc :sender (id->nick sender-id))
-                                           (assoc :sender-avatar (id->avatar sender-id))))))))))
+                                           (assoc :sender-avatar
+                                                  (id->avatar sender-id))))))))))
             (db/get-open-threads-for-user user-id)))))

 (defn daily-update-users
@@ -93,7 +99,8 @@
   [threads]
   {:html  (inline-css (render-resource "templates/email_digest.html.mustache"
                                        {:threads threads}))
-   :text (render-resource "templates/email_digest.txt.mustache" {:threads threads})})
+   :text (render-resource "templates/email_digest.txt.mustache"
+                          {:threads threads})})

 ; sending


Fix syntax error in ugen metadata introduced in a previous commit.

--- src/overtone/sc/machinery/ugen/metadata/misc.clj
+++ src/overtone/sc/machinery/ugen/metadata/misc.clj
@@ -191,8 +191,8 @@
                :default 0.5
                :doc "amount of tail level"}

-              {:name "maxroomsize", :
-               default 300.0,
+              {:name "maxroomsize"
+               :default 300.0,
                :doc "to set the size of the delay lines." }],

        :rates #{:ar},


#5 - Consolidated io state to single atom. Abstracted XhrManager with a protocol for testability.

--- src/bible/io.cljs
+++ src/bible/io.cljs
@@ -19,73 +19,85 @@
             [goog.net.XhrManager :as xhr]
             [goog.object :as obj]))

-(def ^:private resource-ids (atom nil))
-(def ^:private resource-cache (atom {}))
-(def ^:private pending-resource (atom {}))
-(def ^:private resource-msg-chan (chan 10))
-(def ^:private xhr-manager (goog.net.XhrManager. 3 nil nil nil 10000))
+(def ^:private state (atom {:eventloop (chan 10)}))
+
+(defprotocol ResourceStore
+  (get-resource [this resid cb] "The cb should have this signature: (fn [{content :content err :err}] ...)."))
+
+(defn ^:private url-from-resid [state resid]
+  (let [short-hash (get-in state [:hash resid])]
+    (str "/" resid "-" short-hash ".d")))
+
+(deftype XhrManagerSource [mgr]
+  ResourceStore
+  (get-resource [this resid cb]
+    (let [url (url-from-resid @state resid)
+          on-response
+            (fn [e]
+              (cb {:content (.getResponseText (obj/get e "target"))}))]
+      (.send mgr resid url "GET" nil nil 1 on-response))))
+
+(defn set-resource-store-to-xhr-manager []
+  (swap! state #(assoc % :store (XhrManagerSource. (goog.net.XhrManager. 3 nil nil nil 10000)))))

 (defn ^:export set-resource-ids [resid-map]
   (if (object? resid-map)
     (recur (js->clj resid-map))
-    (reset! resource-ids resid-map)))
-
-(defn reset-resource-cache! []
-  (reset! resource-cache {}))
+    (swap! state #(assoc % :hash resid-map))))

 (defn tryget-resources
   ([resids]
-    (tryget-resources @resource-cache resids))
-  ([res resids]
+    (tryget-resources (:cache @state) resids))
+  ([cache resids]
     (loop [ret {} ids (seq resids)]
       (if ids
-        (if-let [entry (find res (first ids))]
+        (if-let [entry (find cache (first ids))]
           (recur
             (conj ret entry)
             (next ids))
           nil)
         ret))))

-(defn ^:private url-from-resid [resid]
-  (let [short-hash (@resource-ids resid)]
-    (str "/" resid "-" short-hash ".d")))
-
-(defn ^:private post-msg [msg]
-  (put! resource-msg-chan msg))
+(defn ^:private post-msg
+  ([msg] (post-msg (:eventloop @state) msg))
+  ([eventloop msg] (put! eventloop msg)))

 (defmulti resource-event #(:type %))

 (defn ^:private do-fetch-resource [resid response-ch]
   (let [ch (chan 1)
         m (mult ch)
-        url (url-from-resid resid)
-        cb (fn [e]
+        url (url-from-resid @state resid)
+        cb (fn [{content :content err :err}]
             (post-msg {:type :response
                        :resid resid
-                       :content (.getResponseText (obj/get e "target"))
+                       :content content
                        :chan ch}))]
-    (swap! pending-resource #(assoc % resid m))
+    (swap! state #(assoc-in % [:pending resid] m))
     (tap m response-ch)
-    (.send xhr-manager resid url "GET" nil nil 1 cb)))
+    (get-resource (:store @state) resid cb)))

 (defmethod resource-event :fetch [{resid :resid response-ch :response-ch}]
-  (if-let [v (get @resource-cache resid)]
+  (if-let [v (get-in @state [:cache resid])]
     (put! response-ch {:resid resid :val v})
-    (if-let [m (get @pending-resource resid)]
+    (if-let [m (get-in @state [:pending resid])]
       (tap m response-ch)
       (do-fetch-resource resid response-ch))))

 (defmethod resource-event :response [{resid :resid content :content ch :chan}]
   (let [reader (t/reader :json)
         data   (t/read reader content)]
-    (swap! pending-resource #(dissoc % resid))
-    (swap! resource-cache #(assoc % resid data))
+    (swap! state
+      (fn [st]
+        (-> st
+          (update-in [:pending] #(dissoc % resid))
+          (update-in [:cache] #(assoc % resid data)))))
     (put! ch {:resid resid :val data})))

 (defn ^:private resource-loop []
-  (go-loop [msg (<! resource-msg-chan)]
+  (go-loop [msg (<! (:eventloop @state))]
     (resource-event msg)
-    (recur (<! resource-msg-chan))))
+    (recur (<! (:eventloop @state)))))

 (defn ^:private fetch-resource [resid]
   (let [ch (chan 1)]
@@ -120,8 +132,9 @@

 (defn resources [resids]
   (->>
-    (split-pending @resource-cache resids)
+    (split-pending (:cache @state) resids)
     (park-while-pending)))

 ;; fire up the event loop
+(set-resource-store-to-xhr-manager)
 (resource-loop)


use https in the links

use https in the links

--- src/jarkeeper/views/project.clj
+++ src/jarkeeper/views/project.clj
@@ -4,7 +4,7 @@
             [hiccup.core :refer [html]]
             [hiccup.page :refer [html5 include-css include-js]]
             [hiccup.util :refer [escape-html]]))
-
+
 (defn- render-deps [deps]
   (for [dep deps]
     [:tr
@@ -76,11 +76,11 @@
         [:h2 "Markdown with PNG image"]
         [:code
            (str "[![Dependencies Status]"
-                "(http://jarkeeper.com/"
+                "(https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
-                "/status.png)](http://jarkeeper.com/"
+                "/status.png)](https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
@@ -88,11 +88,11 @@
         [:h2 "HTML with PNG image"]
         [:code
            (escape-html (str "<img src=\"https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
@@ -101,11 +101,11 @@
         [:h2 "Markdown with SVG image"]
         [:code
            (str "[![Dependencies Status]"
-                "(http://jarkeeper.com/"
+                "(https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
-                "/status.svg)](http://jarkeeper.com/"
+                "/status.svg)](https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
@@ -113,11 +113,11 @@
         [:h2 "HTML with SVG image"]
         [:code
            (escape-html (str "<img src=\"https://jarkeeper.com/"
                 (:repo-owner project)
                 "/"
                 (:repo-name project)


Fix X-strength ice breakers (Darwin)

Fix X-strength ice breakers (Darwin)

fixes #1498

--- src/clj/game/core-installing.clj
+++ src/clj/game/core-installing.clj
@@ -68,7 +68,8 @@
          recurring (:recurring cdef)
          abilities (ability-init cdef)
          c (merge card (:data cdef) {:abilities abilities})
-         c (if (number? recurring) (assoc c :rec-counter recurring) c)]
+         c (if (number? recurring) (assoc c :rec-counter recurring) c)
+         c (if (string? (:strength c)) (assoc c :strength 0) c)]
      (when recurring
        (let [r (if (number? recurring)
                  (effect (set-prop card :rec-counter recurring))


Revert "Exclude Latin Small Letter Dotless I from valid hyphenations"

This reverts commit a25365bd10dac9aef84ea6bc948d460242ace13f.

They want Latin Small Letter Dotless I after all.

--- src/cljc/hyphen_keeper/util.cljc
+++ src/cljc/hyphen_keeper/util.cljc
@@ -12,14 +12,5 @@
        (not (string/starts-with? hyphenation "-"))
        (not (string/ends-with? hyphenation "-"))
        (not (string/includes? hyphenation "--"))
-       ;; only allow chars in the unicode range of Basic Latin (a-z),
-       ;; Latin-1 Supplement (the printable chars in 00C0-00FF) and
-       ;; Latin Extended-A (0100—017F), see
-       ;; https://unicode-table.com/en/blocks/basic-latin,
-       ;; https://unicode-table.com/en/blocks/latin-1-supplement and
-       ;; https://unicode-table.com/en/blocks/latin-extended-a
+       (some? (re-matches #"[a-z\xC0-\xFF\u0100-\u017F-]+" hyphenation))))

-       ;; Exclude Latin Small Letter Dotless I (0131) because it seems
-       ;; to cause libhyphen to crash
-       (some? (re-matches #"[a-z\xC0-\xFF\u0100-\u0130\u0132-\u017F-]+" hyphenation))))
-


Do not show hyphenation lookup for old spelling

--- src/cljs/hyphen_keeper/core.cljs
+++ src/cljs/hyphen_keeper/core.cljs
@@ -203,13 +203,16 @@
 (defn- button [label href disabled]
   [:a.btn.btn-default {:href href :target "_blank" :disabled disabled} label])

-(defn hyphenation-lookup [word]
-  (let [disabled (when (string/blank? word) "disabled")]
-    [:div.row
-     [:div.btn-group {:role "group" :aria-label "Buttons for hyphenation lookup"}
-      (button "Duden" (str "http://www.duden.de/suchen/dudenonline/" word) disabled)
-      (button "TU Chemnitz" (str "http://dict.tu-chemnitz.de/?query=" word) disabled)
-      (button "PONS" (str "http://de.pons.eu/dict/search/results/?l=dede&q=" word) disabled)]]))
+(defn hyphenation-lookup-ui [spelling word]
+  (when (= @spelling 1)
+    [:div
+     [:h2 "Lookup"]
+     (let [disabled (when (string/blank? word) "disabled")]
+       [:div.row
+        [:div.btn-group {:role "group" :aria-label "Buttons for hyphenation lookup"}
+         (button "Duden" (str "http://www.duden.de/suchen/dudenonline/" word) disabled)
+         (button "TU Chemnitz" (str "http://dict.tu-chemnitz.de/?query=" word) disabled)
+         (button "PONS" (str "http://de.pons.eu/dict/search/results/?l=dede&q=" word) disabled)]])]))

 (defn- navbar-ui [active]
   [:nav.navbar.navbar-default
@@ -240,9 +243,13 @@
    [:h2 "Insert Hyphenations"]
    [:div.row
     [:div.col-md-6
-     [new-hyphenation]]]
-   [:h2 "Lookup"]
-   [hyphenation-lookup @word]
+     [:div.form
+      [spelling-ui]
+      [word-ui]
+      [suggested-hyphenation-ui]
+      [hyphenation-ui]
+      [hyphenation-add-ui]]]]
+   [hyphenation-lookup-ui spelling @word]
    [:h2 "Similar words"]
    [:div.row
     [:table#hyphenations.table.table-striped


try to remove warning

try to remove warning

--- src/cljs/just_married/views.cljs
+++ src/cljs/just_married/views.cljs
@@ -29,7 +29,7 @@
         (into
          [:ul {:class "nav navbar-nav"}]
          (for [sec SECTIONS-SIMPLE]
-           [:li
+           [:li {:key (name sec)}
             [:a {:href (str "#" (name sec))} (tr sec)]]))

         [:ul {:class "nav navbar-right"}


Fix doc related issues in channel monad ns.

--- src/cljx/cats/monad/channel.cljx
+++ src/cljx/cats/monad/channel.cljx
@@ -46,7 +46,8 @@
 ;; Monad definition
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def channel-monad
+(def ^{:no-doc true}
+  channel-monad
   (reify
     proto/Functor
     (fmap [mn f mv]
@@ -97,4 +98,3 @@
   ([value ch]
    (put! ch value)
    ch))
-


Refactor vec logic to match string (think about refactoring cuz the code makes no sense)

--- src/cljx/transom/sequential.cljx
+++ src/cljx/transom/sequential.cljx
@@ -5,7 +5,30 @@
   #+cljs
   (:require-macros [cljs.core.match.macros :refer [match]]))

-(defn ^:private count-before
+(def ^:private nop? (some-fn nil? #(= (second %) 0) #(= (second %) [])))
+
+(defn pack
+  [edit]
+  (let [edit (remove nop? edit)]
+    (reduce
+      (fn [edit op]
+        (let [[o1 p1] (peek edit)
+              [o2 p2] op]
+          (if (= o1 o2)
+            (conj (pop edit)
+                  (case o1
+                    :retain [:retain (+ p1 p2)]
+                    :delete [:delete (+ p1 p2)]
+                    :insert [:insert (into p1 p2)]))
+            (conj edit op))))
+      (vec (take 1 edit))
+      (rest edit))))
+
+(defn ^:private pack-pairs
+  [pairs]
+  (map pack (apply mapv vector pairs)))
+
+(defn count-before
   [edit]
   (letfn
     [(inc-count
@@ -16,7 +39,7 @@
         :insert c))]
     (reduce inc-count 0 edit)))

-(defn ^:private count-after
+(defn count-after
   [edit]
   (letfn
     [(inc-count
@@ -27,128 +50,90 @@
         :insert (+ c (count p))))]
     (reduce inc-count 0 edit)))

+(defn ^:private common-prefix
+  [a b]
+  (let [a-count (count a)
+        b-count (count b)]
+    (loop [i 0]
+      (if (and (< i a-count) (< i b-count) (= (nth a i) (nth b i)))
+        (recur (inc i))
+        i))))
+
+(defn ^:private common-suffix
+  [a b]
+  (let [a-count (count a)
+        b-count (count b)]
+    (loop [i 0]
+      (if (and (< i a-count) (< i b-count)
+               (= (nth a (- a-count i 1)) (nth b (- b-count i 1))))
+        (recur (inc i))
+        i))))
+
+(defn ^:private create-edit
+  [a b pre suf]
+  (pack [[:retain pre]
+         [:delete (- (count a) pre suf)]
+         [:insert (subvec b pre (- (count b) suf))]
+         [:retain suf]]))
+
+(defn diff
+  [a b]
+  (if (= a b)
+    (pack [[:retain (count a)]]) ;; don't forget to wrap it dummy
+    (let [pre (common-prefix a b)
+          suf (common-suffix a b)]
+      (if (< pre suf)
+        (let [a' (subvec a 0 (- (count a) suf))
+              b' (subvec b 0 (- (count b) suf))
+              pre (common-prefix a' b')]
+          (create-edit a b pre suf))
+        (let [a' (subvec a pre)
+              b' (subvec b pre)
+              suf (common-suffix a' b')]
+          (create-edit a b pre suf))))))
+
 (defn patch
   ([doc edit]
     (assert (= (count doc) (count-before edit))
             (str "transom/patch: length mismatch" \newline
                  "Doc: " doc \newline
                  "Edit: " edit))
-    (loop [doc doc, edit edit, out nil]
-      (if (empty? edit)
-        (vec out)
-        (let [[o p] (first edit)
-              r (rest edit)]
-          (case o
-            :retain (recur (drop p doc) r (concat out (take p doc)))
-            :delete (recur (drop p doc) r out)
-            :insert (recur doc r (concat out p)))))))
+    (second (reduce
+              (fn [[doc out] [o p]]
+                (case o
+                  :retain [(subvec doc p) (into out (subvec doc 0 p))]
+                  :delete [(subvec doc p) out]
+                  :insert [doc (into out p)]))
+              [doc []]
+              edit)))
   ([doc edit & edits]
     (reduce patch (patch doc edit) edits)))
-
-(defn pack
-  [edit]
-  (letfn
-    [(nop?
-      [op]
-      (or (keyword? op) (= (second op) 0) (= (second op) [])))
-     (combinable?
-       [[o1] [o2]]
-       (= o1 o2))
-     (combine
-       [op1 op2]
-       (match [op1 op2]
-         [[:retain p1] [:retain p2]] [:retain (+ p1 p2)]
-         [[:delete p1] [:delete p2]] [:delete (+ p1 p2)]
-         [[:insert p1] [:insert p2]] [:insert (vec (concat p1 p2))]))
-     (reducer
-       ;; pop as in previous op
-       ;; cop as in current op
-       [[pop edit' :as prev] cop]
-       (cond
-         (nop? cop) prev
-         (nil? pop) [cop edit']
-         (combinable? pop cop) [(combine pop cop) edit']
-         :else [cop (conj edit' pop)]))]
-    (let [[pop edit'] (reduce reducer [nil []] edit)]
-      (if (nil? pop)
-        edit'
-        (conj edit' pop)))))
-
-(defn pack-pairs
-  [pairs]
-  (map pack (apply mapv vector pairs)))
-
-(defn ^:private align-transform
-  [edit1 edit2]
-  (loop [edit1 edit1, edit2 edit2, out []]
-    (let [op1 (first edit1) op2 (first edit2)]
-      (cond
-        (nil? op1) (concat out (map #(vector :nop %) edit2))
-        (nil? op2) (concat out (map #(vector % :nop) edit1))
-        (= :insert (first op1)) (recur (rest edit1) edit2 (conj out [op1 :nop]))
-        (= :insert (first op2)) (recur edit1 (rest edit2) (conj out [:nop op2]))
-        :else
-        (let [[o1 p1] op1
-              [o2 p2] op2]
-          (case (compare p1 p2)
-            -1 (recur (rest edit1)
-                      (cons [o2 (- p2 p1)] (rest edit2))
-                      (conj out [op1 [o2 p1]]))
-            0  (recur (rest edit1) (rest edit2)
-                      (conj out [op1 op2]))
-            1  (recur (cons [o1 (- p1 p2)] (rest edit1))
-                      (rest edit2)
-                      (conj out [[o1 p2] op2]))))))))
-
-(defn transform
-  [edit1 edit2]
-  (assert (= (count-before edit1) (count-before edit2))
-          (str "transom/transform: length mismatch" \newline
-               "Edit 1: " edit1 \newline
-               "Edit 2: " edit2))
-  (letfn
-    [(compare-ops
-       [out [op1 op2]]
-       (match [op1 op2]
-         [[:insert p1] _           ] (conj out [op1 [:retain (count p1)]])
-         [_            [:insert p2]] (conj out [[:retain (count p2)] op2])
-         [[:retain _ ] [:retain _ ]] (conj out [op1 op2])
-         [[:retain p1] [:delete p2]] (conj out [:nop op2])
-         [[:delete p1] [:retain p2]] (conj out [op1 :nop])
-         :else (conj out [:nop :nop])))]
-    (->> (align-transform edit1 edit2)
-         (reduce compare-ops [])
-         pack-pairs)))

 (defn ^:private align-compose
   [edit1 edit2]
   (loop [edit1 edit1 edit2 edit2 out []]
     (let [op1 (first edit1) op2 (first edit2)]
       (cond
-        (nil? op1) (concat out (map #(vector :nop %) edit2))
-        (nil? op2) (concat out (map #(vector % :nop) edit1))
-        (= :delete (first op1)) (recur (rest edit1) edit2 (conj out [op1 :nop]))
-        (= :insert (first op2)) (recur edit1 (rest edit2) (conj out [:nop op2]))
+        (nil? op1) (into out (map #(vector nil %) edit2))
+        (nil? op2) (into out (map #(vector % nil) edit1))
+        (= :delete (first op1)) (recur (rest edit1) edit2 (conj out [op1 nil]))
+        (= :insert (first op2)) (recur edit1 (rest edit2) (conj out [nil op2]))

         :else
         (let [[o1 p1] op1
-              p1' (if (sequential? p1) (count p1) p1)
+              p1' (if (vector? p1) (count p1) p1)
               [o2 p2] op2]
           (case (compare p1' p2)
             -1
-            (recur (rest edit1)
-                   (cons [o2 (- p2 p1')] (rest edit2))
+            (recur (rest edit1) (cons [o2 (- p2 p1')] (rest edit2))
                    (conj out [op1 [o2 p1']]))
             0
-            (recur (rest edit1)
-                   (rest edit2)
+            (recur (rest edit1) (rest edit2)
                    (conj out [op1 op2]))
             1
-            (let [[left taken] (if (sequential? p1)
-                                 [(drop p2 p1) (take p2 p1)]
-                                 [(- p1 p2) p2])]
-              (recur (cons [o1 left] (rest edit1))
-                     (rest edit2)
+            (let [left (if (vector? p1) (vec (drop p2 p1)) (- p1 p2))
+                  taken (if (vector? p1) (vec (take p2 p1)) p2)]
+              (recur (cons [o1 left] (rest edit1)) (rest edit2)
                      (conj out [[o1 taken] op2])))))))))

 (defn compose
@@ -169,13 +154,55 @@
            [[:retain _] [:delete _]] (conj out op2)
            ;; We need these cases for weird edge cases
            ;; e.g. (compose [[:delete 0]] [[:retain 0]])
-           [:nop        _          ] out
-           [_           :nop       ] out))]
+           [nil _  ] out
+           [_   nil] out))]
       (->> (align-compose edit1 edit2)
            (reduce compare-ops [])
            pack)))
   ([edit1 edit2 & more]
     (reduce compose (compose edit1 edit2) more)))
+
+(defn ^:private align-transform
+  [edit1 edit2]
+  (loop [edit1 edit1, edit2 edit2, out [[] []]]
+    (let [op1 (first edit1) op2 (first edit2)]
+      (cond
+        (nil? op1) (into out (map #(vector nil %) edit2))
+        (nil? op2) (into out (map #(vector % nil) edit1))
+        (= :insert (first op1)) (recur (rest edit1) edit2 (conj out [op1 nil]))
+        (= :insert (first op2)) (recur edit1 (rest edit2) (conj out [nil op2]))
+        :else
+        (let [[o1 p1] op1
+              [o2 p2] op2]
+          (case (compare p1 p2)
+            -1 (recur (rest edit1)
+                      (cons [o2 (- p2 p1)] (rest edit2))
+                      (conj out [op1 [o2 p1]]))
+            0  (recur (rest edit1) (rest edit2)
+                      (conj out [op1 op2]))
+            1  (recur (cons [o1 (- p1 p2)] (rest edit1))
+                      (rest edit2)
+                      (conj out [[o1 p2] op2]))))))))
+
+(defn transform
+  [edit1 edit2]
+  (assert (= (count-before edit1) (count-before edit2))
+          (str "transom/transform: length mismatch" \newline
+               "Edit 1: " edit1 \newline
+               "Edit 2: " edit2))
+  (letfn
+    [(compare-ops
+       [out [op1 op2]]
+       (match [op1 op2]
+         [[:insert p1] _           ] (conj out [op1 [:retain (count p1)]])
+         [_            [:insert p2]] (conj out [[:retain (count p2)] op2])
+         [[:retain _ ] [:retain _ ]] (conj out [op1 op2])
+         [[:retain p1] [:delete p2]] (conj out [nil op2])
+         [[:delete p1] [:retain p2]] (conj out [op1 nil])
+         :else (conj out [nil nil])))]
+    (->> (align-transform edit1 edit2)
+         (reduce compare-ops [])
+         pack-pairs)))

 (defn transform-key
   [key edit destructive?]
@@ -198,47 +225,3 @@
             (recur (+ key p) (+ index p) (rest edit))
             (recur key (+ index p) (rest edit)))))
       key)))
-
-(defn ^:private common-prefix
-  [a b]
-  (let [a-count (count a)
-        b-count (count b)]
-    (loop [i 0]
-      (if (and (< i a-count) (< i b-count) (= (nth a i) (nth b i)))
-        (recur (inc i))
-        i))))
-
-(defn ^:private common-suffix
-  [a b]
-  (let [a-count (count a)
-        b-count (count b)]
-    (loop [i 0]
-      (if (and (< i a-count) (< i b-count)
-               (= (nth a (- a-count i 1)) (nth b (- b-count i 1))))
-        (recur (inc i))
-        i))))
-
-(defn ^:private create-edit
-  [a b pre suf]
-  (pack [[:retain pre]
-         [:delete (- (count a) pre suf)]
-         [:insert (subvec b pre (- (count b) suf))]
-         [:retain suf]]))
-
-(defn diff
-  [a b]
-  (if (= a b)
-    [[:retain (count a)]]
-    (let [a (vec a)
-          b (vec b)
-          pre (common-prefix a b)
-          suf (common-suffix a b)]
-      (if (< pre suf)
-        (let [a' (subvec a 0 (- (count a) suf))
-              b' (subvec b 0 (- (count b) suf))
-              pre (common-prefix a' b')]
-          (create-edit a b pre suf))
-        (let [a' (subvec a pre)
-              b' (subvec b pre)
-              suf (common-suffix a' b')]
-          (create-edit a b pre suf))))))