Bump kabel version.

Bump kabel version.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject io.replikativ/replikativ "0.2.0-SNAPSHOT"
+(defproject io.replikativ/replikativ "0.2.0-beta2"
   :description "A scalable distributive p2p system for confluent replicated data types."
   :url "http://github.com/replikativ/replikativ"
   :license {:name "Eclipse Public License"
@@ -6,7 +6,6 @@
   :source-paths ["src"]
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.8.34"]
-                 [org.clojure/core.async "0.2.374"]

                  [io.replikativ/full.async "0.9.1.3"]
                  [io.replikativ/hasch "0.3.1"]


dep version

dep version

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

                  ;; command line
-                 [com.zensols.tools/actioncli "0.0.11"]
+                 [com.zensols.tools/actioncli "0.0.12"]

                  ;; write dataset report
                  [com.zensols.tools/misc "0.0.4"]


lein-release plugin: bumped version from 0.3.8 to 0.3.9-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject prismatic/om-tools "0.3.8"
+(defproject prismatic/om-tools "0.3.9-SNAPSHOT"
   :description "Tools for building Om applications"
   :url "http://github.com/prismatic/om-tools"
   :license {:name "Eclipse Public License - v 1.0"


Tagging carried over from ous code split; removed now.

--- project.clj
+++ project.clj
@@ -38,7 +38,6 @@
     [org.clojure/clojure "1.9.0"]
     [org.clojure/core.async "0.4.474"]
     [org.clojure/core.cache "0.7.1"]]
-  :manifest {"CMR-Plugin" "service-bridge-app"}
   :jvm-opts ["-XX:-OmitStackTraceInFastThrow"
              "-Xms2g"
              "-Xmx2g"]


remove clojure version profiles

remove clojure version profiles

--- project.clj
+++ project.clj
@@ -29,11 +29,7 @@
               [[org.apache.spark/spark-core_2.10 "1.0.0"]
                [org.apache.spark/spark-streaming_2.10 "1.0.0"]
                [org.apache.spark/spark-streaming-kafka_2.10 "1.0.0"]
-               [org.apache.spark/spark-sql_2.10 "1.0.0"]]}
-             :1.5.1
-             {:dependencies [[org.clojure/clojure "1.5.1"]]}
-             :1.4.0
-             {:dependencies [[org.clojure/clojure "1.4.0"]]}}
+               [org.apache.spark/spark-sql_2.10 "1.0.0"]]}}
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
   :jvm-opts ^:replace []


bump version

bump version

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


lein-release plugin: preparing 0.2.0 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject de.otto/tesla-jetty "0.2.0-SNAPSHOT"
+(defproject de.otto/tesla-jetty "0.2.0"
   :description "basic microservice."
   :url "https://github.com/otto-de/tesla-jetty"
   :license {:name "Apache License 2.0"


Bump cljsbuild to a stable version

Bump cljsbuild to a stable version

--- project.clj
+++ project.clj
@@ -16,7 +16,7 @@
                                    :output-to "deploy/core/node_modules/lighttable/bootstrap.js"
                                    :output-dir "cljs/"
                                    :pretty-print true}}]}
-  :plugins [[lein-cljsbuild "1.0.0-alpha2"]]
+  :plugins [[lein-cljsbuild "1.0.1"]]
   :source-paths ["src/"
                  "/Users/chris/repos/clojurescript/src/clj"
                  "/Users/chris/repos/clojurescript/src/cljs"


Bump 2.2.20 snapshot

Bump 2.2.20 snapshot

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


serializable.fn 0.0.5

serializable.fn 0.0.5

--- project.clj
+++ project.clj
@@ -9,7 +9,7 @@
                               :username :env :passphrase :env}}
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.logging "0.2.6"]
-                 [yieldbot/serializable-fn "0.0.5-SNAPSHOT"]
+                 [yieldbot/serializable-fn "0.0.5"]
                  [com.twitter/carbonite "1.3.3"]
                  [com.twitter/chill_2.10 "0.3.5"]
                  [prismatic/schema "0.2.1"]]
@@ -27,4 +27,3 @@
   :source-paths ["src/clj"]
   :java-source-paths ["src/jvm"]
   :global-vars {*warn-on-reflection* true})
-


Update dependencies

Update dependencies

--- project.clj
+++ project.clj
@@ -17,9 +17,9 @@
                  [org.clojure/tools.logging "1.1.0"]
                  [org.slf4j/slf4j-log4j12 "1.7.30"]
                  [com.yubico/yubico-validation-client2 "3.1.0"]
-                 [buddy/buddy-hashers "1.6.0"]
+                 [buddy/buddy-hashers "1.7.0"]
                  [buddy/buddy-auth "2.2.0"]
-                 [org.clojars.pntblnk/clj-ldap "0.0.16"]]
+                 [org.clojars.pntblnk/clj-ldap "0.0.17"]]
   :main ^:skip-aot env-logger.handler
   :aot [env-logger.handler
         clojure.tools.logging.impl]


Bump deps

Bump deps

--- project.clj
+++ project.clj
@@ -12,11 +12,11 @@

   :dependencies
   [[org.clojure/clojure              "1.5.1"]
-   [com.taoensso/encore              "2.90.1"]
-   [com.taoensso/timbre              "4.8.0"]
+   [com.taoensso/encore              "2.93.0"]
+   [com.taoensso/timbre              "4.10.0"]
    [com.taoensso/nippy               "2.13.0"]
-   [org.apache.commons/commons-pool2 "2.4.2"]
-   [commons-codec/commons-codec      "1.10"]]
+   [org.apache.commons/commons-pool2 "2.4.3"]
+   [commons-codec/commons-codec      "1.11"]]

   :profiles
   {;; :default [:base :system :user :provided :dev]
@@ -25,17 +25,17 @@
    :1.6  {:dependencies [[org.clojure/clojure "1.6.0"]]}
    :1.7  {:dependencies [[org.clojure/clojure "1.7.0"]]}
    :1.8  {:dependencies [[org.clojure/clojure "1.8.0"]]}
-   :1.9  {:dependencies [[org.clojure/clojure "1.9.0-alpha10"]]}
+   :1.9  {:dependencies [[org.clojure/clojure "1.9.0"]]}
    :test {:dependencies [;; 2.1.4 has breaking changes
                          [org.clojure/test.check  "0.9.0"]
                          [com.taoensso/faraday    "1.9.0"]
                          [clj-aws-s3              "0.3.10"]
-                         [ring/ring-core          "1.5.1"]]}
+                         [ring/ring-core          "1.6.3"]]}
    :dev
    [:1.9 :test :server-jvm
     {:dependencies [[org.clojure/data.json "0.2.6"]]
      :plugins
-     [[lein-ancient "0.6.10"]
+     [[lein-ancient "0.6.15"]
       [lein-codox   "0.10.3"]]}]}

   :test-paths ["test" "src"]


bump to latest 1.9 release (#73)

bump to latest 1.9 release (#73)

* bump to latest 1.9 release

* disable warning started with alpha-13

--- project.clj
+++ project.clj
@@ -34,7 +34,15 @@
                   ["vcs" "push"]]
   :target-path "target/%s"
   :main crucible.encoding.main
+  :eastwood {:include-linters [:keyword-typos
+                               :non-clojure-file
+                               :unused-fn-args
+                               :unused-locals
+                               :unused-namespaces
+                               :unused-private-vars
+                               :unused-private-vars]
+             :exclude-linters [:suspicious-expression]}
   :profiles {:uberjar {:aot :all}
-             :provided {:dependencies [[org.clojure/clojure "1.9.0-alpha11"]]}
+             :provided {:dependencies [[org.clojure/clojure "1.9.0-alpha13"]]}
              :dev {:resource-paths ["test-resources"]
                    :dependencies [[org.clojure/test.check "0.9.0"]]}})


Auto-release learn-onyx.

Auto-release learn-onyx.

--- project.clj
+++ project.clj
@@ -108,5 +108,10 @@
      :branch "compatibility"
      :release-branch "master"
      :release-script "script/release.sh"
+     :merge "master"}
+    {:git "git@learn-onyx:onyx-platform/learn-onyx.git"
+     :branch "compatibility"
+     :release-branch "master"
+     :release-script "scripts/release.sh"
      :merge "master"}]}
   :codox {:output-dir "doc/api"})


lein-release plugin: preparing 0.1.7 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject re-view-hiccup "0.1.7-SNAPSHOT"
+(defproject re-view-hiccup "0.1.7"
   :description "Hiccup parser for re-view"

   :url "https://www.github.com/re-view/re-view-hiccup"


lein-release plugin: preparing 0.54 release

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


PLD: use release

PLD: use release

--- project.clj
+++ project.clj
@@ -20,7 +20,7 @@
                  [onaio/leaflet-cljs "0.7.3-SNAPSHOT"]
                  [cljsjs/oboe "2.1.2-1"]
                  [cljsjs/jquery "1.9.1-0"]
-                 [onaio/slickgrid-cljs "0.0.2-arbitrary-page-counts-SNAPSHOT"]
+                 [onaio/slickgrid-cljs "0.0.2"]
                  [prabhasp/osmtogeojson-cljs "2.2.5-1"]
                  [org.webjars/SlickGrid "2.1"]
                  ;; For client


adding mindingbender

adding mindingbender

--- project.clj
+++ project.clj
@@ -22,6 +22,7 @@
                  [clj-aws-ec2 "0.2.0" :exclusions  [org.codehaus.jackson/jackson-core-asl]]
                  [narkisr/trammel "0.8.0-freez"]
                  [mississippi "1.0.1"]
+                 [fogus/minderbinder "0.2.0"]
                  [metrics-clojure-ring "0.9.2"]
                  [ring "1.1.8"]
                  [compojure "1.1.5" :exclusions  [ring/ring-core]]


Move deps.

Move deps.

--- project.clj
+++ project.clj
@@ -6,7 +6,6 @@
   :jvm-opts ["-Xmx4g" "-Djava.net.preferIPv4Stack=true"]
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
-                 [org.clojure/data.generators "0.1.2"]
                  [org.clojure/data.fressian "0.2.0"]
                  [org.hornetq/hornetq-commons "2.4.0.Final"]
                  [org.hornetq/hornetq-core-client "2.4.0.Final"]
@@ -15,11 +14,11 @@
                  [com.stuartsierra/dependency "0.1.1"]
                  [com.stuartsierra/component "0.2.1"]
                  [com.taoensso/timbre "3.0.1"]
-                 [javax.servlet/servlet-api "2.5"]
                  [zookeeper-clj "0.9.1" :exclusions [commons-codec]]
                  [prismatic/schema "0.3.1"]
                  [dire "0.5.1"]]
   :profiles {:dev {:dependencies [[midje "1.6.3"]
+                                  [org.clojure/data.generators "0.1.2"]
                                   [com.datomic/datomic-free "0.9.4755"
                                    :exclusions [com.fasterxml.jackson.core/jackson-core]
                                    :exclusions [org.fressian/fressian]]


Upgraded transit-clj.

Upgraded transit-clj.

--- project.clj
+++ project.clj
@@ -3,7 +3,7 @@
   :url "https://github.com/muhuk/ring-transit-middleware"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
-  :dependencies [[com.cognitect/transit-clj "0.8.281" :exclusions [commons-codec]]
+  :dependencies [[com.cognitect/transit-clj "0.8.285" :exclusions [commons-codec]]
                  [org.clojure/clojure "1.7.0"]
                  [ring/ring-core "1.4.0"]]
   :plugins [[codox "0.8.15"]


Increment version number

Increment version number

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


include log4j->slf4j and logback as dependencies of storm

--- project.clj
+++ project.clj
@@ -23,19 +23,20 @@
                  [storm/tools.cli "0.2.2"]
                  [com.googlecode.disruptor/disruptor "2.10.1"]
                  [storm/jgrapht "0.8.3"]
-                 [com.google.guava/guava "13.0"]]
+                 [com.google.guava/guava "13.0"]
+                 [ch.qos.logback/logback-classic "1.0.6"]
+                 [org.slf4j/log4j-over-slf4j "1.6.6"]
+                 ]

   :source-paths ["src/clj"]
   :java-source-paths ["src/jvm"]
   :test-paths ["test/clj"]
   :resource-paths ["conf"]

-  :profiles {:dev {:resource-paths ["src/dev"]
-                   :dependencies [[ch.qos.logback/logback-classic "1.0.6"]
-                                  [org.slf4j/log4j-over-slf4j "1.6.6"]]}
-             :release {:dependencies [[ch.qos.logback/logback-classic "1.0.6"]
-                                      [org.slf4j/log4j-over-slf4j "1.6.6"]]}
-             :lib {:dependencies [[log4j/log4j "1.2.16"]]}}
+  :profiles {:dev {:resource-paths ["src/dev"]}
+             :release {}
+             :lib {}
+             }

   :plugins [[lein-swank "1.4.4"]]


making build-fetch conditional

making build-fetch conditional

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -196,9 +196,10 @@
     (when (and (not projects-loaded?)
                (not (empty? current-user)))
       (api/get-projects api-ch))
-    (ajax/ajax :get build-url :build-fetch
-               api-ch
-               :context {:project-name project-name :build-num build-num})
+    (when-not (get-in current-state state/build-path)
+      (ajax/ajax :get build-url :build-fetch
+                 api-ch
+                 :context {:project-name project-name :build-num build-num}))
     (let [[username project] (str/split project-name #"/")]
       (initialize-pusher-subscriptions current-state comms
                                        {:username username


Got add-1 and add-2 working

Got add-1 and add-2 working

--- test/tst/parse/demo.clj
+++ test/tst/parse/demo.clj
@@ -996,22 +996,24 @@
    ;(spyx-pretty schema)
    ;(spyx-pretty value)
     (assert (= :rpc (grab :tag schema) (grab :tag value)))
-    (let [rpc-tag-schema  (keyword (get-leaf schema [:rpc :identifier]))
-          rpc-tag-value   (grab :tag (get-leaf value [:rpc]))
-          xx              (assert (= rpc-tag-schema rpc-tag-value))
+    (let [rpc-attrs       (grab :attrs value)
+          rpc-tag-schema  (keyword (get-leaf schema [:rpc :identifier]))
+          rpc-value       (get-leaf value [:rpc])
+          rpc-value-tag   (grab :tag rpc-value)
+          rpc-value-attrs (grab :attrs rpc-value)
+          xx              (assert (= rpc-tag-schema rpc-value-tag))
           ; #todo does not yet verify any attrs ;  what rules?
           fn-args-schema  (grab :content (get-tree schema [:rpc :input]))
-          fn-args-value   (grab :content (get-tree value [:rpc rpc-tag-value]))
+          fn-args-value   (grab :content (get-tree value [:rpc rpc-value-tag]))
           parsed-args     (mapv validate-parse-leaf fn-args-schema fn-args-value)
-          rpc-fn          (grab rpc-tag-value rpc-fn-map)
+          rpc-fn          (grab rpc-value-tag rpc-fn-map)
           rpc-fn-result   (apply rpc-fn parsed-args)
-          rpc-value-attrs (grab :attrs value)
           rpc-result      {:tag     :rpc-reply
-                           :attrs   rpc-value-attrs
+                           :attrs   rpc-attrs
                            :content [{:tag     :data
                                       :attrs   {}
                                       :content [rpc-fn-result]}]} ]
-      rpc-result)
+       rpc-result)
     (catch Exception e
       (throw (RuntimeException. (str "validate-parse-leaf: failed for schema=" schema \newline
                                   "  value=" value \newline
@@ -1044,21 +1046,77 @@
      [:data 5.0]])
 )

-(defn rpc-call
+(def ^:dynamic *rpc-timeout-ms* 200)
+(def ^:dynamic *rpc-delay-simulated-ms* 30)
+
+;-----------------------------------------------------------------------------
+(defn rpc-call-1
   [msg]
   (let [result-promise (promise)]
     (future
       (let [rpc-fn-tag (grab :tag msg)
             rpc-fn     (grab rpc-fn-tag rpc-fn-map)
             args       (grab :content msg)]
-        (Thread/sleep 30)
+        (Thread/sleep *rpc-delay-simulated-ms*)
         (deliver result-promise (apply rpc-fn args))))
     result-promise))
-(def ^:dynamic *rpc-timeout-ms* 200)
-(defn add [x y]
-  (let [result-promise (rpc-call (hiccup->enlive [:add x y]))
+
+(defn add-1 [x y]
+  (let [result-promise (rpc-call-1 (hiccup->enlive [:add x y]))
         rpc-result     (deref result-promise *rpc-timeout-ms* :timeout-failure)]
     (when (= :timeout-failure rpc-result)
       (throw (TimeoutException. (format "Timeout Exceed=%s  add: %s %s; " *rpc-timeout-ms* x y))))
     rpc-result))
-(dotest (is= 5 (spyx (add 2 3))))
+
+(dotest
+  (binding [*rpc-timeout-ms*         200
+            *rpc-delay-simulated-ms* 30]
+    (is= 5 (spyx (add-1 2 3))))
+  (binding [*rpc-timeout-ms*         20
+            *rpc-delay-simulated-ms* 30]
+    (throws? (add-1 2 3))))
+
+;-----------------------------------------------------------------------------
+
+(def rpc-msg-id (atom 100))
+(def rpc-deliver-map (atom {}))
+
+(defn rpc-call-2
+  [rpc-msg-id msg]
+  (let [result-promise (promise)
+        ; msg (update-in msg : )
+        ]
+    (swap! rpc-deliver-map glue {rpc-msg-id result-promise}) ;  #todo temp!
+    ; (spyx @rpc-deliver-map)
+    (future
+      (Thread/sleep *rpc-delay-simulated-ms*)
+      (let [rpc-result (validate-parse-rpc rpc-schema msg)
+                ; msg-id
+                ]
+        (deliver result-promise rpc-result)))
+    result-promise))
+
+(defn add-2 [x y]
+  ; #todo temp!
+  (reset! rpc-msg-id 100)
+  (let [rpc-msg-id     (swap! rpc-msg-id inc) ;  #todo temp!
+        result-promise (rpc-call-2
+                         rpc-msg-id
+                         (hiccup->enlive
+                           [:rpc {:message-id rpc-msg-id ;  #todo temp!
+                                  :xmlns      "urn:ietf:params:xml:ns:netconf:base:1.0"}
+                            [:add {:xmlns "my-own-ns/v1"}
+                             [:x (str x)]
+                             [:y (str y)]]]))
+        rpc-result     (deref result-promise *rpc-timeout-ms* :timeout-failure)]
+    (when (= :timeout-failure rpc-result)
+      (throw (TimeoutException. (format "Timeout Exceed=%s  add: %s %s; " *rpc-timeout-ms* x y))))
+    rpc-result))
+
+(dotest
+  (nl)
+  (is= (spyx-pretty (enlive->hiccup (add-2 2 3)))
+    [:rpc-reply {:message-id 101  :xmlns "urn:ietf:params:xml:ns:netconf:base:1.0" }
+     [:data 5.0]] )
+)
+


strict checker

strict checker

--- test/neb/test/server.clj
+++ test/neb/test/server.clj
@@ -71,7 +71,7 @@
                (batch-read-cell-by-key
                  (map
                    #(str "test-2-" %)
-                   (range 1000))) => (contains (into {} (map (fn [id] [(str "test-2-" id) (contains {:data id})]) (range 1000)))))
+                   (range 1000))) => (just (into {} (map (fn [id] [(str "test-2-" id) (contains {:data id})]) (range 1000)))))
          (fact "Batch Delete"
                (batch-delete-cell-noreply
                  (map #(str "test-2-" %) (range 1000))) => anything)


strip div.article-meta and div.push tags from boby.

--- src/clj_ptt_crawler/convert_articles_html.clj
+++ src/clj_ptt_crawler/convert_articles_html.clj
@@ -1,5 +1,6 @@
 (ns clj-ptt-crawler.convert-articles-html
-  (:require [clojure.data.json :as json]
+  (:require [clojure.string :as string]
+            [clojure.data.json :as json]
             [net.cgrand.enlive-html :as enlive])
   (:gen-class))

@@ -25,18 +26,22 @@
                   :ipdatetime (extract-text-content pt :span.push-ipdatetime),
                   }))))

+(defn extract-article-body [dom]
+  (string/join "" (enlive/select (enlive/at dom [:div.article-metaline-right] nil [:div.article-metaline] nil [:div.push] nil)
+                                 [:* :> enlive/text-node])))
+
 (defn extract-article [dom]
   {:meta (extract-meta-tag-value dom),
    :push (extract-push dom),
-   :body ""})
+   :body (extract-article-body dom)})

 (defn convert-this [f]
   (let [output-file-name (.replace (.getPath f) ".html" ".json")
-        article-dom (enlive/select (enlive/html-snippet (slurp f)) [:div#main-content])]
-    (prn "==> " output-file-name (extract-article article-dom))))
+        article-dom (enlive/select (enlive/html-snippet (slurp f)) [:div#main-content])
+        article-json (json/write-str (extract-article article-dom) :escape-unicode nil)]
+    (println "==> " output-file-name article-json )))

 (defn -main [ptt_dir]
   (let [files (filter html-only (file-seq (clojure.java.io/file ptt_dir)))]
     (doseq [f files]
       (convert-this f))))
-


func write features ss

func write features ss

--- src/clojure/zensols/model/eval_classifier.clj
+++ src/clojure/zensols/model/eval_classifier.clj
@@ -42,34 +42,36 @@
   []
   (pprint (model-config)))

+(defn- analysis-file [file-format]
+  (let [model-conf (model-config)
+        file-name (format file-format (:name model-conf))]
+    (io/file (cl/analysis-report-resource) file-name)))
+
 (defn read-arff
   "Read the ARFF file configured with [[with-model-conf]]."
   []
-  (let [model-conf (model-config)
-        file-name (format "%s-data.arff" (:name model-conf))]
-    (cl/read-arff (io/file (cl/analysis-report-resource) file-name))))
+  (cl/read-arff (analysis-file "%s-data.arff")))

 (defn write-arff
   "Write the ARFF file configured with [[with-model-conf]]."
   []
-  (let [model-conf (model-config)
-        file-name (format "%s-data.arff" (:name model-conf))
-        file (io/file (cl/analysis-report-resource) file-name)]
+  (let [file (analysis-file "%s-data.arff")]
     (binding [cl/*arff-file* file]
       (cl/write-arff (by-set-type-instances :train-test)))
     file))

-(defn display-features
-  "Display features as configured in a model with [[with-model-conf]].
+(defn- result-matrix
+  "Helper function to generate a matrix of features as configured in a model
+  with [[with-model-conf]].

   For the non-zero-arg form, see [[with-model-conf]]."
   ([]
    (let [{:keys [feature-metas-fn display-feature-metas-fn
                  class-feature-meta-fn create-feature-sets-fn]} (model-config)
          display-feature-metas-fn (or display-feature-metas-fn feature-metas-fn)]
-     (display-features (display-feature-metas-fn)
-                       (class-feature-meta-fn)
-                       (create-feature-sets-fn))))
+     (result-matrix (display-feature-metas-fn)
+                    (class-feature-meta-fn)
+                    (create-feature-sets-fn))))
   ([feature-metas class-feature-meta feature-sets]
    (let [keys (map first (concat (list class-feature-meta) feature-metas))]
      (->> feature-sets
@@ -77,9 +79,30 @@
                  (map (fn [tkey]
                         (get tok tkey))
                       keys)))
-          ((fn [data]
-             (dr/display-results data
-                                 :column-names (map name keys))))))))
+          (hash-map :column-names (map name keys) :data)))))
+
+(defn display-features
+  "Display features as configured in a model with [[with-model-conf]].
+
+  For the non-zero-arg form, see [[with-model-conf]]."
+  []
+  (let [{:keys [column-names data]} (result-matrix)]
+    (dr/display-results data :column-names column-names)))
+
+(defn write-features
+  "Write features as configured in a model with [[with-model-conf]] to a CSV
+  spreadsheet file.
+
+  For the non-zero-arg form, see [[with-model-conf]]."
+  []
+  (let [file (analysis-file "%s-features.csv")
+        {:keys [column-names data]} (result-matrix)]
+    (with-open [writer (io/writer file)]
+      (->> data
+           (cons column-names)
+           (csv/write-csv writer)))
+    (log/infof "wrote features file: %s" file)
+    file))

 (defn- cross-validate-results-struct
   "Create a data structure with cross validation results."


expanding quick sort

expanding quick sort

--- src/clojure_learning/with-clojure-playing.clj
+++ src/clojure_learning/with-clojure-playing.clj
@@ -741,12 +741,118 @@
   (last r))

 #_(let [r (range 1e9)]
-  (first r)
-  (last r))
+  (last r)
+  (first r))

 ;; if those sequences are executed one after the other -> then OutOfMemoryError is triggered, since the compiler
 ;; do NOT rearrange the code in Clojure, because the ORDER MIGHT MATTER!
-;; we can keep a sequence in memory if we bind the head of that sequence to a local variable. In this case
-;; the reference to the sequence is lost right after the [last] invocation completes -> the in-memory obejcts are cleared
-;; by the compiler with force brute. The second binding, again creates that in memory ds, but when the [last] func returns
-;; the compiler is overflooded. and crashes, because it will NOT perform any rearranging on the code.
+;; we can keep a sequence in memory if we BIND THE HEAD OF THAT SEQUENCE TO A LOCAL VARIABLE.
+;; The current example shows that the reference to the sequence is lost right after the [last] invocation completes
+;; the compiler is smart enough to notice that [last] was invoked -> the in-memory obejcts are cleared aggresively
+;; by the compiler. While the second binding, again creates that in memory ds, but when the [first] func returns
+;; the compiler thinks the sequence is still needed, and hence DO NOT CLEARS it, since the head of the sequence is kept.
+
+(doc delay)
+(doc force)
+(defn defer-expensive
+  [cheap expensive]
+  (if-let [result (force cheap)]; if cheap is a Delay -> returns cached value, else returns cheap-value
+    result
+    (force expensive)))
+
+;; demo:
+(def exp (defer-expensive
+  (delay "some delayed object")
+  (delay
+     (do
+       (Thread/sleep 3000)
+       "an expensive lazy object NOT returned because first-arg yields in a truthy!")))); "some delayed object"
+
+(delay false); Delay Object returned
+(force (delay false)); false
+(defer-expensive
+  (delay false)
+  (delay
+     (do
+       (Thread/sleep 3000)
+       "this is executed eagerly")));
+
+;; or another example might be:
+(defn build-container-w-range
+  [upper-bound]
+  (delay
+     (list (range 1 upper-bound))))
+(def not-container-yet (build-container-w-range 10))
+(def now-a-container (force not-container-yet))
+
+;; setup for the quick-sort in clojure :) ;;
+(doc partition)
+(def a-vec [4 3 1 5 6 2 8])
+(ratio? (/ (count a-vec) 2)); true
+(int (/ (count a-vec) 2)); (/ 7 2) -> 3
+(partition (int (/ (count a-vec) 2)) a-vec)
+
+(doc if-let)
+
+(defn quick-sort
+  [container]
+  (let [total (count container)]
+    (if (even? total)
+        (let [partitioned-colls (partition (/ total 2) container)
+              pivot ((comp first flatten rest) partitioned-colls)
+              first-from-1 ((comp first first) partitioned-colls) ]
+
+              (loop [part-1   (first partitioned-colls)
+                     part-2   (-> partitioned-colls
+                                 rest
+                                 flatten)
+                     each-from-first   first-from-1
+                     each-from-sec     (first (rest part-2))]
+                  (cond
+                     (> each-from-first pivot)
+                       (do
+                          (println (str "higher: " each-from-first))
+                          (recur
+                            (rest part-1)
+                            (conj (vec part-2) each-from-first)
+                            (first (rest part-1))
+                            (first part-2))
+                         )
+
+                     (< each-from-sec pivot)
+                       (do
+                         (println (str "smaller: " each-from-sec))
+                         (recur
+                            (cons (vec part-1) (first part-2))
+                            (rest part-2)
+                            (first part-1)
+                            (first (rest part-2)); dont take it twice -> set to the next of part-2
+                          )
+                         )
+                      (nil? each-from-first)
+                       part-2
+                      (nil? each-from-sec)
+                       part-1
+                   :else
+                     [part-1 part-2]
+                    )
+                )
+          )
+    )))
+
+(def a-vec [4 3 1 5 6 2 8])
+(quick-sort (pop a-vec))
+(conj (vec (list 3 4 5)) 1)
+(conj (list 1 2 3) 4)
+(doc list*)
+
+(defn qsort
+  [container]
+  (lazy-seq
+     (let [ [x & [partitioned]] container
+            pivot (first partitioned)
+            smaller? #(< % pivot)]
+       )
+   ))
+(doc remove)
+(doc list*)


Remove unnecessary comp in test tasks

Remove unnecessary comp in test tasks

--- resources/leiningen/new/lambone/common/dev/boot.clj
+++ resources/leiningen/new/lambone/common/dev/boot.clj
@@ -184,7 +184,7 @@
   (apply-options! options)
   (require 'adzerk.boot-test)
   (let [test (resolve 'adzerk.boot-test/test)]
-    (comp (apply test (mapcat identity (:test options))))))<% endif %>
+    (apply test (mapcat identity (:test options)))))<% endif %>
 <% if any frontend %>
 (defn build-frontend
   "Return a boot task for building the frontend.
@@ -253,4 +253,4 @@
   (apply-options! options)
   (require 'crisptrutski.boot-cljs-test)
   (let [test-cljs (resolve 'crisptrutski.boot-cljs-test/test-cljs)]
-    (comp (apply test-cljs (mapcat identity (:test-cljs options))))))<% endif %>+    (apply test-cljs (mapcat identity (:test-cljs options)))))<% endif %>


CMR-1354 combine specified and sort score fix

--- search-app/src/cmr/search/data/query_to_elastic.clj
+++ search-app/src/cmr/search/data/query_to_elastic.clj
@@ -277,15 +277,16 @@
   (let [use-keyword-sort? (keywords-extractor/contains-keyword-condition? query)
         use-temporal-sort? (and (temporal-range-extractor/contains-temporal-ranges? query)
                                 (sort-use-temporal-relevancy))]
-    (concat
-     (when use-keyword-sort?
-       [{:_score {:order :desc}}])
-     (when use-temporal-sort?
-       [{:_script (temporal-to-elastic/temporal-overlap-sort-script query)}])
-     ;; We only include this if one of the others is present
-     (when (and (or use-temporal-sort? use-keyword-sort?)
-                (sort-use-relevancy-score))
-       [{:usage-relevancy-score {:order :desc :missing 0}}]))))
+    (seq
+     (concat
+       (when use-keyword-sort?
+         [{:_score {:order :desc}}])
+       (when use-temporal-sort?
+         [{:_script (temporal-to-elastic/temporal-overlap-sort-script query)}])
+       ;; We only include this if one of the others is present
+       (when (and (or use-temporal-sort? use-keyword-sort?)
+                  (sort-use-relevancy-score))
+         [{:usage-relevancy-score {:order :desc :missing 0}}])))))

 (defn- temporal-sort-order
   "If there are temporal ranges in the query and temporal relevancy sorting is turned on,
@@ -313,13 +314,12 @@
         default-sort (q2e/sort-keys->elastic-sort concept-type (q/default-sort-keys concept-type))
         sub-sort-fields (if (:all-revisions? query)
                           collection-all-revision-sub-sort-fields
-                          collection-latest-sub-sort-fields)]
-    (concat specified-sort
-            (or score-sort-order default-sort)
-            sub-sort-fields)))
+                          collection-latest-sub-sort-fields)
+        specified-score-combined (seq (concat specified-sort score-sort-order))]
+    (concat (or specified-score-combined default-sort) sub-sort-fields)))

 (extend-protocol c2s/ComplexQueryToSimple
   cmr.search.models.query.CollectionQueryCondition
   (reduce-query-condition
     [condition context]
-    (update-in condition [:condition] c2s/reduce-query-condition context)))+    (update-in condition [:condition] c2s/reduce-query-condition context)))


Formatting consistency

Formatting consistency

--- src/desdemona/launcher/aeron_media_driver.clj
+++ src/desdemona/launcher/aeron_media_driver.clj
@@ -6,8 +6,10 @@
            [uk.co.real_logic.aeron.driver MediaDriver MediaDriver$Context]))

 (def cli-options
-  [["-d" "--delete-dirs" "Delete the media drivers directory on startup" :default false]
    ["-h" "--help"]])
+  [["-d" "--delete-dirs"
+    "Delete the media drivers directory on startup"
+    :default false]

 (defn -main [& args]
   (let [opts (parse-opts args cli-options)


CMR-975: Add example to documentation

CMR-975: Add example to documentation

--- umm-lib/src/cmr/umm/validation/utils.clj
+++ umm-lib/src/cmr/umm/validation/utils.clj
@@ -18,7 +18,8 @@
   field to include in the error message.  For example :short-name or :name depending on the field
   being validated.

-  Example: (has-parent-validator :short-name \"Platform short name\""
+  Example: (has-parent-validator :short-name \"Platform short name\")
+  \"The following list of Platform short names did not exist in the referenced parent collection: [foo].\""
   [parent-ref-field human-readable-field-name]
   (fn [field-path values]
     (let [missing-parent-list


cosets.clj: added a function for computing coset representatives

--- clojure/org/gavrog/clojure/cosets.clj
+++ clojure/org/gavrog/clojure/cosets.clj
@@ -105,3 +105,14 @@
                                   (scan-relations rels subgens table equiv n)
                                   1/2)]
               (recur table equiv i (inc j)))))))
+
+(defn coset-representatives [table]
+  (loop [q (conj empty-queue 0)
+         reps {0 []}]
+    (if-let [i (first q)]
+      (let [row (table i)
+            free (filter (comp nil? reps second) row)
+            reps (into reps (map (fn [[g k]] [k (-* (reps i) [g])]) free))
+            q (into (pop q) (map second free))]
+        (recur q reps))
+      reps)))


cosets.clj: work towards a coset table (i.e. subgroup) generator

--- clojure/org/gavrog/clojure/cosets.clj
+++ clojure/org/gavrog/clojure/cosets.clj
@@ -2,7 +2,8 @@
   (:use (org.gavrog.clojure
           free-word
           partition
-          util)))
+          util
+          generators)))

 (defn- merge-rows [table equiv q a b]
   (let [merge (fn [ra rb]
@@ -116,3 +117,36 @@
             q (into (pop q) (map second free))]
         (recur q reps))
       reps)))
+
+(defn tables-generator [nr-gens relators max-cosets]
+  (let [with-inverses (fn [ws] (vec (into #{} (concat ws (map inverse ws)))))
+        gens (vec (concat (range 1 (inc nr-gens))
+                          (range -1 (- (inc nr-gens)) -1)))
+        rels (with-inverses (for [w relators, i (range (count w))]
+                              (into (subvec w i) (subvec w 0 i))))
+        free (fn [table] (for [k (range (count table))
+                               :let [row (table k)]
+                               g gens :when (nil? (row g))]
+                           [k g]))]
+    (make-backtracker
+      {:root {0 {}}
+       :extract (fn [table]
+                  (println "  " table)
+                  (when (empty? (free table)) table))
+       :children (fn [table]
+                   (if-let [[k g] (first (free table))]
+                     (let [g* (- g)
+                           n (count table)
+                           matches (filter (fn [k] (nil? ((table k) g*)))
+                                           (range k n))
+                           candidates (if (< n max-cosets)
+                                        (conj matches n)
+                                        matches)]
+                       (for [k* candidates
+                             :let [t (-> table
+                                      (assoc-in [k g] k*)
+                                      (assoc-in [k* g*] k))
+                                  [t equiv]
+                                  (scan-relations rels [] table pempty k)]
+                                  :when (empty? equiv)]
+                             t))))})))


Re-updated fuild strat results

Re-updated fuild strat results

--- src/angelic/search/action_set/stratified.clj
+++ src/angelic/search/action_set/stratified.clj
@@ -38,19 +38,62 @@
             (.addAll open (av-map x))))))
     (set (seq ret))))

-;; TODO: none of these work!
 (defn dynamic-inf-stratified-applicable-actions [last-a state tsi av-map ap-map actions]
   (if last-a
     (let [a-var   (effect-var last-a)
           a-level (util/safe-get tsi a-var)
           p-set   (dynamic-var-set state av-map ap-map a-var)]
-   #_   (println last-a p-set state)
       (filter
        (fn [b]
          (let [b-var (effect-var b)
                b-level (util/safe-get tsi b-var)]
            (or (and (<= b-level a-level) (contains? p-set b-var))
-;               (contains? (util/keyset (:precond-map b)) (keys (:precond-map last-a)))
+               (contains? (:precond-map b) a-var))))
+       (actions state)))
+    (actions state)))
+
+(defn fluid-predecessors [state ap-map v]
+  (apply clojure.set/intersection
+         (for [a (util/safe-get ap-map [v (state/get-var state v)])
+               :when (contains? (:effect-map a) v)]
+           (set (for [[pvar pval] (:precond-map a)
+                      :when (and (not (= pvar v)) (not (= pval (state/get-var state pvar))))]
+                  pvar)))))
+
+
+(defn fluid-vars [state ap-map goal]
+  (let [open   (ArrayList.)
+        ret    (HashSet.)
+        closed (HashSet.)]
+    (doseq [[var val] goal]
+      (when-not (= val (state/get-var state var))
+        (.add open var)))
+    (while (not (.isEmpty open))
+      (let [v (.remove open (dec (count open)))]
+        (when-not (.contains closed v)
+          (.add closed v)
+          (.addAll open (fluid-predecessors state ap-map v)))))
+    (set (seq closed))))
+
+(defn dynamic-fluid-inf-stratified-applicable-actions [last-a state tsi av-map ap-map root-set goal cg-map actions]
+  ;; Root set ignored for now -- doing it dynamically.
+  (if last-a
+    (let [a-var   (effect-var last-a)
+          a-level (util/safe-get tsi a-var)
+          p-set   (dynamic-var-set state av-map ap-map a-var)
+          fluid-set (clojure.set/intersection p-set (fluid-vars state ap-map goal))
+          fluid-root-set (set (for [v fluid-set
+                                    :let [av (av-map v)]
+                                    :when (every? (fn [a] (every? #(or (av %) (not (p-set %))) (cg-map a))) (disj av v))]
+                                v))
+          p-set   (if (seq fluid-root-set)
+                    (av-map (apply min-key tsi fluid-root-set))
+                    p-set)]
+      (filter
+       (fn [b]
+         (let [b-var (effect-var b)
+               b-level (util/safe-get tsi b-var)]
+           (or (and (<= b-level a-level) (contains? p-set b-var))
                (contains? (:precond-map b) a-var))))
        (actions state)))
     (actions state)))
@@ -87,7 +130,7 @@
     (actions state)))

 (defn stratified-search [sas-problem type]
-  (assert (#{:simple :dynamic} type))
+  (assert (#{:simple :dynamic :fluid} type))
   (let [q       (queues/make-tree-search-pq)
         closed  (HashSet.)
         actions (env/actions-fn sas-problem)
@@ -95,17 +138,24 @@
         cg-map        (graphs/edge-list->outgoing-map causal-graph)
         av-map        (into {} (for [v (keys (:vars sas-problem))]
                                  [v (graphs/ancestor-set causal-graph [v])]))
+        root-set      (set (for [[v av] av-map
+                                 :when (every? (fn [a] (every? av (cg-map a))) (disj av v))]
+                             v))
         cav-map       (into {} (for [v (keys (:vars sas-problem))]
                                  [v (apply clojure.set/union (map av-map (cg-map v)))]))
         ap-map        (HashMap.)
 ;        pre-var-map   (util/map-vals #(set (map first %)) (group-by second causal-graph))
         tsi           (graphs/topological-sort-indices (remove #(apply = %) causal-graph))
+        goal-map (:precond-map (util/safe-singleton (filter #(= (:name %) sas/goal-action-name) (:actions sas-problem))))
         goal    (env/goal-fn sas-problem)
         init    (env/initial-state sas-problem)
         strat-actions (case type
                         :simple     (fn [last-a state] (inf-stratified-applicable-actions last-a state tsi actions))
-                        :structural (fn [last-a state] (improved-inf-stratified-applicable-actions last-a state tsi cav-map actions))                       :dynamic    (fn [last-a state] (dynamic-inf-stratified-applicable-actions last-a state tsi av-map ap-map actions)))]
-    (when (= type :dynamic) #_ (println av-map)
+                        :structural (fn [last-a state] (improved-inf-stratified-applicable-actions last-a state tsi cav-map actions))                       :dynamic    (fn [last-a state] (dynamic-inf-stratified-applicable-actions last-a state tsi av-map ap-map actions))
+                        :fluid    (fn [last-a state] (dynamic-fluid-inf-stratified-applicable-actions last-a state tsi av-map ap-map root-set goal-map cg-map actions))
+                        )]
+    (println root-set)
+    (when (#{:dynamic :fluid} type) #_ (println av-map)
       (doseq [a (:actions sas-problem), pp (:precond-map a)]
         (.put ap-map pp (cons a (.get ap-map pp)))))
     (queues/pq-add! q [nil init] 0)
@@ -154,6 +204,17 @@
 ;; 6-2: 1947242
 ;; 5-0: 2272572

+;; Logistics results (# states) to match table. -- fluid
+;; 5 5-2: 10230
+;; 7 6-1: 96430
+;; 2 4-2: 182321
+;; 4 5-1: 229929
+;; 1 4-1: 324127
+;; 0 4-0: 473231
+;; 9 6-3: 1087515
+;; 6 6-0: 899623
+;; 8 6-2: 903447
+;; 3 5-0: 1155503


makes interstitials requests hit the same router (#280)

--- waiter/integration/waiter/basic_test.clj
+++ waiter/integration/waiter/basic_test.clj
@@ -675,88 +675,104 @@
     (let [{:keys [cookies]} (make-request waiter-url "/waiter-auth")]
       (doseq [[_ router-url] (routers waiter-url)]
         (wait-for #(-> (interstitial-state router-url :cookies cookies)
-                       (get-in ["state" "interstitial" "initialized?"] false)))))
-    (let [interstitial-secs 5
-          request-headers {"accept" "text/html"}
-          token (str (rand-name) ".localtest.me")
-          _ (post-token waiter-url (-> (kitchen-params)
-                                       (assoc
-                                         :concurrency-level 20
-                                         :interstitial-secs interstitial-secs
-                                         :metric-group "waiter_kitchen"
-                                         :name token
-                                         :permitted-user (retrieve-username)
-                                         :run-as-user (retrieve-username)
-                                         :token token)
-                                       (update :cmd (fn [cmd] (str "sleep 10 && " cmd)))))
-          service-id (retrieve-service-id waiter-url {"x-waiter-token" token})]
-      (with-service-cleanup
-        service-id
-        (try
-          (->> [(async/thread ;; check interstitial rendering
-                  (let [request-headers (assoc request-headers "host" token)
-                        {:keys [body] :as response}
-                        (make-request waiter-url "/waiter-interstitial/some-endpoint" :headers request-headers :query-params {"a" "b"})]
-                    (assert-response-status response 200)
-                    (is (str/includes? body (str "<title>Waiter - Interstitial for " service-id "</title>")))
-                    (is (str/includes? body (str "/some-endpoint?a=b&x-waiter-bypass-interstitial=1")))))
-                (async/thread ;; GET request inside the interstitial period, using DNS token
-                  (let [start-time (t/now)
-                        endpoint "/hello"
-                        request-headers (assoc request-headers "host" token)
-                        {:keys [headers] :as response}
-                        (make-request waiter-url endpoint :headers request-headers :http-method-fn http/get)
-                        end-time (t/now)]
-                    (assert-response-status response 303)
-                    (is (= (str "/waiter-interstitial" endpoint) (get headers "location")))
-                    (is (= "true" (get headers "x-waiter-interstitial")))
-                    (is (< (t/in-millis (t/interval start-time end-time))
-                           (t/in-millis (t/seconds interstitial-secs))))))
-                (async/thread ;; POST request inside the interstitial period, using DNS token
-                  (let [start-time (t/now)
-                        endpoint "/hello"
-                        request-headers (assoc request-headers "host" token)
-                        {:keys [headers] :as response}
-                        (make-request waiter-url endpoint :headers request-headers :http-method-fn http/post)
-                        end-time (t/now)]
-                    (assert-response-status response 303)
-                    (is (= (str "/waiter-interstitial" endpoint) (get headers "location")))
-                    (is (= "true" (get headers "x-waiter-interstitial")))
-                    (is (< (t/in-millis (t/interval start-time end-time))
-                           (t/in-millis (t/seconds interstitial-secs))))))
-                (async/thread ;; request inside the interstitial period, but on-the-fly
-                  (let [endpoint "/hello"
-                        request-headers (assoc request-headers "x-waiter-token" token)
-                        {:keys [body headers] :as response}
-                        (make-request waiter-url endpoint :headers request-headers)]
-                    (assert-response-status response 200)
-                    (is (str/includes? (str body) "Hello World"))
-                    (is (not (contains? headers "x-waiter-interstitial")))))
-                (async/thread ;; request inside the interstitial period but with bypass query param
-                  (let [endpoint "/hello"
-                        request-headers (assoc request-headers "host" token)
-                        {:keys [body headers] :as response}
-                        (make-request waiter-url endpoint :headers request-headers :query-params {"x-waiter-bypass-interstitial" "1"})]
-                    (assert-response-status response 200)
-                    (is (str/includes? (str body) "Hello World"))
-                    (is (not (contains? headers "x-waiter-interstitial")))))
-                (async/thread ;; request outside the interstitial period
-                  (Thread/sleep (* 1000 (inc interstitial-secs)))
-                  (let [endpoint "/hello"
-                        request-headers (assoc request-headers "host" token)
-                        {:keys [body headers] :as response}
-                        (make-request waiter-url endpoint :headers request-headers)]
-                    (assert-response-status response 200)
-                    (is (str/includes? (str body) "Hello World"))
-                    (is (not (contains? headers "x-waiter-interstitial")))))]
-               (map async/<!!)
-               doall)
-          (let [{:keys [cookies]} (make-request waiter-url "/waiter-auth")]
+                       (get-in ["state" "interstitial" "initialized?"] false))))
+      (let [interstitial-secs 5
+            request-headers {"accept" "text/html"}
+            token (str (rand-name) ".localtest.me")
+            _ (post-token waiter-url (-> (kitchen-params)
+                                         (assoc
+                                           :concurrency-level 20
+                                           :interstitial-secs interstitial-secs
+                                           :metric-group "waiter_kitchen"
+                                           :name token
+                                           :permitted-user (retrieve-username)
+                                           :run-as-user (retrieve-username)
+                                           :token token)
+                                         (update :cmd (fn [cmd] (str "sleep 10 && " cmd)))))
+            service-id (retrieve-service-id waiter-url {"x-waiter-token" token})
+            router-url (-> waiter-url routers vals first)]
+        (with-service-cleanup
+          service-id
+          (try
+            (->> [(async/thread ;; check interstitial rendering
+                    (let [request-headers (assoc request-headers "host" token)
+                          {:keys [body] :as response}
+                          (make-request router-url "/waiter-interstitial/some-endpoint"
+                                        :cookies cookies
+                                        :headers request-headers
+                                        :query-params {"a" "b"})]
+                      (assert-response-status response 200)
+                      (is (str/includes? body (str "<title>Waiter - Interstitial for " service-id "</title>")))
+                      (is (str/includes? body (str "/some-endpoint?a=b&x-waiter-bypass-interstitial=1")))))
+                  (async/thread ;; GET request inside the interstitial period, using DNS token
+                    (let [start-time (t/now)
+                          endpoint "/hello"
+                          request-headers (assoc request-headers "host" token)
+                          {:keys [headers] :as response}
+                          (make-request router-url endpoint
+                                        :cookies cookies
+                                        :headers request-headers
+                                        :http-method-fn http/get)
+                          end-time (t/now)]
+                      (assert-response-status response 303)
+                      (is (= (str "/waiter-interstitial" endpoint) (get headers "location")))
+                      (is (= "true" (get headers "x-waiter-interstitial")))
+                      (is (< (t/in-millis (t/interval start-time end-time))
+                             (t/in-millis (t/seconds interstitial-secs))))))
+                  (async/thread ;; POST request inside the interstitial period, using DNS token
+                    (let [start-time (t/now)
+                          endpoint "/hello"
+                          request-headers (assoc request-headers "host" token)
+                          {:keys [headers] :as response}
+                          (make-request router-url endpoint
+                                        :cookies cookies
+                                        :headers request-headers
+                                        :http-method-fn http/post)
+                          end-time (t/now)]
+                      (assert-response-status response 303)
+                      (is (= (str "/waiter-interstitial" endpoint) (get headers "location")))
+                      (is (= "true" (get headers "x-waiter-interstitial")))
+                      (is (< (t/in-millis (t/interval start-time end-time))
+                             (t/in-millis (t/seconds interstitial-secs))))))
+                  (async/thread ;; request inside the interstitial period, but on-the-fly
+                    (let [endpoint "/hello"
+                          request-headers (assoc request-headers "x-waiter-token" token)
+                          {:keys [body headers] :as response}
+                          (make-request router-url endpoint
+                                        :cookies cookies
+                                        :headers request-headers)]
+                      (assert-response-status response 200)
+                      (is (str/includes? (str body) "Hello World"))
+                      (is (not (contains? headers "x-waiter-interstitial")))))
+                  (async/thread ;; request inside the interstitial period but with bypass query param
+                    (let [endpoint "/hello"
+                          request-headers (assoc request-headers "host" token)
+                          {:keys [body headers] :as response}
+                          (make-request router-url endpoint
+                                        :cookies cookies
+                                        :headers request-headers
+                                        :query-params {"x-waiter-bypass-interstitial" "1"})]
+                      (assert-response-status response 200)
+                      (is (str/includes? (str body) "Hello World"))
+                      (is (not (contains? headers "x-waiter-interstitial")))))
+                  (async/thread ;; request outside the interstitial period
+                    (Thread/sleep (* 1000 (inc interstitial-secs)))
+                    (let [endpoint "/hello"
+                          request-headers (assoc request-headers "host" token)
+                          {:keys [body headers] :as response}
+                          (make-request router-url endpoint
+                                        :cookies cookies
+                                        :headers request-headers)]
+                      (assert-response-status response 200)
+                      (is (str/includes? (str body) "Hello World"))
+                      (is (not (contains? headers "x-waiter-interstitial")))))]
+                 (map async/<!!)
+                 doall)
             (is (some (fn [[_ router-url]]
                         (some-> (interstitial-state router-url :cookies cookies)
                                 (get-in ["state" "interstitial" "service-id->interstitial-promise"] {})
                                 (get service-id)
                                 #{"healthy-instance-found" "interstitial-timeout"}))
-                      (routers waiter-url))))
-          (finally
-            (delete-token-and-assert waiter-url token)))))))
+                      (routers waiter-url)))
+            (finally
+              (delete-token-and-assert waiter-url token))))))))


Lets try without the `no-shrink`

Lets try without the `no-shrink`

--- src/kixi/datastore/schemastore/conformers.clj
+++ src/kixi/datastore/schemastore/conformers.clj
@@ -235,13 +235,13 @@
   (s/with-gen
     (s/conformer url? identity)
     (fn []
-      (tgen/no-shrink (gen/fmap fmt-url
-                                (gen/tuple
-                                 (gen/boolean)
-                                 (gen/vector (gen/such-that #(< 1 (count %))  (gen/string-alphanumeric)) 2 5)
-                                 (gen/vector (gen/such-that #(< 1 (count %))  (gen/string-alphanumeric)) 2 5)
-                                 (gen/one-of [(gen/such-that #(< 1 (count %)) (gen/string-alphanumeric))
-                                              (gen/return nil)])))))))
+      (gen/fmap fmt-url
+                (gen/tuple
+                 (gen/boolean)
+                 (gen/vector (gen/such-that #(< 1 (count %))  (gen/string-alphanumeric)) 2 5)
+                 (gen/vector (gen/such-that #(< 1 (count %))  (gen/string-alphanumeric)) 2 5)
+                 (gen/one-of [(gen/such-that #(< 1 (count %)) (gen/string-alphanumeric))
+                              (gen/return nil)]))))))

 (def anything
   (s/with-gen (constantly true)


Upgrade karma to 5.1.1

Upgrade karma to 5.1.1

--- src/leiningen/new/re_frame/src/cljs/deps.cljs
+++ src/leiningen/new/re_frame/src/cljs/deps.cljs
@@ -1,5 +1,5 @@
 {:npm-dev-deps {"shadow-cljs"           "2.11.0"{{#test?}}
-                "karma"                 "5.1.0"
+                "karma"                 "5.1.1"
                 "karma-chrome-launcher" "3.1.0"
                 "karma-cljs-test"       "0.1.0"
                 "karma-junit-reporter"  "2.0.1"{{/test?}}}}


Get rid of unnecessary divs

Get rid of unnecessary divs

--- src/cljs/onyx_dashboard/components/main.cljs
+++ src/cljs/onyx_dashboard/components/main.cljs
@@ -40,35 +40,26 @@
                                    (g/col {:xs 6 :md 4}
                                           (dom/div {:class "left-nav-deployment"}
                                                    (om/build select-deployment app {}))
+                                          (if (:id deployment)
+                                            (dom/div
+                                              (om/build deployment-indicator
+                                                        {:deployment deployment
+                                                         :last-entry ((:entries deployment) (:message-id-max deployment))})
+                                              (om/build job-selector deployment {})
+                                              (om/build deployment-peers deployment {})
+                                              (if job
+                                                (om/build job-management
+                                                          job
+                                                          {:react-key (str "management-" (:id job))})))))
+                                   (g/col {:xs 11 :md 8}
+                                          (if (:id deployment)
+                                            (dom/div
+                                              (if job
+                                                (om/build job-info
+                                                          (if (:up? deployment) job (dissoc job :tasks :peers))
+                                                          {:react-key (str "job-info-" (:id job))}))

-                                          (if (:id deployment)
-                                            (dom/div {}
-                                                     (om/build deployment-indicator
-                                                               {:deployment deployment
-                                                                :last-entry ((:entries deployment) (:message-id-max deployment))}
-                                                               {})))
-
-                                          (if (:id deployment)
-                                            (dom/div {}
-                                                     (om/build job-selector deployment {})))
-
-                                          (if (:id deployment)
-                                            (dom/div {}
-                                                     (om/build deployment-peers deployment {})))
-
-                                          (dom/div {}
-                                                   (if job
-                                                     (om/build job-management
-                                                               job
-                                                               {:react-key (str "management-" (:id job))}))))
-                                   (g/col {:xs 11 :md 8}
-                                          (dom/div
-                                            (if job
-                                              (om/build job-info
-                                                        (if (:up? deployment) job (dissoc job :tasks :peers))
-                                                        {:react-key (str "job-info-" (:id job))}))
-
-                                            (om/build log-entries-pager
-                                                      {:entries (:entries deployment)
-                                                       :job-filter (:id job)}
-                                                      {:react-key (str "log-" (:id deployment) "-filter-" (:id job))})))))))))
+                                              (om/build log-entries-pager
+                                                        {:entries (:entries deployment)
+                                                         :job-filter (:id job)}
+                                                        {:react-key (str "log-" (:id deployment) "-filter-" (:id job))}))))))))))


Back to mutation/alternation with more rates.

--- src/clojush/problems/classification/penn.clj
+++ src/clojush/problems/classification/penn.clj
@@ -156,22 +156,22 @@
    :population-size 1000
    :max-generations 300
    :parent-selection :lexicase
-   ;:genetic-operator-probabilities {:alternation 0.2
-   ;                                 :uniform-mutation 0.2
-   ;                                 :uniform-close-mutation 0.1
-   ;                                 [:alternation :uniform-mutation] 0.5
-   ;                                 ;:genesis 0.1 ;***
-   ;                                 }
+   :genetic-operator-probabilities {:alternation 0.2
+                                    :uniform-mutation 0.2
+                                    :uniform-close-mutation 0.1
+                                    [:alternation :uniform-mutation] 0.5
+                                    ;:genesis 0.1 ;***
+                                    }
    ;:genetic-operator-probabilities {:uniform-addition-and-deletion 0.45
    ;                                 :uniform-combination-and-deletion 0.45
    ;                                 :genesis 0.1}
-   :genetic-operator-probabilities {:uniform-addition-and-deletion 0.9
-                                    :uniform-combination-and-deletion 0.1}
+   ;:genetic-operator-probabilities {:uniform-addition-and-deletion 0.9
+   ;                                 :uniform-combination-and-deletion 0.1}
    :uniform-addition-and-deletion-rate [0.1 0.01] ;[1/16 1/32 1/64 1/128]
    :uniform-combination-and-deletion-rate 1 ;[1 1/2 1/4 1/8]
-   :alternation-rate 0.01
-   :alignment-deviation 10
-   :uniform-mutation-rate 0.01
+   :alternation-rate [0.01 0.1]
+   :alignment-deviation [1 10 100]
+   :uniform-mutation-rate [0.01 0.1]
    :problem-specific-report penn-report
    :problem-specific-initial-report penn-initial-report
    ;:print-behavioral-diversity true ;; requires maintaining @population-behaviors


fix (defn fo-ps1)

fix (defn fo-ps1)

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -1201,8 +1201,15 @@
 (defn fo-ps1 [expr]
   (let [head-first? (get-in expr [:first] :none)]
     (cond
+      (and (= ::none (get-in expr [:head] ::none))
+           (= ::none (get-in expr [:comp] ::none))
+           (not (= ::none (get-in expr [:surface] ::none)))
+           (not (= ::none (get-in expr [:rule] ::none))))
+      (str "[" (get-in expr [:rule]) " "
+           "'" (get-in expr [:surface]) "']")
+
       (= head-first? :none)
-      (str "'" (fo expr) "'")
+      (str "'" (fo expr) "'/" (get-in expr [:synsem :cat] ""))

       (= head-first? :comp)
       (str "[" (get-in expr [:rule]) " "
@@ -1216,7 +1223,7 @@
            (fo-ps1 (get-in expr [:comp]))
            "]")

-      true "")))
+      true "??")))

 (defn fo [input]
   (cond


+(replace-over): applies a set of morphological rules over a string, returns a set of both modified and unmodified strings

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -74,6 +74,28 @@
    ["su le"  "sulle"]
       ])

+
+;; TODO: pre-compile these rules rather than building regexp objects at runtime.
+(defn apply-one-rule [string from-to-pair]
+  (let [from (second from-to-pair)
+        to (first from-to-pair)]
+    (let [from-pattern (java.util.regex.Pattern/compile
+                        (str "\\b" from "\\b"))]
+      (string/replace string from-pattern to))))
+
+(defn replace-over [strings]
+  (let [result (set (reduce concat
+                            (map (fn [string]
+                                   (map #(apply-one-rule string %)
+                                        preposition-plus-article))
+                                 strings)))]
+    (if (not (= result strings))
+      (replace-over result)
+      strings)))
+
+(defn tokenize-prepositions-in [string & [match-pairs]]
+  string)
+
 ;; replace-patterns are declarative data that determine how analysis (and soon conjugation) are performed.
 (def replace-patterns
   (concat


Install git in tools-deps images (slim & alpine)

tools-deps used to use a git library but switched to invoking the git command, so it needs to be in here to support git deps

--- src/docker_clojure/dockerfile/tools_deps.clj
+++ src/docker_clojure/dockerfile/tools_deps.clj
@@ -3,11 +3,11 @@

 (def distro-deps
   {:debian-slim {:build   #{"wget" "curl"}
-                 :runtime #{"rlwrap" "make"}}
+                 :runtime #{"rlwrap" "make" "git"}}
    :debian      {:build   #{}
                  :runtime #{"rlwrap" "make"}}
    :alpine      {:build   #{"curl"}
-                 :runtime #{"bash" "make"}}})
+                 :runtime #{"bash" "make" "git"}}})

 (def install-deps (partial install-distro-deps distro-deps))


Actually put exception in body of email on build exception

--- src/circle/backend/build/email.clj
+++ src/circle/backend/build/email.clj
@@ -24,7 +24,16 @@
               :subject (email-subject build)
               :body (email-body build)))

+(defn except-to-string [e]
+  (str (.getMessage e) "\n"
+       (-> e
+           (.getStackTrace)
+           (seq)
+           (->>
+            (map #(.toString %))
+            (str/join "\n")))))
+
 (defn send-build-error-email [build e]
   (email/send :to "arohner@gmail.com"
               :subject "Circle exception"
-              :body (with-out-str (str build) "\n" (.printStackTrace e))))
+              :body (str build "\n" (except-to-string e))))


add filterer option to atom task

add filterer option to atom task

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -335,28 +335,26 @@

 (def ^:private +atom-defaults+
   {:filename "atom.xml"
-   :target "public"
-   :filterer identity})
+   :filterer :content
+   :target "public"})

 (deftask atom-feed
   "Generate Atom feed"
-  [f filename    FILENAME    str  "generated Atom feed filename"
-   o target      OUTDIR      str  "the output directory"
-   _ filterer    FILTER      code "filter function"
-   t title       TITLE       str  "feed title"
-   s subtitle    SUBTITLE    str  "feed subtitle"
-   p description DESCRIPTION str  "feed description"
-   l link        LINK        str  "feed link"]
+  [f filename    FILENAME    str "generated Atom feed filename"
+   _ filterer    FILTER     code "filter function"
+   o target      OUTDIR      str "the output directory"
+   t title       TITLE       str "feed title"
+   s subtitle    SUBTITLE    str "feed subtitle"
+   p description DESCRIPTION str "feed description"
+   l link        LINK        str "feed link"]
   (let [pod (create-pod atom-deps)
         tmp (boot/tmp-dir!)]
     (boot/with-pre-wrap fileset
       (let [global-meta   (perun/get-global-meta fileset)
             options       (merge +atom-defaults+ global-meta *opts*)
-            files         (perun/get-meta fileset)
-            content-files (filter :content files)
-            filtered-files (filter (:filterer options) content-files)]
+            files         (filter (:filterer options) (perun/get-meta fileset))]
         (pod/with-call-in @pod
-          (io.perun.atom/generate-atom ~(.getPath tmp) ~filtered-files ~(dissoc options :filterer)))
+          (io.perun.atom/generate-atom ~(.getPath tmp) ~files ~options))
         (commit fileset tmp)))))

 (defn- wrap-pool [pool]


Force vector for examples page data

Force vector for examples page data

--- src/clj/clojuredocs/pages/vars.clj
+++ src/clj/clojuredocs/pages/vars.clj
@@ -99,7 +99,7 @@
            :body
            (common/$main
              {:body-class "var-page"
-              :page-data {:examples (map clean-example examples)
+              :page-data {:examples (mapv clean-example examples)
                           :var v
                           :notes (map clean-id notes)
                           :see-alsos (map clean-see-also see-alsos)


Global Sec breaker set.

Global Sec breaker set.

--- src/clj/game/cards-icebreakers.clj
+++ src/clj/game/cards-icebreakers.clj
@@ -71,11 +71,14 @@
     :pump strength}))

 (defn- break-sub
-  "Creates a break subroutine ability."
+  "Creates a break subroutine ability.
+  If num = 0 then any number of subs are broken."
   ([cost num] (break-sub cost num nil))
   ([cost num subtype]
-   {:msg (str "break " (when (> num 1) "up to ") num (when subtype (str " " subtype))
-              " subroutine" (when (> num 1) "s"))
+   {:msg (str "break " (when (> num 1) "up to ")
+              (if (pos? num) num "any number of")
+              (when subtype (str " " subtype))
+              " subroutine" (when-not (= num 1) "s"))
     :cost [:credit cost]}))

 ;;; Breaker sets
@@ -98,6 +101,12 @@
                                 {:runner-install cloud :trash cloud :card-moved cloud})
                       :strength-bonus (req (count (filter #(has-subtype? % "Icebreaker")
                                                           (all-installed state :runner))))}))
+
+(defn- global-sec-breaker
+  "GlobalSec breakers for Sunny"
+  [type]
+  (cloud-icebreaker (auto-icebreaker [type] {:abilities [(break-sub 2 0 (lower-case type))
+                                                         (strength-pump 2 3)]})))

 ;;; Icebreaker definitions
 (def cards-icebreakers
@@ -291,25 +300,13 @@
                                  (strength-pump 2 3)]})

    "GS Sherman M3"
-   (cloud-icebreaker
-     (auto-icebreaker ["Barrier"]
-                      {:abilities [{:cost [:credit 2]
-                                    :msg "break any number of barrier subroutines"}
-                                   (strength-pump 2 3)]}))
+   (global-sec-breaker "Barrier")

    "GS Shrike M2"
-   (cloud-icebreaker
-     (auto-icebreaker ["Sentry"]
-                      {:abilities [{:cost [:credit 2]
-                                    :msg "break any number of sentry subroutines"}
-                                   (strength-pump 2 3)]}))
+   (global-sec-breaker "Sentry")

    "GS Striker M1"
-   (cloud-icebreaker
-     (auto-icebreaker ["Code Gate"]
-                      {:abilities [{:cost [:credit 2]
-                                    :msg "break any number of code gate subroutines"}
-                                   (strength-pump 2 3)]}))
+   (global-sec-breaker "Code Gate")

    "Inti"
    (auto-icebreaker ["Barrier"]
@@ -332,7 +329,7 @@
                                  (strength-pump 3 5)]})

    "Morning Star"
-   {:abilities [{:cost [:credit 1] :msg "break any number of barrier subroutines"}]}
+   {:abilities [(break-sub 1 0 "barrier")]}

    "Mimic"
    {:abilities [(break-sub 1 1 "sentry")]}
@@ -419,7 +416,7 @@

    "Switchblade"
    (auto-icebreaker ["Sentry"]
-                    {:abilities [{:cost [:credit 1] :msg "break any number of sentry subroutines"}
+                    {:abilities [(break-sub 1 0 "sentry")
                                  (strength-pump 1 7)]})

    "Torch"


scaffolding bfs messaging

scaffolding bfs messaging

--- src/clj/morpheus/traversal/bfs.clj
+++ src/clj/morpheus/traversal/bfs.clj
@@ -1,6 +1,7 @@
 (ns morpheus.traversal.bfs
   (:require [neb.core :as neb]
-            [morpheus.computation.base :as compute]))
+            [morpheus.computation.base :as compute]
+            [morpheus.messaging.core :as msg]))

 ; Parallel breadth-first-search divised by Aydın Buluç
 ; The algoithm was first introduced in Lawrence National Laboratory on BlueGene supercomputer
@@ -16,9 +17,18 @@
 (defn partation-vertices [vertex-ids]
   )

+(defn proc-forward-msg [task-id data]
+  )
+
+(defn proc-return-msg [task-id data]
+  )
+
 (defn bfs [vertex {:keys [filters max-deepth stop-cond timeout with-edges? with-vertices?] :as extra-params
                    :or {:timeout 60000}}]
   "Perform parallel and distributed breadth first search"
   (let [task-id (neb/rand-cell-id)]
     (compute/new-task task-id extra-params)
-    ))+    ))
+
+(msg/register-action :BFS-FORWARD proc-forward-msg)
+(msg/register-action :BFS-RETURN proc-return-msg)


Add ability to load font from path

Add ability to load font from path

--- src/clj/robinson/swingterminal.clj
+++ src/clj/robinson/swingterminal.clj
@@ -4,7 +4,8 @@
             robinson.aterminal)
   (:require [robinson.macros :as rm]
             [taoensso.timbre :as timbre]
-            [clojure.core.async :as async :refer [go go-loop]])
+            [clojure.core.async :as async :refer [go go-loop]]
+            clojure.java.io)
   (:import
             java.util.concurrent.LinkedBlockingQueue
             java.awt.Color
@@ -39,6 +40,16 @@
   []
   (not (nil? (re-find #"[Mm]ac" (System/getProperty "os.name")))))

+
+(defn make-font
+  [name-or-path style size]
+  (let [font-file (clojure.java.io/as-file name-or-path)]
+    (if (.exists font-file)
+      ;; Load font from file
+      (.deriveFont (Font/createFont Font/TRUETYPE_FONT font-file) (int style) (float size))
+      ;; Load font from font registry
+      (Font. name-or-path style size))))
+
 ;; Normally this would be a record, but until http://dev.clojure.org/jira/browse/CLJ-1224 is fixed
 ;; it is not performant to memoize records because hashCode values are not cached and are recalculated
 ;; each time.
@@ -66,11 +77,11 @@
                        font-size]
     (let [is-windows       (>= (.. System (getProperty "os.name" "") (toLowerCase) (indexOf "win")) 0)
           normal-font      (if is-windows
-                              (Font. windows-font Font/PLAIN font-size)
-                              (Font. else-font Font/PLAIN font-size))
+                              (make-font windows-font Font/PLAIN font-size)
+                              (make-font else-font Font/PLAIN font-size))
           bold-font        (if is-windows
-                              (Font. windows-font Font/BOLD font-size)
-                              (Font. else-font  Font/BOLD font-size))
+                              (make-font windows-font Font/BOLD font-size)
+                              (make-font else-font  Font/BOLD font-size))
           _                (info "Using font" (.getFontName normal-font))
           default-fg-color (Color. (long default-fg-color-r) (long default-fg-color-g) (long default-fg-color-b))
           default-bg-color (Color. (long default-bg-color-g) (long default-bg-color-g) (long default-bg-color-b))


Redirect http to https for images

Redirect http to https for images

--- src/reddio_frontend/components/thumbnail.cljs
+++ src/reddio_frontend/components/thumbnail.cljs
@@ -1,5 +1,6 @@
 (ns reddio-frontend.components.thumbnail
-  (:require [reagent.core :as r]))
+  (:require [clojure.string :as string]
+            [reagent.core :as r]))

 (defn rand-color []
   (rand-nth ["#ef9a9a"
@@ -33,5 +34,5 @@
                                :height h}}
        (if @loading-error
          [:div.thumbnail-error {:style {:backgroundColor placeholder-color}}]
-         [:img {:src image
+         [:img {:src (string/replace-first image "http://" "https://")
                 :on-error #(reset! loading-error true)}])])))


cleanup; Fixed field-visual-regressions

cleanup; Fixed field-visual-regressions

--- src/visuals/untangled/ui/element_visuals.cljs
+++ src/visuals/untangled/ui/element_visuals.cljs
@@ -154,8 +154,8 @@
 (defcard field-visual-regressions
   (dom/div nil
     (for [size [:normal :small :medium :large]
-          state [:none :required :focus :invalid :error]]
-      (e/ui-field {:size size :state #{state} :key (str size state (rand-int 256))} (str (name size) " " (name state) " field")))))
+          states [:valid :invalid :error]]
+      (e/ui-field {:size size :state states :key (str size states (rand-int 256))} (str (name size) " " (name states) " field")))))

 ;; TODO Need icon-bar


fix: use attr-value not (type attr-value)

--- src/main/clojure/pdok/featured/geoserver.clj
+++ src/main/clojure/pdok/featured/geoserver.clj
@@ -261,7 +261,7 @@
         (let [current-attributes (cached-collection-attributes collection)
               new-attributes (filter #(not (get current-attributes (first %))) attributes)]
           (doseq [[attr-key attr-value] new-attributes]
-            (checked (gs-add-attribute this collection attr-key (type attr-value))
+            (checked (gs-add-attribute this collection attr-key attr-value)
                      (get (gs-collection-attributes this collection) attr-key)))
           (when (not-empty new-attributes) (cached-collection-attributes :reload collection)))
         (batched-update-feature feature))))


Changed hard-coded string to localized string.

--- app/src/clj_web_example/ui/index.clj
+++ app/src/clj_web_example/ui/index.clj
@@ -1,6 +1,7 @@
 (ns clj-web-example.ui.index
   (:require [clojure.java.io :as io]
-            [hiccup.page :as page])
+            [hiccup.page :as page]
+            [clj-web-example.localization :refer [tr]])
   (:import [org.apache.commons.codec.digest DigestUtils]))

 (defn resource-with-checksum
@@ -16,7 +17,7 @@
   []
   (page/html5
     [:head
-     [:title "clj-web-example"]
+     [:title (tr :title)]
      [:meta {:charset "utf-8"}]
      [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}]
      [:meta {:name "viewport"


clean up docstring, no functional changes

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -107,10 +107,7 @@
   "Converts a serial number to the format it needs to be written in on disk.
   This function has to write serial numbers in the same format that the puppet
   ruby code does, to maintain compatibility with things like 'puppet cert';
-  for whatever arcane reason, that format is 0-padding up to 4 digits.
-
-  (format '%04X' 42)
-  => '002A'"
+  for whatever arcane reason, that format is 0-padding up to 4 digits."
   [serial-number]
   {:pre [(integer? serial-number)]}
   (format "%04X" serial-number))


Fix a namespace reference related with the Either data structure.

--- src/mofficer/persistence/user_config_dao.clj
+++ src/mofficer/persistence/user_config_dao.clj
@@ -1,7 +1,7 @@
 (ns mofficer.persistence.user-config-dao
   (:require [clojure.java.jdbc :as jdbc-clj]
-            [mofficer.domain.entities.either])
-  (:import [mofficer.domain.entities.either Either]))
+            [mofficer.infrastructure.datastructures.either])
+  (:import [mofficer.infrastructure.datastructures.either Either]))

 (def mysql-db {:subprotocol "mysql"
                :subname "//localhost:3306/mofficerdb"


Fix bug in job deallocation where peers were not set to idle

--- src/onyx/scheduling/common_job_scheduler.clj
+++ src/onyx/scheduling/common_job_scheduler.clj
@@ -70,6 +70,9 @@
   [replica]
   (throw (ex-info (format "Job scheduler %s not recognized" (:job-scheduler replica))
                   {:job-scheduler (:job-scheduler replica)})))
+
+(defn replica->job-peers [replica job-id]
+  (apply concat (vals (get-in replica [:allocations job-id]))))

 (defn current-job-allocations [replica]
   (into {}
@@ -199,6 +202,16 @@
    replica
    (:jobs replica)))

+(defn remove-job [replica job]
+  (let [peers (sort (replica->job-peers replica job))]
+    (-> replica
+        (update-in [:allocations] dissoc job)
+        (update-in [:peer-state] (fn [peer-state]
+                                   (reduce (fn [ps peer]
+                                             (assoc ps peer :idle))
+                                           peer-state
+                                           peers))))))
+
 (defn deallocate-starved-jobs
   "Strips out allocations from jobs that no longer meet the minimum number
    of peers. This can happen if a peer leaves from a running job."
@@ -211,7 +224,7 @@
                          (get-in result [:min-required-peers job t] 1)))
                    tasks)
          result
-         (update-in result [:allocations] dissoc job))))
+         (remove-job result job))))
    replica
    (:jobs replica)))


Add the library signature to the rdf

Add the library signature to the rdf

--- src/mdr2/rdf.clj
+++ src/mdr2/rdf.clj
@@ -16,7 +16,7 @@
            source_date source_edition source_publisher source_rights source_title
            multimedia_type multimedia_content narrator producer produced_date
            revision revision_date revision_description
-           total_time audio_format periodical_number]}]
+           total_time audio_format periodical_number library_signature]}]
   [:rdf:RDF {:xmlns:rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
              :xmlns:dc "http://purl.org/dc/elements/1.1/"
              :xmlns:dtb "http://www.daisy.org/z3986/2005/dtbook/"
@@ -54,7 +54,8 @@
                 :dtb:totalTime total_time
                 :dtb:audioFormat audio_format
                 :sbs:idVorstufe periodical_number
-                :sbs:idMaster (str "DAM " id)]
+                :sbs:idMaster (str "DAM " id)
+                :sbs:idAusleihe library_signature]
                (partition 2))]
       (when v [k v]))]])


(PCP-681) Add unit test that connections are initiated

Verifies that pcp-client connections are initiated when
initiate-controller-connections is called.

--- test/unit/puppetlabs/pcp/broker/core_test.clj
+++ test/unit/puppetlabs/pcp/broker/core_test.clj
@@ -377,3 +377,21 @@
             (let [outcome (process-message! broker (message/v2-encode msg) :dummy-ws)]
               (is (= msg (message/v2-decode @sent-message)))
               (is (nil? outcome)))))))))
+
+(deftest initiate-controllers-test
+  (let [is-connecting (promise)]
+    (with-redefs [puppetlabs.pcp.client/connect (fn [params handlers] (deliver is-connecting true) :client)
+                  ws->uri mock-ws->uri]
+      (let [broker (assoc (make-test-broker)
+                          :authorization-check yes-authorization-check)
+            ssl-context-factory (make-mock-ssl-context-factory nil)
+            _ (.start ssl-context-factory)
+            ssl-context (.getSslContext ssl-context-factory)
+            _ (.stop ssl-context-factory)
+            clients (initiate-controller-connections broker ssl-context ["wss://foo.com/v1"])
+            client (get clients "pcp://foo.com/server")]
+        (is (= 1 (count clients)))
+        (is client)
+        (is (deref is-connecting 1000 nil)
+        (is (= :client (:websocket client))
+        (is (= "pcp://foo.com/server" (:uri client)))))))))


(PDB-3723) Don't limit jsonb facts queries to depth 0

[rlb@puppet.com: adjust commit message]

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -1467,12 +1467,6 @@
             [["=" "value" (value :guard #(ks/boolean? %))]]
             ["and" ["=" ["function" "jsonb_typeof" "value"] "boolean"] ["=" "value" value]]

-            [[(op :guard #{"=" "~" ">" "<" "<=" ">="}) "value" value]]
-            (when (= :facts (get-in (meta node) [:query-context :entity]))
-              ["and" ["=" "depth" 0] [op "value" value]])
-
-
-
             [["=" ["node" "active"] value]]
             (expand-query-node ["=" "node_state" (if value "active" "inactive")])


Hobble nml-str, nml-set (latter must be fixed)

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -4,7 +4,8 @@
   (:require [clojure.tools.cli :as cli   ])
   (:gen-class))

-(declare nml-get nml-name nml-parse nml-set nml-str strmap)
+;;(declare nml-get nml-name nml-parse nml-set nml-str strmap)
+(declare nml-get nml-parse nml-set strmap)

 ;; formatting

@@ -87,8 +88,8 @@
               (if no-prefix val (str nml ":" key "=" val))))]
     (str (string/join "\n" (map f gets)) "\n")))

-(defn- nml-name [x]
-  (nml-str (second x)))
+;;(defn- nml-name [x]
+;; (nml-str (second x)))

 (defn- nml-out [out s]
   (if (= out *out*)
@@ -119,52 +120,52 @@
         (if (nil? val) (fail (str "No value supplied for key '" key "'")))
         (recur (nml-set m nml key val) (rest s))))))

-(defn- nml-str [x]
-  (let [key (first x)
-        val (rest x)
-        cjoin #(string/join "," %)
-        delegate #(map nml-str %)
-        delegate_sorted (fn [val] (delegate (sort-by #(nml-name %) val)))
-        list2str #(strmap nml-str %)
-        strfirst #(nml-str (first %))
-        strlast #(nml-str (last %))]
-    (apply str (case key
-                     :s                     (string/join "\n" (delegate_sorted val))
-                     :array                 [(strfirst val) (strlast val)]
-                     :c                     (strfirst val)
-                     :comment               ""
-                     :complex               ["(" (cjoin (delegate val)) ")"]
-                     :dataref               (delegate val)
-                     :dec                   ["." (strlast val)]
-                     :exp                   [(first val) (strlast val)]
-                     :false                 "f"
-                     :filler                ""
-                     :int                   (delegate val)
-                     :junk                  ""
-                     :logical               (strfirst val)
-                     :name                  (map string/lower-case val)
-                     :nv_sequence           val ;;(string/join " " (delegate_sorted val))
-                     :nv_subsequence        val ;;[(strfirst val) "=" (strlast val)]
-                     :nv_subsequence_begin  val
-                     :nv_subsequence_end    val
-                     :nv_subsequence_sep    val
-                     :partref               (strfirst val)
-                     :r                     (strfirst val)
-                     :real                  (delegate val)
-                     :sect                  ["(" (list2str val) ")"]
-                     :sign                  val
-                     :star                  val
-                     :stmt                  ["&" (strfirst val) " " (list2str (rest val)) " /"]
-                     :stmt_end              val
-                     :string                val
-                     :true                  "t"
-                     :uint                  val
-                     :value                 (delegate val)
-                     :values                (cjoin (delegate val))
-                     :values_sep            val
-                     :ws                    ""
-                     :wsopt                 ""
-                     val))))
+;;(defn- nml-str [x]
+;; (let [key (first x)
+;;       val (rest x)
+;;       cjoin #(string/join "," %)
+;;       delegate #(map nml-str %)
+;;       delegate_sorted (fn [val] (delegate (sort-by #(nml-name %) val)))
+;;       list2str #(strmap nml-str %)
+;;       strfirst #(nml-str (first %))
+;;       strlast #(nml-str (last %))]
+;;   (apply str (case key
+;;                    :s                     (string/join "\n" (delegate_sorted val))
+;;                    :array                 [(strfirst val) (strlast val)]
+;;                    :c                     (strfirst val)
+;;                    :comment               ""
+;;                    :complex               ["(" (cjoin (delegate val)) ")"]
+;;                    :dataref               (delegate val)
+;;                    :dec                   ["." (strlast val)]
+;;                    :exp                   [(first val) (strlast val)]
+;;                    :false                 "f"
+;;                    :filler                ""
+;;                    :int                   (delegate val)
+;;                    :junk                  ""
+;;                    :logical               (strfirst val)
+;;                    :name                  (map string/lower-case val)
+;;                    :nv_sequence           val ;;(string/join " " (delegate_sorted val))
+;;                    :nv_subsequence        val ;;[(strfirst val) "=" (strlast val)]
+;;                    :nv_subsequence_begin  val
+;;                    :nv_subsequence_end    val
+;;                    :nv_subsequence_sep    val
+;;                    :partref               (strfirst val)
+;;                    :r                     (strfirst val)
+;;                    :real                  (delegate val)
+;;                    :sect                  ["(" (list2str val) ")"]
+;;                    :sign                  val
+;;                    :star                  val
+;;                    :stmt                  ["&" (strfirst val) " " (list2str (rest val)) " /"]
+;;                    :stmt_end              val
+;;                    :string                val
+;;                    :true                  "t"
+;;                    :uint                  val
+;;                    :value                 (delegate val)
+;;                    :values                (cjoin (delegate val))
+;;                    :values_sep            val
+;;                    :ws                    ""
+;;                    :wsopt                 ""
+;;                    val))))

 ;; nml public defns

@@ -193,10 +194,12 @@
       (println (str "#PM# 1 " newtree))
       newtree)))

+;;(defn nml-set [m nml key val]
+;; (let [src (str "user-supplied value")
+;;       val (nml-str (nml-parse val :values src))]
+;;   (assoc-in m [(string/lower-case nml) (string/lower-case key)] val)))
 (defn nml-set [m nml key val]
-  (let [src (str "user-supplied value")
-        val (nml-str (nml-parse val :values src))]
-    (assoc-in m [(string/lower-case nml) (string/lower-case key)] val)))
+  (assoc-in m {"FIX" "ME"})) ;; #PM# FIX THIS

 ;; cli


[Fixed #7948] Do not navigate back to chat when in a DApp

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/ui/screens/routing/browser_stack.cljs
+++ src/status_im/ui/screens/routing/browser_stack.cljs
@@ -3,5 +3,6 @@
 (def browser-stack
   {:name       :browser-stack
    :screens    [:open-dapp
-                :browser]
-   :config     {:initialRouteName :open-dapp}})+                :browser
+                :qr-scanner]
+   :config     {:initialRouteName :open-dapp}})


test hook to see if it runs in background

--- src/main/cawala/ui/components.cljs
+++ src/main/cawala/ui/components.cljs
@@ -11,7 +11,7 @@
                     {:db/id id :person/name name :person/age age})}
   (dom/li
    (dom/h5 (str name "(age: " age ")")
-           (dom/button {:onClick #(onDelete id)} "B")
+           (dom/button {:onClick #(onDelete id)} "X")
            (dom/button {:onClick #(df/refresh! this)} "Refresh"))))

 (def ui-person (prim/factory Person {:keyfn :person/name}))


Enable debug trace for liberator.

Enable debug trace for liberator.

--- src/main/clj/planted/webserver.clj
+++ src/main/clj/planted/webserver.clj
@@ -6,6 +6,7 @@
             [compojure.core :refer [routes wrap-routes ANY POST GET]]
             [compojure.route :as route]
             [liberator.core :refer [resource defresource get-options]]
+            [liberator.dev :refer [wrap-trace]]
             [planted.api :refer [get-api-routes]]
             [ring.middleware.cookies :refer [wrap-cookies]]
             [ring.middleware.content-type :refer [wrap-content-type]]
@@ -98,6 +99,9 @@
       ;; Log everything that comes in
       log-request

+      ;; Debug logging for API
+      (wrap-trace :header :ui)
+
       ;; Authentication
       auth-handler


deploy to artifactory

deploy to artifactory

--- build.boot
+++ build.boot
@@ -1,17 +1,24 @@
+(def +version+ "0.0.3-SNAPSHOT")
+
 (set-env!
   :resource-paths #{"src"}
   :dependencies '[
                   [org.clojure/clojure "1.8.0" :scope "provided"]
                   [me.raynes/conch "0.8.0"]
                   ]
-  :repositories #(conj % ["clojars" {:url "https://clojars.org/repo/"
-                                     :username (System/getenv "CLOJARS_USER")
-                                     :password (System/getenv "CLOJARS_PASS")}])
-  )
+  :repositories #(conj %
+                       ["clojars" {:url "https://clojars.org/repo/"
+                                   :username (System/getenv "CLOJARS_USER")
+                                   :password (System/getenv "CLOJARS_PASS")}]
+                       ["artifactory" {:url (or
+                                              (System/getenv "ARTIFACTORY_URL")
+                                              (str "http://104.198.42.43:8081/artifactory/libs-"
+                                                   (if (.contains +version+ "SNAPSHOT") "snapshot" "release")
+                                                   "-local"))
+                                       :username (System/getenv "ARTIFACTORY_USER")
+                                       :password (System/getenv "ARTIFACTORY_PASS")}]))

 (require '[boot.task.built-in :refer [push]])
-
-(def +version+ "0.0.3-SNAPSHOT")

 (deftask build
   "Build the jar in prep for deploy."
@@ -34,7 +41,7 @@
   []
   (comp
     (build)
-    (push :repo "clojars")))
+    (push :repo "artifactory")))

 (task-options!
   pom {:project 'lwhorton/boot-stylus


Add visual notifications to dev task

Add visual notifications to dev task

--- build.boot
+++ build.boot
@@ -142,6 +142,7 @@
   (comp (serve)
         (repl)
         (watch)
+        (notify :visual true)
         (build-html :metadata-file "perun.base.dev.edn")
         (build-css)
         (reload :on-jsload 'zetawar.core/run


Updated the deps

Updated the deps

--- build.boot
+++ build.boot
@@ -1,23 +1,23 @@
 (set-env!
   :source-paths #{"src/cljs" "src/cljx" "src/less"}
   :resource-paths #{"src/clj"}
-  :dependencies '[[adzerk/boot-cljs       "0.0-2629-4" :scope "test"]
+  :dependencies '[[adzerk/boot-cljs       "0.0-2760-0" :scope "test"]
                   [adzerk/boot-cljs-repl  "0.1.8"      :scope "test"]
                   [adzerk/boot-reload     "0.2.4"      :scope "test"]
-                  [deraen/boot-cljx       "0.2.1"      :scope "test"]
+                  [deraen/boot-cljx       "0.2.2"      :scope "test"]
                   [deraen/boot-less       "0.2.1"      :scope "test"]

                   ; Backend
                   [org.clojure/clojure "1.6.0"]
                   [http-kit "2.1.19"]
-                  [org.clojure/tools.namespace "0.2.8"]
+                  [org.clojure/tools.namespace "0.2.9"]
                   [metosin/ring-http-response "0.5.2"]
                   [ring "1.3.2"]
                   [compojure "1.3.1"]
                   [hiccup "1.0.5"]

                   ; Frontend
-                  [org.omcljs/om "0.8.7"]
+                  [org.omcljs/om "0.8.8"]
                   [prismatic/om-tools "0.3.10"]
                   [sablono "0.3.1"]


Fix rolback functionality

Fix rolback functionality

`dev> (rollback)`
currently getting ...
```
SQLException No suitable driver found for MxTiCr0Vcw6m78X3ChEDoHbDk7GxOWf8eQBcJ69imThODU4jIPFkM6UxPZb7aUJtp+GSaumwPnTpDmRSPNrYDaE+yBgr6tdgMKWgoQJ6tkA=
	java.sql.DriverManager.getConnection (DriverManager.java:689)
	java.sql.DriverManager.getConnection (DriverManager.java:270)
	clojure.java.jdbc/get-connection (jdbc.clj:320)
	clojure.java.jdbc/get-connection (jdbc.clj:226)
	clojure.java.jdbc/get-connection (jdbc.clj:281)
	clojure.java.jdbc/get-connection (jdbc.clj:226)
	ragtime.jdbc/get-table-names (jdbc.clj:28)
	ragtime.jdbc/get-table-names (jdbc.clj:25)
	ragtime.jdbc/table-exists? (jdbc.clj:32)
	ragtime.jdbc/table-exists? (jdbc.clj:31)
	ragtime.jdbc/ensure-migrations-table-exists (jdbc.clj:35)
	ragtime.jdbc/ensure-migrations-table-exists (jdbc.clj:34)
nil
```

--- backend/src/akvo/lumen/migrate.clj
+++ backend/src/akvo/lumen/migrate.clj
@@ -85,9 +85,9 @@
                          amount-or-id))

-(defn rollback-tenants [db migrations amount-or-id]
+(defn rollback-tenants [db connection-uri-fn migrations amount-or-id]
   (doseq [tenant (all-tenants db)]
-    (do-rollback (ragtime-jdbc/sql-database {:connection-uri (:db_uri tenant)})
+    (do-rollback (ragtime-jdbc/sql-database {:connection-uri (connection-uri-fn tenant)})
                  migrations
                  amount-or-id)))

@@ -102,7 +102,9 @@
         tenant-migrations (:tenants migrations)
         tenant-manager-migrations (:tenant-manager migrations)

-        tenant-manager-db {:connection-uri (get-in system [:config :db :uri])}]
+        tenant-manager-db {:connection-uri (get-in system [:config :db :uri])}
+        tenant-connection-uri-fn #(aes/decrypt (get-in system [:config :config :encryption-key])
+                                       (:db_uri %))]
     (cond
       (= arg :tenant-manager)
       (do-rollback (ragtime-jdbc/sql-database tenant-manager-db)
@@ -110,11 +112,11 @@
                    (count tenant-manager-migrations))

       (number? arg)
-      (rollback-tenants tenant-manager-db
+      (rollback-tenants tenant-manager-db tenant-connection-uri-fn
                         (:tenants migrations)
                         arg)

       :else
-      (rollback-tenants tenant-manager-db
+      (rollback-tenants tenant-manager-db tenant-connection-uri-fn
                         (:tenants migrations)
                         (count (:tenants migrations))))))