Moved versions up

Moved versions up

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -5,12 +5,11 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}

   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2665"]
-                 [com.facebook/react "0.12.2"]
+                 [org.clojure/clojurescript "0.0-2727"]
                  [figwheel "0.2.2-SNAPSHOT"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [sablono "0.2.22"]
-                 [org.om/om "0.8.0"]]
+                 [org.omcljs/om "0.8.6"]]

   :plugins [[lein-cljsbuild "1.0.4"]
             [lein-figwheel "0.2.2-SNAPSHOT"]]
@@ -18,23 +17,23 @@
   :source-paths ["src"]

   :cljsbuild {
-    :builds [{:id "dev"
-              :source-paths ["src"]
-              :compiler {:output-to "resources/public/js/compiled/{{sanitized}}.js"
-                         :output-dir "resources/public/js/compiled/out"
-                         :optimizations :none
-                         :source-map true
-                         :source-map-timestamp true
-                         :cache-analysis true }}
-             {:id "min"
-              :source-paths ["src"]
-              :compiler {:output-to "resources/public/{{sanitized}}.min.js"
-                         :optimizations :advanced
-                         :pretty-print false}}]}
+              :builds [{:id "dev"
+                        :source-paths ["src"]
+                        :compiler {:output-to "resources/public/js/compiled/{{sanitized}}.js"
+                                   :output-dir "resources/public/js/compiled/out"
+                                   :optimizations :none
+                                   :source-map true
+                                   :source-map-timestamp true
+                                   :cache-analysis true }}
+                       {:id "min"
+                        :source-paths ["src"]
+                        :compiler {:output-to "resources/public/{{sanitized}}.min.js"
+                                   :optimizations :advanced
+                                   :pretty-print false}}]}

   :figwheel {
              :http-server-root "public" ;; default and assumes "resources"
-             :server-port 3449 ;; default
+             :server-port 3449          ;; default
              :css-dirs ["resources/public/css"] ;; watch and update CSS

              ;; Server Ring Handler (optional)


Brought hello-world back

Brought hello-world back

--- profiles.clj
+++ profiles.clj
@@ -13,6 +13,7 @@
                         :region-search
                         :upload-list
                         :histories
+                        :hello-world
                         ]
             :web-audience "http://localhost:3000"
             :verifier "https://verifier.login.persona.org/verify"


updated clojure profiles to use cider 0.10.0-SNAPSHOT. keep an eye on it, might be changed to an older version by something

--- profiles.clj
+++ profiles.clj
@@ -1 +1 @@
-{:user {:plugins [[cider/cider-nrepl "0.9.1"]]}}
+{:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]}}


add back David

add back David

--- frontend/components/about.cljs
+++ frontend/components/about.cljs
@@ -20,6 +20,7 @@
     :visible true
     :bio ["You might not know it by looking at him, but Paul is a wicked card shark. When he's not making his poker buddies cry, he seeks out mogul-laced ski trails to hurl himself down, and within the first five minutes of meeting him he'll probably tell you the story about how he mostly landed a backflip on his skis. Lest his ego get too big, though, we can always remind him of the time he failed at a YCombinator startup, and he'll go bury his emotions in the sweet sweet taste of artisan chocolate--or any chocolate, really.",
           "Paul's been interviewed by the Wall Street Journal, and one of his proudest achievements was giving a Google Tech Talk on compilers and programming languages. He wrote phc, an open source PHP compiler, while doing his PhD on compilers and static analysis in Dublin. After moving to the Bay Area, Paul worked on the Firefox Javascript engine, started Circle, and then wrote stefon, an asset pipeline for Clojure. Because it pains Paul to see so much time wasted due to inadequate developer tools, he approaches continuous integration from the perspective of developer productivity. He loves to focus on building the Circle product, but, as he'll tell you while he's walloping you at table tennis, he also has to take care of the business side of things, too."]}
+   {:name "David Lowe"
     :visible true
     :role "Backend Developer"
     :github "dlowe"


Removed user specific data.

Removed user specific data.

--- profiles.clj
+++ profiles.clj
@@ -19,9 +19,7 @@
             :web-audience "http://localhost:3000"

             :verifier "https://verifier.login.persona.org/verify"
-            :db-subname "//localhost/staircase"
-            :db-user "postgres"
-            :db-password "password"}
+            :db-subname "//localhost/staircase"
  }
  :test {
         :bower-dependencies [[angular-scenario "~1.2.9"]


Document wire-boserver

Document wire-boserver

--- src/yetibot/core/commands/observe.clj
+++ src/yetibot/core/commands/observe.clj
@@ -57,6 +57,8 @@
 (defonce hook (obs-hook all-event-types #'obs-handler))

 (defn wire-observer
+  "Simply acknowledges that the observe was created or replaced. The wiring is
+   done implicitly in obs-handler which pulls observers out of the db."
   [{:keys [event-type pattern cmd user]}]
   (let [existing (lookup pattern)
         re (re-pattern pattern)]


Comma-separated extensions for clojure

Comma-separated extensions for clojure

--- clojure/cljsearch/src/cljsearch/searchsettings.clj
+++ clojure/cljsearch/src/cljsearch/searchsettings.clj
@@ -9,10 +9,7 @@
 (ns cljsearch.searchsettings
   #^{:author "Cary Clark",
      :doc "Defines the settings for a given search instance"}
-  (:import (java.io File))
-  (use [clojure.set :only (union)])
-  (use [clojure.string :only (join split)])
-  (use [clojure.xml]))
+  (:require [clojure.string :as str :only (split)]))

 (defrecord SearchSettings
   [
@@ -98,8 +95,13 @@
 (defn add-element [x coll]
   (conj coll x))

-(defn add-extension [settings x extname]
-  (update-in settings [extname] #(add-element x %)))
+(defn add-extensions [settings exts extname]
+  (if (empty? exts)
+    settings
+    (add-extensions
+      (update-in settings [extname] #(add-element (first exts) %)) (rest exts) extname)))
+(defn add-extension [settings ext extname]
+  (add-extensions settings (str/split ext #",") extname))

 (defn add-pattern [settings p patname]
   (update-in settings [patname] #(add-element p %)))


CMR-1878: Minor doc change

CMR-1878: Minor doc change

--- common-lib/src/cmr/common/cache/fallback_cache.clj
+++ common-lib/src/cmr/common/cache/fallback_cache.clj
@@ -22,8 +22,9 @@

   ## Downsides and Caveats:

-  For most use cases only a single store is required with the fallback being to use a provided
-  lookup function to obtain the value. This cache should only be used when a secondary store is
+
+  For most use cases only a single store is required with the fallback being a lookup function
+  provided to obtain the value. This cache should only be used when a secondary store is
   needed rather than just a lookup function."
   (:require [cmr.common.cache :as c]
             [clojure.set :as set]))


Tests that show line-numbering not yet working right for =future=> =not=>

--- test/behaviors/t_line_number_reporting.clj
+++ test/behaviors/t_line_number_reporting.clj
@@ -217,3 +217,24 @@
                           pass
                           (contains {:position ["t_line_number_reporting.clj"
                                                 (+ facts-position 8)]}))))
+
+
+;; Line number reporting for variant expect arrows
+
+(def variant-position 224)
+(after-silently
+ (fact
+   (+ 1 1) =deny=> 2
+   (+ 1 1) =not=> 2
+   (+ 1 "1") =future=> "2")
+ (future-fact @reported => (just (contains {:position ["t_line_number_reporting.clj"
+                                                (+ variant-position 3)]})
+                          (contains {:position ["t_line_number_reporting.clj"
+                                                (+ variant-position 4)]})
+                          (contains {:position ["t_line_number_reporting.clj"
+                                                (+ variant-position 5)]}))))
+
+(future-fact "line-number-handling for =streams=>")
+
+
+


Tweak unit tests

Tweak unit tests

My EventPairs now inherit their 0mq Contexts transitively through the ex-sock

--- test/com/frereth/common/async_zmq_test.clj
+++ test/com/frereth/common/async_zmq_test.clj
@@ -54,10 +54,8 @@

 (defn mock-depends
   []
-  {:one {:mq-ctx :ctx
-         :ex-sock :ex-one}
-   :two {:mq-ctx :ctx
-         :ex-sock :ex-two}
+  {:one {:ex-sock :ex-one}
+   :two {:ex-sock :ex-two}
    :ex-one [:ctx]
    :ex-two [:ctx]})


Use a macro for generating proc-fns and print the resulting output.

--- src/dsbdp/experiment_helper.clj
+++ src/dsbdp/experiment_helper.clj
@@ -12,10 +12,12 @@
   dsbdp.experiment-helper
   (:require [dsbdp.byte-array-conversion :refer :all]))

-(defn create-proc-fns
+(defmacro create-proc-fns
   [fn-1 fn-n n]
   (loop [fns [fn-1]]
     (if (< (count fns) n)
       (recur (conj fns fn-n))
-      fns)))
+      (do
+        (println "proc-fns:" fns)
+        fns))))


Remove postal related example profile.

Remove postal related example profile.

--- profiles.clj
+++ profiles.clj
@@ -61,16 +61,6 @@
    :resource-paths ["examples/component-chat/resources"]
    :main ^:skip-aot compchat.core}]

- :postal-chat-example
- [:examples
-  {:source-paths ["examples/postal-chat/src/clj"
-                  "examples/postal-chat/src/cljs"]
-   :resource-paths ^:replace ["examples/postal-chat/resources"]
-   :dependencies [[funcool/postal "0.2.0"]
-                  [org.clojure/clojurescript "1.7.189"]]
-   :main ^:skip-aot compchat.core}
-  ]
-
  :debugging-example
  [:examples
   {:dependencies [[funcool/catacumba-prone "0.4.0"]]


Revert bumping 'asciidoctorj' dependency (for debugging)

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -504,7 +504,7 @@

 (def ^:private ^:deps asciidoctor-deps
   '[[org.clojure/tools.namespace "0.3.0-alpha4"]
-    [org.asciidoctor/asciidoctorj "1.6.1"]])
+    [org.asciidoctor/asciidoctorj "1.5.4"]])

 (def ^:private +asciidoctor-defaults+
   {:out-dir    "public"


Fix repetition of :out-dir when perun touches processes a file more than once

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -156,6 +156,13 @@
       (-> fileset
           (commit tmp)
           (pm/set-meta updated-metas)))))
+
+(defn apply-out-dir
+  [path old-out-dir new-out-dir]
+  (let [path-args (if (= old-out-dir new-out-dir)
+                    [path]
+                    [new-out-dir path])]
+    (apply perun/create-filepath path-args)))

 (defn render-in-pod
   "Renders paths in `inputs`, using `render-form-fn` in `pod`
@@ -300,11 +307,10 @@
   (let [global-meta (pm/get-global-meta fileset)]
     (reduce (fn [result {:keys [path] :as entry}]
               (let [ext-pattern (re-pattern (str "(" (string/join "|" extensions) ")$"))
-                    new-path (if out-ext
-                               (->> out-ext
-                                    (string/replace path ext-pattern)
-                                    (perun/create-filepath out-dir))
-                               (perun/create-filepath out-dir path))
+                    ext-path (if out-ext
+                               (string/replace path ext-pattern out-ext)
+                               path)
+                    new-path (apply-out-dir ext-path (:out-dir entry) out-dir)
                     path-meta (pm/path-meta path
                                             global-meta
                                             (boot/tmp-file (boot/tmp-get fileset path)))]
@@ -802,20 +808,17 @@
    e extensions EXTENSIONS [str] "extensions of files to include"
    r renderer   RENDERER   sym   "page renderer (fully qualified symbol which resolves to a function)"
    m meta       META       edn   "metadata to set on each entry"]
-  (let [{:keys [renderer] :as options} (merge +render-defaults+ *opts*)]
+  (let [{:keys [renderer out-dir] :as options} (merge +render-defaults+ *opts*)]
     (letfn [(render-paths [fileset]
               (let [entries (filter-meta-by-ext fileset options)]
                 (reduce
-                 (fn [result {:keys [out-dir filename path] :as entry}]
+                 (fn [result {:keys [path] :as entry}]
                    (let [content (slurp (boot/tmp-file (boot/tmp-get fileset path)))
-                         path-args (if (= out-dir (:out-dir options)) ;; if custom out-dir we cannot rely on pre-built :path
-                                     [path]
-                                     [out-dir (:out-dir options) filename])
-                         new-path (apply perun/create-filepath path-args)
+                         new-path (apply-out-dir path (:out-dir entry) out-dir)
                          new-entry (merge entry
                                           meta
                                           {:content content
-                                           :out-dir (:out-dir options)})]
+                                           :out-dir out-dir})]
                      (assoc result new-path {:meta    (pm/get-global-meta fileset)
                                              :entries entries
                                              :entry   new-entry
@@ -848,7 +851,7 @@
         path (perun/create-filepath out-dir page)
         static-path (fn [fileset]
                       {path {:meta (pm/get-global-meta fileset)
-                             :entry (assoc meta :path path)}})]
+                             :entry (assoc meta :path path :out-dir out-dir)}})]
     (render-task {:task-name "static"
                   :paths-fn static-path
                   :renderer renderer
@@ -869,7 +872,7 @@
                                                            (boot/tmp-get fileset)
                                                            boot/tmp-file
                                                            slurp))))
-               new-path  (perun/create-filepath out-dir path)
+               new-path  (apply-out-dir path (:out-dir entry) out-dir)
                new-entry (merge entry
                                 {:out-dir out-dir}
                                 (pm/path-meta path global-meta))]


Use a files name as its title if one is not in parse-meta.

--- src/incise/parsers/html.clj
+++ src/incise/parsers/html.clj
@@ -2,7 +2,8 @@
   "Provides a function, html-parser, to create what could be considered the
    standard parser from a function which takes the body of a file as a string
    and returns html."
-  (:require (incise.parsers [utils :refer [meta->write-path]]
+  (:require (incise.parsers [utils :refer [meta->write-path
+                                           name-without-extension]]
                             [parse :refer [map->Parse
                                            record-parse
                                            publish-parse?]])
@@ -41,6 +42,9 @@
   (let [file-str (slurp file)
         parse-meta (merge (conf/get :parse-defaults)
                           (edn/read-string file-str))
+        parse-meta (if (contains? parse-meta :title)
+                     parse-meta
+                     (assoc parse-meta :title (name-without-extension file)))
         content (content-fn (second (s/split file-str #"\}" 2)))]
     (meta-and-content->Parse parse-meta content)))

@@ -62,9 +66,9 @@
   as html to the proper place under public. If it is a page it should appear at
   the root, if it is a post it will be placed under a directory strucutre based
   on its date."
-  [to-html]
+  [parser-fn]
   (fn [file]
-    (let [parse (File->Parse to-html file)]
+    (let [parse (File->Parse parser-fn file)]
       (when (publish-parse? parse)
         (record-parse (.getCanonicalPath file) parse)
         (delay [(write-Parse parse)])))))


More merge issues.

More merge issues.

--- src/jobless_clj/example.clj
+++ src/jobless_clj/example.clj
@@ -68,25 +68,6 @@
      (bulletin "Created and gave presentations on coding and development.")
      (bulletin "Helped to maintain a \"Code Club\" to expand interest in learning new programming languages.")
      (start-date "July 2009")
-     (end-date "August 2010")))
-   (education
-    (entry
-     (title "B.A. Computer Science")
-     (company "University of California, San Diego")
-     (start-date "2000")
-     (end-date "2004")))
-   (other-exp
-    (entry
-     (title "JokeBot")
-     (homepage "https://github.com/jbristow/JokeBot")
-     (description "Silly fortune file markov chain generator."))
-    (entry
-     (title "bgg-shelve")
-     (homepage "https://github.com/jbristow/bgg-shelve")
-     (description "Naiively optimizes your board games on a shelf."))
-    (entry
-     (title "StackOverflow")
-     (homepage "http://stackoverflow.com/users/113332/jbristow")))))
      (end-date "August 2010"))
     (entry
      (title "Software Engineer")


Fixing persistence

Fixing persistence

--- src/helda/listeners/invoker.clj
+++ src/helda/listeners/invoker.clj
@@ -2,7 +2,7 @@
   (:require
     [clj-http.client :as client]
     [helda.storages.entity-listeners :refer [find-listeners-by-entity-id]]
-    [helda.storages.entities :refer [find-entity-by-id]]
+    [helda.storages.entities :refer [find-entity-by-id save-entity]]
     )
   )


CLJS upgrade

CLJS upgrade

--- build.boot
+++ build.boot
@@ -46,7 +46,7 @@
    [reloaded.repl "0.2.3" :scope "test"]

    [org.clojure/clojure "1.9.0-alpha17"]
-   [org.clojure/clojurescript "1.9.660"]
+   [org.clojure/clojurescript "1.9.946"]

    [org.clojure/tools.nrepl "0.2.13"]


Use boot-cljx release-version

Use boot-cljx release-version

--- build.boot
+++ build.boot
@@ -13,7 +13,7 @@
   :dependencies '[[adzerk/boot-cljs       "0.0-2411-5"]
                   [adzerk/boot-cljs-repl  "0.1.7"]
                   [adzerk/boot-reload     "0.2.0"]
-                  [deraen/boot-cljx       "0.5.0-SNAPSHOT"]
+                  [deraen/boot-cljx       "0.2.0"]
                   [deraen/boot-less       "0.1.0-SNAPSHOT"]

                   [org.clojure/clojure "1.6.0"]


build boot for local decelopment

build boot for local decelopment

--- build.boot
+++ build.boot
@@ -3,21 +3,56 @@

 (set-env! :resource-paths #{"resources" "src"}
           :source-paths   #{"test"}
-          :dependencies   '[[org.clojure/clojure "RELEASE"]
-                            [adzerk/boot-test "RELEASE" :scope "test"]])
+          :dependencies '[[adzerk/boot-cljs           "1.7.228-1"  :scope "test"]
+                          [adzerk/boot-cljs-repl      "0.3.0"      :scope "test"]
+                          [adzerk/boot-reload         "0.4.8"      :scope "test"]
+                          [pandeiro/boot-http         "0.7.2"      :scope "test"]
+                          [com.cemerick/piggieback    "0.2.1"      :scope "test"]
+                          [org.clojure/tools.nrepl    "0.2.12"     :scope "test"]
+                          [weasel                     "0.7.0"      :scope "test"]
+                          [org.clojure/clojurescript "1.7.228"]
+                          [org.clojure/core.async "0.1.346.0-17112a-alpha"]
+                          [binaryage/devtools "0.6.1"]
+                          [reagent "0.6.0-rc"]])

 (task-options!
  pom {:project     project
       :version     version
-      :description "FIXME: write description"
-      :url         "http://example/FIXME"
-      :scm         {:url "https://github.com/yourname/cljs-dnd"}
+      :description "Idiomatic drag-and-drop for ClojureScript applications with React rendering."
+      ; :url         "http://example/FIXME"
+      :scm         {:url "https://github.com/olegakbarov/cljs-dnd"}
       :license     {"Eclipse Public License"
                     "http://www.eclipse.org/legal/epl-v10.html"}})
+
+(require
+ '[adzerk.boot-cljs      :refer [cljs]]
+ '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
+ '[adzerk.boot-reload    :refer [reload]]
+ '[pandeiro.boot-http    :refer [serve]])
+

 (deftask build
   "Build and install the project locally."
   []
-  (comp (pom) (jar) (install)))
+  (comp (pom)
+        (jar)
+        (install)))

-(require '[adzerk.boot-test :refer [test]])
+(deftask run []
+  (comp (serve)
+        (watch)
+        (cljs-repl)
+        (reload)
+        (cljs)))
+
+(deftask development []
+  ;; should run examples
+  (task-options! cljs   {:optimizations :none :source-map true}
+                 reload {:on-jsload 'examples.sort/mount-root})
+  identity)
+
+(deftask dev
+  "Simple alias to run application in development mode"
+  []
+  (comp (development)
+        (run)))


Upgrade to the latest and greatest boot-junit

--- build.boot
+++ build.boot
@@ -1,7 +1,7 @@
 (set-env!
  :resource-paths #{"resources"}
  :source-paths #{"src"}
- :dependencies '[[radicalzephyr/boot-junit "0.2.1"  :scope "test"]
+ :dependencies '[[radicalzephyr/boot-junit "0.4.0-SNAPSHOT"  :scope "test"]
                  [junit                    "4.12"   :scope "test"]])

 (def +version+ "0.1.0-SNAPSHOT")
@@ -21,7 +21,7 @@
       :licens {"MIT" "http://opensource.org/licenses/MIT"}}
  sift {:invert true
        :include #{#"\.java$"}}
- junit {:classes #{"UnitTests"}})
+ junit {:class-names #{"UnitTests"}})

 ;;; This prevents a name collision WARNING between the test task and
 ;;; clojure.core/test, a function that nobody really uses or cares


filter out stuff

filter out stuff

--- build.boot
+++ build.boot
@@ -43,7 +43,8 @@
         (cljs :source-map true
               :optimizations :none
               :unified-mode true)
-        (less :source-map true)))
+        (less :source-map true)
+        (sift :exclude #{"\\.less$"})))

 (deftask prod
   "Compile production version"
@@ -54,4 +55,5 @@
                  :profile :production)
     (cljs :source-map false
           :optimizations :advanced)
-    (less :compression true)))
+    (less :compression true)
+    (sift :exclude #{"\\.less$" "^cljsjs/"})))


remove some unused deps

remove some unused deps

--- build.boot
+++ build.boot
@@ -2,9 +2,7 @@
   :source-paths #{"src"}
   :resource-paths #{"resources" "guides"}
   :dependencies '[[hiccup "1.0.5"]
-                  [clj-time "0.9.0"]
                   [perun "0.3.0"]
-                  ;; [hashobject/boot-s3 "0.1.2-SNAPSHOT"]
                   [confetti "0.1.2-SNAPSHOT"]
                   [deraen/boot-sass "0.2.1"]
                   [pandeiro/boot-http "0.7.3"]
@@ -14,7 +12,6 @@
          '[deraen.boot-sass :refer [sass]]
          '[pandeiro.boot-http :refer [serve]]
          '[confetti.boot-confetti :refer [create-site sync-bucket]]
-         ;; '[hashobject.boot-s3 :refer :all]
          '[org.martinklepsch.boot-gzip :refer [gzip]])

 (task-options!


Specify test scope for junit dependency

Specify test scope for junit dependency

--- build.boot
+++ build.boot
@@ -1,9 +1,9 @@
 (set-env!
  :source-paths #{"src"}
  :resource-paths #{"src"}
- :dependencies '[[org.clojure/clojure     "1.6.0"  :scope "provided"]
-                 [boot/core               "2.1.0"  :scope "provided"]
-                 [junit                   "4.12"]
+ :dependencies '[[org.clojure/clojure     "1.6.0" :scope "provided"]
+                 [boot/core               "2.1.0" :scope "provided"]
+                 [junit                   "4.12"  :scope "test"]
                  [radicalzephyr/bootlaces "0.1.12"]])

 (require '[radicalzephyr.bootlaces :refer :all]


docstrings

docstrings

--- src/open_company/resources/company.clj
+++ src/open_company/resources/company.clj
@@ -95,7 +95,10 @@
   {:pre [(string? slug)]}
   (common/read-resource table-name slug))

-(defn placeholder-sections [company-slug]
+(defn placeholder-sections
+  "Return a map of section-name -> section containing all
+   placeholder sections in sections.json"
+  [company-slug]
   (reduce (fn [s sec]
             (assoc s
                    (-> sec :name keyword)
@@ -114,10 +117,14 @@

 ;; ----- Create saveable company doc ----

-(defn real-sections [company]
+(defn real-sections
+  "Select all non-placeholder sections from a company map"
+  [company]
   (med/remove-vals :placeholder (select-keys company common/section-names)))

 (defn complete-real-sections
+  "For each non-placeholder section in the company add an author,
+   the company's slug and the section name"
   [company user]
   (let [rs (real-sections company)
         add-info (fn [[k section-data]]
@@ -128,6 +135,7 @@
     (merge company (into {} (map add-info rs)))))

 (s/defn ->company :- common/Company
+  "Take a minimal map describing a company and a user and 'fill the blanks'"
   [company-props user]
   (let [slug (or (:slug company-props) (slug/find-available-slug (:name company-props) (taken-slugs)))]
     (-> company-props
@@ -140,16 +148,19 @@

 (s/defn add-updated-at
   [{:keys [section-name] :as section} :- common/Section ts]
+  "Add `:updated-at` key with `ts` as value to a given section.
+   If the sectino has a `:notes` key also add the timestamp there."
   (let [notes-section? (contains? common/notes-sections section-name)]
     (cond-> (assoc section :updated-at ts)
       (and notes-section? (:notes section)) (assoc-in [:notes :updated-at] ts))))

 (s/defn create-company!
   [company :- common/Company]
+  "Create a company document in RethinkDB. Add `updated-at` keys where necessary."
   (s/validate common/Company company) ; throw if invalid
-  (let [real-sections     (real-sections company)
-        ts                (common/current-timestamp)
-        rs-w-ts           (med/map-vals #(add-updated-at % ts) real-sections)]
+  (let [real-sections (real-sections company)
+        ts (common/current-timestamp)
+        rs-w-ts (med/map-vals #(add-updated-at % ts) real-sections)]
     (doseq [[_ section] real-sections]
       (common/create-resource common/section-table-name section ts))
     (common/create-resource table-name (merge company rs-w-ts) ts)))


Updated PAMELA version to 0.4.2

Updated PAMELA version to 0.4.2

Signed-off-by: Tom Marble <b248307e886b80bf9cb4014595572a835b049bf4@info9.net>

--- src/main/clj/pamela/cli.clj
+++ src/main/clj/pamela/cli.clj
@@ -310,7 +310,7 @@
 (defn pamela
   "PAMELA command line processor. (see usage for help)."
   {:added "0.2.0"
-   :version "0.4.1"}
+   :version "0.4.2"}
   [& args]
   (when (and (:pamela-version env)
           (not= (:pamela-version env) (:version (meta #'pamela))))


Ensure ugen arg docstrings don't lose order

--- src/overtone/sc/machinery/ugen/doc.clj
+++ src/overtone/sc/machinery/ugen/doc.clj
@@ -29,7 +29,8 @@
   [spec]
   (let [args (:args spec)
         name:doc (fn [arg] [(or (:name arg) "NAME MISSING!")  (or (capitalize (:doc arg)) "DOC MISSING!")])
-        doc-map (into {} (map name:doc args))
+        arg-doc (map name:doc args)
+        doc-map (into {} arg-doc)
         arg-max-key-len (length-of-longest-key doc-map)
         indentation (+ 5 arg-max-key-len)]
     (apply str (map (fn [[name docs]]
@@ -39,7 +40,7 @@
                            "- "
                            (indented-str-block docs DOC-WIDTH indentation)
                            "\n"))
-                    doc-map))))
+                    arg-doc))))

 (defn- full-doc-str
   "Returns a string representing the full documentation for the given ugen spec"


mistakenly public var is now private

mistakenly public var is now private

--- src/midje/ideas/tabular.clj
+++ src/midje/ideas/tabular.clj
@@ -40,7 +40,7 @@
        (not (resolve s))
        (not ((set locals) s))))

-(defn headings-rows+values [table locals]
+(defn- headings-rows+values [table locals]
   (split-with (partial table-variable? locals) (remove-pipes+where table)))

 (defn- table-binding-maps [table locals]


add back source-tree generation to hide in ref template comment

--- src/main/cljs_api_gen/write.clj
+++ src/main/cljs_api_gen/write.clj
@@ -333,12 +333,15 @@
                    crumb)))
           crumbs)))))

-(defn add-source-trees
+(defn add-source-extras
   [item]
-  (let [add-tree #(when % (assoc % :path-tree (source-path %)))]
+  (let [add-extras #(when %
+                      (-> %
+                          (assoc :path-tree (source-path %)
+                                 :github-link (github-src-href %))))]
     (-> item
-        (update-in [:source] add-tree)
-        (update-in [:extra-sources] #(map add-tree %)))))
+        (update-in [:source] add-extras)
+        (update-in [:extra-sources] #(map add-extras %)))))

 (defn add-source-links
   [item]
@@ -397,8 +400,7 @@
       (add-external-doc-links)
       (add-syntax-usage)
       (add-related-links)
-      #_(add-source-trees)
-      (add-source-links)
+      (add-source-extras)
       (resolve-all-reflinks)))

 (defn dump-ref-file!


Validate peer-config in submit-job.

Validate peer-config in submit-job.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -102,6 +102,7 @@
     (create-log-entry :submit-job args)))

 (defn ^{:added "0.6.0"} submit-job [config job]
+  (validator/validate-peer-config config)
   (let [id (java.util.UUID/randomUUID)
         _ (validator/validate-job (assoc job :workflow (:workflow job)))
         _ (validator/validate-flow-conditions (:flow-conditions job) (:workflow job))


tidying up imports

tidying up imports

--- src/neo4j_meetup/meetup.clj
+++ src/neo4j_meetup/meetup.clj
@@ -1,21 +1,6 @@
 (ns neo4j-meetup.meetup
-  (:require [clj-http.client :as client])
-  (:require [clojure.data.json :as json])
-  (:require [environ.core :as e])
-  (:require [clj-time.core :as t])
-  (:require [clj-time.coerce :as c])
-  (:require [clj-time.format :as f])
   (:require [neo4j-meetup.db :as db]
-            [neo4j-meetup.timestamp :as timestamp])
-  (:require [clojurewerkz.neocons.rest :as nr]
-            [clojurewerkz.neocons.rest.transaction :as tx]))
-
-(defn day-suffix [day]
-  (let [stripped-day (if (< day 20) day (mod day 10))]
-    (cond (= stripped-day 1) "st"
-          (= stripped-day 2) "nd"
-          (= stripped-day 3) "rd"
-          :else "th")))
+            [neo4j-meetup.timestamp :as timestamp]))

 (defn extract-date-time [timestamp]
   { :formatted-time (timestamp/as-time timestamp)


Write timer triggers to the log.

Write timer triggers to the log.

--- src/onyx/triggers/timer.clj
+++ src/onyx/triggers/timer.clj
@@ -2,12 +2,13 @@
   (:require [onyx.windowing.units :refer [to-standard-units standard-units-for]]
             [onyx.windowing.window-id :as wid]
             [onyx.triggers.triggers-api :as api]
+            [onyx.state.state-extensions :as state-extensions]
             [onyx.peer.operation :refer [kw->fn]]
             [onyx.static.planning :refer [find-window]]
             [taoensso.timbre :refer [fatal]]))

 (defmethod api/trigger-setup :timer
-  [{:keys [onyx.core/window-state] :as event} trigger]
+  [{:keys [onyx.core/window-state onyx.core/state-log] :as event} trigger]
   (if (= (standard-units-for (second (:trigger/period trigger))) :milliseconds)
     (let [ms (apply to-standard-units (:trigger/period trigger))
           fut
@@ -15,7 +16,12 @@
             (loop []
               (try
                 (Thread/sleep ms)
-                (api/fire-trigger! event window-state trigger {:context :timer})
+                (let [state (get (:state @window-state) (:trigger/window-id trigger))]
+                  (api/fire-trigger! event window-state trigger {:context :timer})
+                  (when (and state (api/refinement-destructive? event trigger))
+                    ;; Write the trigger to the log.
+                    (let [entry [nil [nil (map (fn [[k v]] [k nil]) state)]]]
+                      (state-extensions/store-log-entry state-log event (constantly true) entry))))
                 (catch InterruptedException e
                   (throw e))
                 (catch Throwable e


Reenable embedded driver

Reenable embedded driver

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -93,7 +93,7 @@
                      :onyx/id id
                      :onyx.messaging/bind-addr (slurp "http://169.254.169.254/latest/meta-data/local-ipv4")
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
-                     :onyx.messaging.aeron/embedded-driver? false
+                     ;:onyx.messaging.aeron/embedded-driver? false
                      :onyx.peer/join-failure-back-off 500
                      :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
                      :onyx.messaging/impl (keyword messaging)


Try lower inbox capacity for backpressure

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -14,6 +14,7 @@
   {:core.async/chan (chan (dropping-buffer 1))})

 (def counter (atom 0))
+(def retry-counter (atom 0))

 (defn close-batch-inc
   [event _]
@@ -22,7 +23,8 @@

 (defn inject-state
   [event _]
-  {:bench/state counter})
+  {:retry-counter retry-counter
+   :bench/state counter})

 (def no-op-calls
   {:lifecycle/before-task inject-no-op-ch})
@@ -38,9 +40,12 @@
       (try
         (loop []
           (Thread/sleep 1000)
-          (let [cnt @counter]
-            (reset! counter 0)
+          (let [cnt @counter
+                _ (reset! counter 0)
+                retry-cnt @retry-counter
+                _ (reset! retry-counter)]
             (info "-> " cnt " <-")
+            (r/send-event client {:service "onyx-retry" :state "ok" :metric retry-cnt :tags ["benchmark"]})
             (r/send-event client {:service "onyx" :state "ok" :metric cnt :tags ["benchmark"]}))
           (recur))
         (catch Exception e
@@ -73,6 +78,7 @@
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
                      :onyx.peer/join-failure-back-off 500
                      :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
+                     :onyx.peer/inbox-capacity 100
                      :onyx.messaging/impl :netty
                      :onyx.log/config logging-config}
         n-peers-parsed (Integer/parseInt n-peers)


(PDB-1852) Explicitly use the v5 report format for anonymization

This commit changes the anonymization to use the v5 report format for
schema validation, because the anonymization tool operates on the output
of the `reports` endpoint not on the wire-format which was updated in a
previous commit.

--- src/puppetlabs/puppetdb/anonymizer.clj
+++ src/puppetlabs/puppetdb/anonymizer.clj
@@ -21,7 +21,7 @@
 (def resource-event-schema-str (utils/str-schema reports/resource-event-v5-wireformat-schema))
 (def metric-schema-str (utils/str-schema reports/metric-wireformat-schema))
 (def log-schema-str (utils/str-schema reports/log-wireformat-schema))
-(def report-schema-str (utils/str-schema (assoc reports/report-wireformat-schema
+(def report-schema-str (utils/str-schema (assoc reports/report-v5-wireformat-schema
                                            :resource_events [resource-event-schema-str]
                                            :metrics (s/maybe [metric-schema-str])
                                            :logs (s/maybe [log-schema-str]))))


Add storage.timeout to info model ordering.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -1983,6 +1983,7 @@
     :onyx.peer/inbox-capacity
     :onyx.peer/outbox-capacity
     :onyx.peer/storage
+    :onyx.peer/storage.timeout
     :onyx.peer/storage.s3.auth-type
     :onyx.peer/storage.s3.auth.access-key
     :onyx.peer/storage.s3.auth.secret-key


Blank out HTTP kit ns.

Blank out HTTP kit ns.

--- src/onyx/messaging/http_kit.clj
+++ src/onyx/messaging/http_kit.clj
@@ -0,0 +1,2 @@
+(ns ^:no-doc onyx.messaging.http-kit)
+


Add debugging

Add debugging

--- talkpocket-api/src/talkpocket_api/storage/cassandra.clj
+++ talkpocket-api/src/talkpocket_api/storage/cassandra.clj
@@ -35,6 +35,7 @@
 (defn- update-article-state
   [id new-state]
   (alia/execute session "USE talkpocket;")
+  (println new-stat)
   (alia/execute session @update-entry-state-prepared {:values [id (int new-stat)]}))

 (defn- get-entry


Allow to specify minimum bytes and maximum wait for simple consumer API

When requesting new messages with the simple consumer API and message is
available, by default, the call to `messages` will return immediatly. If
called in a loop to wait for new messages, a user will have to sleep
between each call to avoid a tight loop, increasing the latency. The
Java API exposes the ability to wait for a minimum of bytes and a
maximum of time before returning no record. We expose those knobs in
`fetch-request` and `messages`.

--- src/clj_kafka/consumer/simple.clj
+++ src/clj_kafka/consumer/simple.clj
@@ -16,14 +16,16 @@
                    client-id))

 (defn fetch-request
-  [client-id topic ^Long partition offset fetch-size]
+  [client-id topic ^Long partition offset fetch-size & {:keys [max-wait min-bytes]}]
   (.build (doto (FetchRequestBuilder. )
             (.clientId client-id)
-            (.addFetch topic (Integer/valueOf partition) offset fetch-size))))
+            (.addFetch topic (Integer/valueOf partition) offset fetch-size)
+            (#(when max-wait (.maxWait % max-wait)))
+            (#(when min-bytes (.minBytes % min-bytes))))))

 (defn messages
-  [^SimpleConsumer consumer client-id topic partition offset fetch-size]
-  (let [fetch (fetch-request client-id topic partition offset fetch-size)]
+  [^SimpleConsumer consumer client-id topic partition offset fetch-size & more]
+  (let [fetch (apply fetch-request client-id topic partition offset fetch-size more)]
     (map to-clojure (iterator-seq (.iterator (.messageSet ^FetchResponse (.fetch consumer ^FetchRequest fetch)
                                                           topic
                                                           partition))))))


bump datomic version

bump datomic version

--- joplin.datomic/project.clj
+++ joplin.datomic/project.clj
@@ -6,5 +6,5 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [com.datomic/datomic-free "0.9.4899"]
+                 [com.datomic/datomic-free "0.9.5078"]
                  [joplin.core "0.2.3-SNAPSHOT"]])


Message queue: Add worker :eoq-backoff-ms fn support

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -17,6 +17,19 @@
   (:require [clojure.string   :as str]
             [taoensso.carmine :as car :refer (wcar)]
             [taoensso.timbre  :as timbre]))
+
+;;;; Public utils
+
+(defn exp-backoff "Returns binary exponential backoff value."
+  [attempt & [{:keys [factor min max]
+               :or   {factor 2000}}]]
+  (let [binary-exp (Math/pow 2 (dec attempt))
+        time (* (+ binary-exp (rand binary-exp)) 0.5 factor)]
+    (long (let [time (if min (clojure.core/max min time) time)
+                time (if max (clojure.core/min max time) time)]
+            time))))
+
+(comment (map #(exp-backoff % {}) (range 10)))

 ;;;; Implementation

@@ -165,12 +178,13 @@

 (defprotocol IWorker (start [this]) (stop [this]))

-(defrecord Worker [conn qname running? opts]
+(defrecord Worker [conn qname running? dry-runs opts]
   IWorker
   (stop  [_] (let [stopped? @running?] (reset! running? false) stopped?))
   (start [_]
     (when-not @running?
       (reset! running? true)
+      (reset! dry-runs 0)
       (future
         (let [{:keys [handler throttle-ms eoq-backoff-ms]} opts
               qk    (partial qkey qname)
@@ -187,20 +201,25 @@

           (while @running?
             (try
-              (when-let [[mid mcontent attempt :as poll-reply]
-                         (wcar conn (dequeue qname opts))]
-                (if (= poll-reply "eoq-backoff")
-                  (when eoq-backoff-ms (Thread/sleep eoq-backoff-ms))
-                  (let [{:keys [status throwable backoff-ms]}
-                        (try (handler {:message mcontent :attempt attempt})
-                             (catch Throwable t {:status :error
-                                                 :throwable t}))]
-                    (case status
-                      :success (done mid)
-                      :retry   (retry mid backoff-ms)
-                      :error   (error mid poll-reply throwable)
-                      (do (done mid)
-                          (timbre/warn (str "Invalid handler status:" status)))))))
+              (let [eoq-backoff-ms* (if (fn? eoq-backoff-ms)
+                                      (eoq-backoff-ms (swap! dry-runs inc))
+                                      eoq-backoff-ms)
+                    opts* (assoc opts :eoq-backoff-ms eoq-backoff-ms*)]
+                (when-let [[mid mcontent attempt :as poll-reply]
+                           (wcar conn (dequeue qname opts*))]
+                  (if (= poll-reply "eoq-backoff")
+                    (when eoq-backoff-ms* (Thread/sleep eoq-backoff-ms*))
+                    (let [{:keys [status throwable backoff-ms]}
+                          (try (handler {:message mcontent :attempt attempt})
+                               (catch Throwable t {:status :error
+                                                   :throwable t}))]
+                      (reset! dry-runs 0)
+                      (case status
+                        :success (done mid)
+                        :retry   (retry mid backoff-ms)
+                        :error   (error mid poll-reply throwable)
+                        (do (done mid)
+                            (timbre/warn (str "Invalid handler status:" status))))))))
               (catch Throwable t
                 (timbre/error t "FATAL worker error!")
                 (throw t)))
@@ -221,7 +240,8 @@
                      considered fatally stalled and message re-queued. Must be
                      sufficiently high to prevent double handling.
    :eoq-backoff-ms - Thread sleep period each time end of queue is reached.
-                     Synchronized between all queue workers.
+                     Can be a (fn [dry-run-count]) => ms. Sleep synchronized
+                     between all queue workers.
    :throttle-ms    - Thread sleep period between each poll."
   [conn qname & [{:keys [handler lock-ms eoq-backoff-ms throttle-ms auto-start?]
                   :or   {handler (fn [{:keys [message attempt]}]
@@ -229,35 +249,21 @@
                                    {:status :success})
                          lock-ms        (* 60 60 1000)
                          throttle-ms    200
-                         eoq-backoff-ms 2000
-                         lock-ms (* 60 60 1000)
-                         auto-start? true}}]]
-  (let [w (Worker. conn qname (atom false) {:handler        handler
-                                            :lock-ms        lock-ms
-                                            :throttle-ms    throttle-ms
-                                            :eoq-backoff-ms eoq-backoff-ms
-                                            :auto-start?    auto-start?})]
-    (when auto-start? (start w))
-    w))
+                         eoq-backoff-ms (fn [dry-runs] (exp-backoff dry-runs
+                                                        {:max 10000}))
+                         auto-start?    true}}]]
+  (let [w (Worker. conn qname (atom false) (atom 0)
+                   {:handler        handler
+                    :lock-ms        lock-ms
+                    :throttle-ms    throttle-ms
+                    :eoq-backoff-ms eoq-backoff-ms})]
+    (when auto-start? (start w)) w))

 (comment
   (def w1 (worker {} "myq"))
   (wcar {} (enqueue "myq" "msg"))
   (stop w1)
   (queue-status {} "myq"))
-
-;;;; Public utils
-
-(defn exp-backoff "Exponential backoff msecs. Useful for retries."
-  [attempt & [{:keys [factor min max]
-               :or   {factor 2000}}]]
-  (let [binary-exp (Math/pow 2 (dec attempt))
-        time (* (+ binary-exp (rand binary-exp)) 0.5 factor)]
-    (long (let [time (if min (clojure.core/max min time) time)
-                time (if max (clojure.core/min max time) time)]
-            time))))
-
-(comment (map #(exp-backoff % {}) (range 10)))

 ;;;; Renamed/deprecated


[#135] mq workers use 2 conns, only need 1

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -191,8 +191,8 @@
                  (car/atomic conn-opts 100
                    (car/watch (qk :requeue))
                    (let [requeue?
-                         (wcar conn-opts (->> (car/sismember (qk :requeue) mid)
-                                              (car/parse-bool)))
+                         (car/with-replies (->> (car/sismember (qk :requeue) mid)
+                                                (car/parse-bool)))
                          status (if (and (= status :success) requeue?)
                                   :requeue status)]
                      (car/multi)


Allow for spaces in wonko property names.

--- src/wonko/export/prometheus/create.clj
+++ src/wonko/export/prometheus/create.clj
@@ -12,8 +12,7 @@
 (defn ->prometheus-name [metric-name]
   (-> metric-name
       name
-      (s/replace #"-" "_")
-      (s/replace #"/" "_")))
+      (s/replace #"[-/ ]" "_")))

 (defn maybe-set-label-names [metric label-names]
   (if (seq label-names)


catch morphological exceptions for development purposes

--- src/babel/forest.clj
+++ src/babel/forest.clj
@@ -19,6 +19,17 @@

 (declare lightning-bolt)
 (declare generate-all)
+
+(defn wrapped-morph [morph-fn structure]
+  (if morph-fn
+    (try (let [result (morph-fn structure)]
+           result)
+         (catch Exception e
+           (do
+             (log/warn (str "ignoring exception: " e " and returning canonical form instead."))
+             (strip-refs (get-in structure [:espanol])))))
+    ;; TODO: consider throwing exception here.
+    "(morph-fn is null)"))

 (defn generate [spec grammar lexicon index morph]
   (first (take 1 (generate-all spec grammar lexicon index morph))))
@@ -99,8 +110,7 @@
                         (let [result (over/overh parent (lazy-shuffle (get-lex parent :head index spec)) morph)]
                           (log/debug (str "results of attaching lexemes to: " (get-in parent [:rule]) ": (size=" (if result (.size result) "0") ")"
                                           (string/join ","
-                                                       (map #(if morph (morph %1)
-                                                                 "(string)")
+                                                       (map #(wrapped-morph morph %1)
                                                             result))))
                           result)))
                     candidate-parents)
@@ -122,7 +132,14 @@
                                           (string/join ","
                                            (map (fn [child]
                                                   (str "[" (:rule child) "]"
-                                                       "'" (morph child) "'"
+                                                       "'"
+
+                                                       (try
+                                                         (morph child)
+                                                         (catch Exception e
+                                                           "(exception caught)"))
+
+                                                       "'"
                                                        ))
                                                 phrasal-children))))
                           (over/overh parent phrasal-children morph)))
@@ -173,7 +190,7 @@
               (filter (fn [result]
                         (not (fail? result)))
                       (map (fn [complement]
-                             (let [debug (log/debug (str "Trying complement:" (morph complement)))
+                             (let [debug (log/trace (str "Trying complement:" (morph complement)))
                                    result
                                    (unifyc bolt
                                            (path-to-map path
@@ -205,13 +222,18 @@
                                ". Complements tried were: " (morph complement-candidate-lexemes)))

                 ;; TODO: show warn about not finding any phrasal complements, as well as not finding any lexical complements.
-                (log/debug (str " fail-paths:"))
                 (vec (map (fn [lexeme]
                             (log/debug (str " path in bolt: " path))
-                            (log/debug (str " value of bolt at path: " (get-in bolt path)))
-                            (log/debug (str " value of gender at path: " (get-in bolt (concat path [:synsem :agr :gender])))))
+                            (log/debug (str " cat@" path " = " (strip-refs (get-in bolt (concat path [:synsem :cat])))))
+                            (log/trace (str " sem@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem])))))
+                            (log/debug (str " pred@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem :pred])))))
+                            (log/debug (str " agr@" path " = " (strip-refs (get-in bolt (concat path [:synsem :agr]))))))
                           complement-candidate-lexemes))))
-            (do (log/debug (str "add-complement after adding complement: " (morph return-val)))
+            (do (log/debug (str "add-complement after adding complement: "
+                                (try
+                                  (morph return-val)
+                                  (catch Exception e
+                                    "(exception caught)"))))
                 return-val))))

       ;; path doesn't exist in bolt: simply return the bolt unmodified.


Rescale canvas in Hi DPI scenarios to avoid blurriness.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -36,32 +36,44 @@
 (defonce window-width
   (reagent/atom nil))

+(defn- setup-canvas [ canvas width height ]
+  (let [dpr (or  (.-devicePixelRatio js/window) 1)
+        ctx (.getContext canvas "2d")]
+
+    (aset canvas "width" (* dpr width))
+    (aset canvas "height" (* dpr height))
+    (aset (.-style canvas) "width" (str width "px"))
+    (aset (.-style canvas) "height" (str height "px"))
+    (.scale ctx dpr dpr)))
+
 (defn series-tsplot-view [ series series-data series-range ]
-  (let [dom-node (reagent/atom nil)]
+  (let [ dom-node (reagent/atom nil)]
     (reagent/create-class
      {:display-name (str "series-tsplot-view-" series)
+
+      :component-did-mount
+      (fn [ this ]
+        (reset! dom-node (reagent/dom-node this)))

       :component-did-update
       (fn [ this _ ]
         (let [[ _ _ series-data series-range ] (reagent/argv this)
               canvas (.-firstChild @dom-node)
               ctx (.getContext canvas "2d")]
+          (setup-canvas canvas (.-clientWidth @dom-node) (.-clientHeight @dom-node))
           (tsplot/draw ctx (.-clientWidth canvas) (.-clientHeight canvas)
                        (:series-points series-data)
                        (:begin-t series-range)
                        (:end-t series-range))))
-
-      :component-did-mount
-      (fn [ this ]
-        (reset! dom-node (reagent/dom-node this)))

-      :reagent-render
-      (fn [ series series-data series-range ]
-        @window-width
-        [:div
-         [:canvas (if-let [ node @dom-node ]
-                    {:width (.-clientWidth node)
-                     :height (.-clientHeight node)})]])})))
+      :render
+      (fn [ this]
+        (let  [[ series series-data series-range ] (reagent/argv this)]
+          @window-width
+          [:div
+           [:canvas (if-let [ node @dom-node]
+                      {:width (.-clientWidth node)
+                       :height (.-clientHeight node)})]]))})))

 (defn series-tsplot [ series-name current-time query-window ]
   (let [series-data (reagent/atom [])
@@ -133,7 +145,7 @@
 (defn on-window-resize [ evt ]
   (reset! window-width (.-innerWidth js/window)))

-(log/set-configuration! {"" :debug })
+(log/set-configuration! {"" :info})

 (defn update-current-time []
   (let [t (time/now)]


Correct display of aligned text.

Correct display of aligned text.

--- metlog-vault/src-client/metlog_client/tsplot.cljs
+++ metlog-vault/src-client/metlog_client/tsplot.cljs
@@ -25,6 +25,12 @@
             (map #(* % (.pow js/Math 10 scale))
                  [ 1 2 5 ]))
           (range -3 3)))
+
+(def x-line-intervals
+  (mapcat (fn [ scale ]
+            (map #(* % scale)
+                 [ 1 2 3 4 5 6 ]))
+          [1 60 3600 86400 604800]))

 (def stroke-styles
   {:grid
@@ -85,14 +91,16 @@
      :min (- (:min range) scaled-delta)}))

 (defn draw-xlabel [ ctx text x y left? ]
-  (let [mt (.measureText ctx text)
-        w (.-width mt)]
-    (.fillText ctx text (if left? x (- x w)) (+ 12 y))))
+  (with-preserved-ctx ctx
+    (aset ctx "textBaseline" "top")
+    (aset ctx "textAlign" (if left? "left" "right"))
+    (.fillText ctx text x y)))

 (defn draw-ylabel [ ctx text x y ]
-  (let [mt (.measureText ctx text)
-        w (.-width mt)]
-    (.fillText ctx text (- x w) (+ y 4))))
+  (with-preserved-ctx ctx
+    (aset ctx "textBaseline" "middle")
+    (aset ctx "textAlign" "right")
+    (.fillText ctx text x y)))

 (defn translate-fn [ range size ]
   (let [min (:min range)
@@ -167,6 +175,12 @@
                         (range (/ (range-magnitude y-range) y-interval))))]
         (draw-y-grid-line ctx w (pixel-snap (ty y)) y (= y 0))))))

+
+
+(defn draw-x-grid [ ctx w h x-range ]
+  (draw-xlabel ctx (format-xlabel (:min x-range)) 0 h true)
+  (draw-xlabel ctx (format-xlabel (:max x-range)) w h false))
+
 (defn draw-series [ ctx w h data x-range ]
   (with-preserved-ctx ctx
     (set-stroke-style ctx :series-line)
@@ -174,12 +188,11 @@
     (aset ctx "font" "12px Arial")
     (let [y-range (rescale-range (s-yrange data) 1.1)]
       (unless (empty? data)
-              (draw-y-grid ctx w h y-range)
-              (with-preserved-ctx ctx
-                (clip-rect ctx 0 0 w h)
-                (draw-series-line ctx data x-range y-range w h))
-              (draw-xlabel ctx (format-xlabel (:min x-range)) 0 h true)
-              (draw-xlabel ctx (format-xlabel (:max x-range)) w h false)))))
+        (draw-y-grid ctx w h y-range)
+        (draw-x-grid ctx w h x-range)
+        (with-preserved-ctx ctx
+          (clip-rect ctx 0 0 w h)
+          (draw-series-line ctx data x-range y-range w h))))))

 (defn draw-series-background [ ctx w h ]
   (with-preserved-ctx ctx
@@ -191,7 +204,7 @@
     (set-stroke-style ctx :frame)
     (draw-line ctx [ 0.5 0.5 ] [ 0.5 (- h 0.5) ] )))

-(defn draw [ ctx w h data begin-t end-t]
+(defn draw [ ctx w h data begin-t end-t ]
   (draw-series-background ctx w h)
   (let [w (- w y-axis-space tsplot-right-margin)
         h (- h x-axis-space)]


Use partial

Use partial

--- src/ui/core.cljs
+++ src/ui/core.cljs
@@ -3,7 +3,7 @@
             [reagent.core :as reagent :refer [atom]]
             [clojure.string :as string :refer [split-lines]]))

-(defn join-lines [v] (string/join "\n" v))
+(def join-lines (partial string/join "\n"))

 (enable-console-print!)


doc the option

doc the option

--- modules/reitit-frontend/src/reitit/frontend.cljs
+++ modules/reitit-frontend/src/reitit/frontend.cljs
@@ -22,7 +22,9 @@

 (defn match-by-path
   "Given routing tree and current path, return match with possibly
-  coerced parameters. Return nil if no match found."
+  coerced parameters. Return nil if no match found.
+
+  :on-coercion-error - a sideeffecting fn of `match exception -> nil`"
   ([router path] (match-by-path router path nil))
   ([router path {:keys [on-coercion-error]}]
    (let [uri (.parse Uri path)


Add read/write public api functions to core ns.

--- src/bytebuf/core.clj
+++ src/bytebuf/core.clj
@@ -1,7 +1,9 @@
 (ns bytebuf.core
-  (:require [bytebuf.types]
-            [bytebuf.spec]
-            [bytebuf.buffer]
+  (:refer-clojure :exclude [read])
+  (:require [bytebuf.types :as types]
+            [bytebuf.spec :as spec]
+            [bytebuf.buffer :as buffer]
+            [bytebuf.proto :as proto]
             [potemkin.namespaces :refer [import-vars]]))

 (import-vars
@@ -11,4 +13,24 @@
   int32
   int64]
  [bytebuf.buffer
-  allocate])
+  allocate]
+ [bytebuf.proto
+  size])
+
+(defn write!
+  ([buff data spec]
+   (write! buff data spec {}))
+  ([buff data spec {:keys [offset] :or {offset 0}}]
+   (locking buff
+     (spec/write spec buff offset data))))
+
+(defn read*
+  ([buff spec]
+   (read* buff spec {}))
+  ([buff spec {:keys [offset] :or {offset 0}}]
+   (locking buff
+     (spec/read spec buff offset))))
+
+(defn read
+  [& args]
+  (second (apply read* args)))


Add refresh to user ns

Add refresh to user ns

For situations where I've broken things so badly that I can't even get
into dev

--- dev/user.clj
+++ dev/user.clj
@@ -1,4 +1,5 @@
-(ns user)
+(ns user
+  (:require [clojure.tools.namespace.repl :refer (refresh refresh-all)]))

 ;; This is an old trick from Pedestal. When system.clj doesn't compile,
 ;; it can prevent the REPL from starting, which makes debugging very


[Add] -main

[Add] -main

for printing sample experimental result

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -183,7 +183,21 @@
          groupn (quot numd k)]                ; number of one group's element
      (->> (take k (iterate #(+ % groupn) 0))
           (pmap #(let [eva (_cross-validate norm-dataset % (+ % (dec groupn)) L)]
-                   (dorun (print-exp-data eva))
+                   (dorun [(print-exp-data eva) (flush)])
                    (:Accuracy eva)))
           (reduce +)
           (* (/ 1 k))))))
+
+
+(defn -main []
+  (printfl "Start exp\n")
+  (def dataset-cover (read-dataset "data/australian.csv" 14 :header true))
+  (printfl "Fin read-data outguess_all_0.0.csv\n")
+  (def dataset-stego (read-dataset "data/australian.csv" 14 :header true))
+  (printfl "Fin read-data outguess_all_1.0.csv\n")
+  (def dataset-row (data/concat-dataset dataset-cover dataset-stego))
+  (printfl "Fin data concat\n")
+  (def dataset (data/shuffle-dataset dataset-row))
+  (printfl "Fin data shuffle\n")
+  (printfl (str (cross-validate dataset 100 10) "\n"))
+  (System/exit 0))


Add notes to describe the precondition around region validity

--- src/cljam/io/bed.clj
+++ src/cljam/io/bed.clj
@@ -219,7 +219,11 @@
   "Returns a lazy sequence that is the intersection of the two BED sequences.

   The input sequences will first be sorted with sort-fields, which may cause
-  an extensive memory use for ones with a large number of elements."
+  an extensive memory use for ones with a large number of elements.
+  Note also that this function assumes the input sequences contain only valid
+  regions, and thus :start <= :end holds for each region. Make sure yourself
+  the input sequences meet the condition, or the function may return a wrong
+  result."
   [xs ys]
   (letfn [(intersect [xs ys]
             (lazy-seq
@@ -241,7 +245,11 @@
   in the sequence ys from the sequence xs.

   The input sequences will first be sorted with sort-fields, which may cause
-  an extensive memory use for ones with a large number of elements."
+  an extensive memory use for ones with a large number of elements.
+  Note also that this function assumes the input sequences contain only valid
+  regions, and thus :start <= :end holds for each region. Make sure yourself
+  the input sequences meet the condition, or the function may return a wrong
+  result."
   [xs ys]
   (letfn [(subtract [xs ys]
             (lazy-seq
@@ -267,7 +275,11 @@
   and returns a lazy sequence that is the complement of the BED sequence.

   The input sequence will first be sorted with sort-fields, which may cause
-  an extensive memory use for ones with a large number of elements."
+  an extensive memory use for ones with a large number of elements.
+  Note also that this function assumes the BED sequence contains only valid
+  regions, and thus :start <= :end holds for each region. Make sure yourself
+  the BED sequence meets the condition, or the function may return a wrong
+  result."
   [refs xs]
   (let [chr->len (into {} (map (juxt :name :len)) refs)
         chrs (sort-by chr/chromosome-order-key (map :name refs))]


Add dom/val, a getter/setter for value of input nodes.

--- src/cljs/c2/dom.cljs
+++ src/cljs/c2/dom.cljs
@@ -1,9 +1,11 @@
 (ns c2.dom
+  (:refer-clojure :exclude [val])
   (:use-macros [c2.util :only [p pp timeout bind!]]
                [clojure.core.match.js :only [match]])
   (:require [clojure.string :as string]
             [singult.core :as singult]
             [goog.dom :as gdom]
+            [goog.dom.forms :as gforms]
             [goog.dom.classes :as gclasses]
             [goog.style :as gstyle]))

@@ -154,6 +156,16 @@
        (gdom/setTextContent el v)
        el)))

+(defn val
+  "Get or set element value."
+  ([el]
+     (let [el (->dom el)]
+       (gforms/getValue el)))
+  ([el v]
+     (let [el (->dom el)]
+       (gforms/setValue el v)
+       el)))
+
 (defn classed!
   "Add or remove `class` to element based on boolean `classed?`, returning element."
   [el class classed?]


Fix typos

Fix typos

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -574,7 +574,7 @@
     (swap! push-argmap assoc
            :atom-generators (conj (:atom-generators @push-argmap)
                                   (tag-instruction-erc
-                                    (:autoconstructive-tag-types @push-armap) 10000)))
+                                    (:autoconstructive-tag-types @push-argmap) 10000)))
     (swap! push-argmap assoc
            :atom-generators (conj (:atom-generators @push-argmap)
                                   (untag-instruction-erc 10000)))
@@ -600,7 +600,7 @@
            :replace-child-that-exceeds-size-limit-with :empty))
   (when (> (:tag-enrichment @push-argmap) 0)
     (let [types (:tag-enrichment-types @push-argmap)
-          use-type #(some #{%} types_)]
+          use-type #(some #{%} types)]
       (swap! push-argmap assoc
              :atom-generators
              (let [tag-instructions
@@ -615,9 +615,9 @@
                            (if (use-type :boolean) '[integer_tag_boolean_instruction] [])
                            (if (use-type :char) '[integer_tag_char_instruction] [])
                            (if (use-type :string) '[integer_tag_string_instruction] []))]
-             (into (:atom-generators @push-argmap)
-                   (take (* (:tag-enrichment @push-argmap) (count tag-instructions))
-                         (cycle tag-instructions)))))))
+               (into (:atom-generators @push-argmap)
+                     (take (* (:tag-enrichment @push-argmap) (count tag-instructions))
+                           (cycle tag-instructions))))))))

 (defn reset-globals
   "Resets all Clojush globals according to values in @push-argmap. If an argmap argument


[#3027] Update spec to conform with empty order

--- backend/specs/akvo/lumen/specs/visualisation/legend.clj
+++ backend/specs/akvo/lumen/specs/visualisation/legend.clj
@@ -19,6 +19,6 @@

 (s/def ::position #{"right" "top" "left" "bottom"})

-(s/def ::order (s/keys :req-un [::order.s/mode ::order.s/list]))
+(s/def ::order (s/keys :opt-un [::order.s/mode ::order.s/list]))

 (s/def ::legend (s/keys :req-un [::order]))


[#1157] Add buffer to windshaft tiles so points on tile boundaries display correctly

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -67,6 +67,11 @@
                             (get layer "popup"))
         point-color-column (get layer "pointColorColumn")]
     {"version" "1.6.0"
+     "buffersize" {
+      "png" 8
+      "grid.json" 8
+      "mvt" 0
+     }
      "layers" [{"type" "mapnik"
                 "options" {"cartocss" (trim-css (cartocss (get layer "pointSize")
                                                           (get layer "pointColorColumn")


[#2895] Remove table-name not used arg

[#2895] Remove table-name not used arg

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -143,7 +143,7 @@
     :else []))

 (defn shape-aggregation-sql
-  [tenant-conn columns table-name geom-column popup-columns point-color-column where-clause current-layer layer-index]
+  [tenant-conn columns geom-column popup-columns point-color-column where-clause current-layer layer-index]
   (let [{:keys [table-name columns]} (db.dataset/dataset-by-id tenant-conn {:id (:aggregationDataset current-layer)})
         point-table-name table-name
         point-columns columns
@@ -232,7 +232,7 @@
             shape-table-name
             shape-table-name)))

-(defn point-sql [tenant-conn columns table-name geom-column popup-columns
+(defn point-sql [tenant-conn columns geom-column popup-columns
                  point-color-column where-clause {:keys [datasetId] :as layer}]
   (let [{:keys [table-name columns]} (db.dataset/dataset-by-id tenant-conn {:id datasetId})
         date-column-set (reduce (fn [m {:strs [columnName type]}]
@@ -251,7 +251,7 @@
                         table-name
                         where-clause)))

-(defn shape-sql [tenant-conn columns table-name geom-column popup-columns point-color-column where-clause
+(defn shape-sql [tenant-conn columns geom-column popup-columns point-color-column where-clause
                  {:keys [datasetId shapeLabelColumn ] :as layer}]
   (let [{:keys [table-name columns]} (db.dataset/dataset-by-id tenant-conn {:id datasetId})
         date-column-set (reduce (fn [m {:strs [columnName type]}]
@@ -272,26 +272,23 @@
             where-clause)))

 (defn get-sql
-  [tenant-conn columns table-name geom-column popup-columns point-color-column
+  [tenant-conn columns geom-column popup-columns point-color-column
    where-clause {:keys [aggregationDataset aggregationColumn
                         aggregationGeomColumn layerType]
                  :as layer} layer-index]
   (cond

-    (= layerType "raster")
-    (format "SELECT * FROM %s" table-name)
-
     (and aggregationDataset aggregationColumn aggregationGeomColumn)
-    (shape-aggregation-sql tenant-conn columns table-name geom-column
+    (shape-aggregation-sql tenant-conn columns geom-column
                            popup-columns (:columnName point-color-column) where-clause layer
                            layer-index)

     (= layerType "geo-shape")
-    (shape-sql tenant-conn columns table-name geom-column popup-columns
+    (shape-sql tenant-conn columns geom-column popup-columns
                (:columnName point-color-column) where-clause layer)

     :else
-    (point-sql tenant-conn columns table-name geom-column popup-columns
+    (point-sql tenant-conn columns geom-column popup-columns
                point-color-column where-clause layer)))

 (defn get-interactivity
@@ -326,7 +323,7 @@
           (or max "255")
           (or end-color "#000000")))

-(defn get-layers [tenant-conn layers metadata-array table-name]
+(defn- get-layers [tenant-conn layers metadata-array]
   (map-indexed (fn [idx {:keys [datasetId rasterId filters geom popup pointColorColumn]
                          :as layer}]
                  (if (= (:layerType layer) "raster")
@@ -345,7 +342,7 @@
                          where-clause (filter/sql-str kw-columns filters)
                          popup-columns (mapv :column popup)
                          point-color-column (find-column kw-columns pointColorColumn)
-                         sql (get-sql tenant-conn columns table-name geom-column
+                         sql (get-sql tenant-conn columns geom-column
                                       popup-columns point-color-column
                                       where-clause layer idx)]

@@ -359,12 +356,12 @@
                                 :srid "4326"}})))
                layers))

-(defn build [tenant-conn table-name layers metadata-array]
+(defn build [tenant-conn layers metadata-array]
   {:version "1.6.0"
    :buffersize {:png 8
                 :grid.json 0
                 :mvt 0}
-   :layers (get-layers tenant-conn layers metadata-array table-name)})
+   :layers (get-layers tenant-conn layers metadata-array)})

 (defn build-raster [table-name min max]
   {:version "1.6.0"


dome private repo fetch

dome private repo fetch

--- src/ci3/agent.clj
+++ src/ci3/agent.clj
@@ -15,7 +15,7 @@
     (when-let [bld (k8s/find k8s/cfg :builds (str/trim bid))]
       (when-not (or bld (= "Failure" (get bld "status")))
         (throw (Exception. (str "Could not find build: " bid " or " bld))))
-      (println "Got build: " bld)
+      (println "Got build: " (get bld "metadata"))
       (walk/keywordize-keys bld))))

 (defn checkout-project []
@@ -23,7 +23,6 @@
     (let [token (k8s/secret "secrets" :github_token)
           repo (str "https://" token "@github.com/" full_name ".git")
           res (sh/sh "git" "clone" repo "/workspace")]
-      (println "-------" repo)
       (println res)
       res)))

@@ -32,10 +31,13 @@

 (defn run [& args]
   (let [repo (checkout-project)] (println repo))
-  (let [build (get-build (build-id))
+  (let [id (build-id)
+        build (get-build id )
         build (merge
                 (yaml/parse-string (slurp "ci3.yaml") true)
-                build) ]
+                build)]
+    (k8s/patch k8s/cfg :builds id
+               (select-keys  build [:pipeline :environment]))
     (build/build build)))

 (defn exec [& args]


WIP: align with tangrammer/cylon/oauth2-ms

--- modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
+++ modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
@@ -149,7 +149,7 @@
         [:div
          [:p "Model..."]
          [:pre (h (pr-str model))]]
-        [:p "Now proceed to " (path-for req :devices)]]])))
+        [:p "Now proceed to " [:a {:href (:redirection-uri model)} "continue"]]]])))

   EmailVerifiedRenderer
   (render-email-verified [this req model]


name special form docfiles with special_ prefix instead of cljs.core_ since they do not have a namespace

--- src/core.clj
+++ src/core.clj
@@ -510,7 +510,8 @@
         repo "clojurescript"
         forms (concat (get-forms ns- repo "analyzer.clj")
                       (get-forms ns- repo "compiler.clj"))
-        specials (keep #(parse-special % ns- repo) forms)]
+        special-ns "special" ;; doing this because special forms are not actually in any namespace
+        specials (keep #(parse-special % special-ns repo) forms)]
     (println "   " (count specials) "special forms in cljs.analyzer")
     specials))


fix broken compilation on Windows (2nd attempt)

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

--- plugins/SlideExplorer2/src/slide_explorer/widgets.clj
+++ plugins/SlideExplorer2/src/slide_explorer/widgets.clj
@@ -4,7 +4,6 @@
            (javax.swing AbstractAction JButton JCheckBox JFrame JComponent KeyStroke))
   (:require [slide-explorer.utils :as utils]))

-;; key binding

 (defn can-eval? [form]
   (try
@@ -17,6 +16,8 @@
                   (import com.apple.eawt.FullScreenAdapter))))

 (def fullscreen-windows (atom #{}))
+
+;; key binding

 (defn bind-key
   "Maps an input-key on a swing component to an action,
@@ -100,9 +101,12 @@

 (def old-bounds (atom {}))

-(defn mac-new-toggle-full-screen [window]
-  (.requestToggleFullScreen
-    (eval `(Application/getApplication)) window))
+(def mac-new-toggle-full-screen
+  (attempt-eval
+    '(fn [window]
+       (.requestToggleFullScreen
+         (eval `(Application/getApplication)) window))
+    (constantly nil)))

 (defn full-screen!
   "Make the given window/frame full-screen."
@@ -151,29 +155,30 @@
       (exit-full-screen! window)
       (full-screen! window))))

-(defmacro new-mac-enable-full-screen [window]
-  `(do (FullScreenUtilities/setWindowCanFullScreen ~window true)
-       (FullScreenUtilities/addFullScreenListenerTo ~window
-           (proxy [FullScreenAdapter] []
-             (windowEnteringFullScreen [_#]
-               (.setBounds ~window 100 100 400 400))
-             (windowEnteredFullScreen [_#]
-               (swap! fullscreen-windows conj ~window))
-             (windowExitingFullScreen [_#]
-               (println "exiting"))
-             (windowExitedFullScreen [_#]
-               (swap! fullscreen-windows disj ~window))))))
-
-(defmacro compile-when [test & body]
-  (when test
-    `(do @~body)))
+(defn attempt-eval [form default]
+  (try
+    (eval form)
+    (catch Throwable _ default)))
+
+(def new-mac-enable-full-screen
+  (attempt-eval
+    '(fn [window]
+       (FullScreenUtilities/setWindowCanFullScreen window true)
+       (FullScreenUtilities/addFullScreenListenerTo window
+         (proxy [FullScreenAdapter] []
+         (windowEnteringFullScreen [_])
+         (windowEnteredFullScreen [_]
+           (swap! fullscreen-windows conj window))
+         (windowExitingFullScreen [_])
+         (windowExitedFullScreen [_]
+           (swap! fullscreen-windows disj window)))))
+    (constantly nil)))

 (defn setup-fullscreen
   "Endows the given window with the ability to enter and exit full screen.
    Key commands are F for enter/exit and ESCAPE also for exit."
   [window]
-  (compile-when new-mac-full-screen
-    (new-mac-enable-full-screen window))
+  (new-mac-enable-full-screen window)
   (bind-window-keys window ["F"] #(toggle-full-screen! window))
   (bind-window-keys window ["ESCAPE"] #(exit-full-screen! window)))


code cleanup

code cleanup

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

--- plugins/DLLAutoReloader/src/DLLAutoReloader/core.clj
+++ plugins/DLLAutoReloader/src/DLLAutoReloader/core.clj
@@ -181,33 +181,16 @@
   [& txt]
   (str "
" (apply str txt) ""))

-(defn notify-user-reloading-started
-  "Notify the user that reloading has started."
-  [module]
+(defn notify-user
+  "Show the user a message."
+  [temporary? & message-parts]
   (let [{:keys [frame label]} status-frame]
     (edt
-      (.setText label (label-html "Reloading " module " module..."))
-    (.show frame))))
-
-(defn notify-user-reloading-finished
-  "Notify the user that reloading has finished."
-  [module]
-  (let [{:keys [frame label]} status-frame]
-    (edt
-      (.setText label (label-html "Finished reloading " module "!"))
+      (.setText label (apply label-html message-parts))
       (.show frame))
+    (when temporary?
     (future (Thread/sleep 3000)
-            (edt (.hide frame)))))
-
-(defn notify-user-activated
-  "Notify the user that reloading has finished."
-  []
-  (let [{:keys [frame label]} status-frame]
-    (edt
-      (.setText label (label-html "Ready to autoreload!"))
-      (.show frame))
-    (future (Thread/sleep 3000)
-            (edt (.hide frame)))))
+            (edt (.hide frame))))))

 (defn reload-updated-module
   "Unload a module, copy the new version to the Micro-Manager
@@ -220,11 +203,11 @@
       (let [live-mode (.isLiveModeOn gui)]
         (when live-mode
           (.enableLiveMode gui false))
-        (notify-user-reloading-started module)
+        (notify-user "Reloading " module " module...")
         (reload-module module
                        (copy dll
                              (file "." (.getName dll))))
-        (notify-user-reloading-finished module)
+        (notify-user "Finished reloading " module "!")
         (when live-mode
           (.enableLiveMode gui true))))))

@@ -244,9 +227,10 @@

 (defn show-plugin []
   (stop)
-  (def stop (reload-modules-on-device-adapter-change default-directory)))
-
-(defn handle-exit [] (notify-user-activated))
+  (def stop (reload-modules-on-device-adapter-change default-directory))
+  (notify-user "Ready to autoreload!"))
+
+(defn handle-exit [] (stop))

 ;; testing


now ranks straight and straight-flush

now ranks straight and straight-flush

--- poker-hands/clojure/src/poker_hands/hands.clj
+++ poker-hands/clojure/src/poker_hands/hands.clj
@@ -9,9 +9,6 @@
                  :two-pair        7
                  :one-pair        8
                  :high-card       9})
-
-(defn- abs [n]
-  (if (< n 0) (* n -1) n))

 (defn- add-hand-info [h kind high-card-fn]
   (into h {:kind kind
@@ -30,16 +27,15 @@
        (take (count c) (map #(% :rank) c))))

 (defn- straight [c]
-  (not (some #(> % 0)
-             (map #(abs (reduce - %))
+  (not (some #(not (= % 0))
+             (map #(reduce - %)
                   (pair-up-with-seq c)))))

-(defn- a-flush [h]
-  (let [suit ((h :cards) :suit)]
-    (every-pred #(= (% :suit) suit) h)))
+(defn- a-flush [c]
+  (= (count (distinct (map #(% :suit) c))) 1))

 (defn- is-straight-flush [h]
-  (and (straight(h :cards))
+  (and (straight (h :cards))
        (a-flush (h :cards))
        (add-hand-info h
                       :straight-flush


Clean up docs for a couple functions.

Clean up docs for a couple functions.

--- project/analyze-data/src/analyze_data/tf_idf/core.clj
+++ project/analyze-data/src/analyze_data/tf_idf/core.clj
@@ -8,7 +8,7 @@

 (defn to-terms
   "Given a string representing a document, return a sequence of words,
-  bigrams, and trigrams found in the document."
+  bigrams, and trigrams found in the document. Stopwords will be removed."
   [document]
   (let [words (remove-stopwords (to-words document))]
     (concat words (n-grams 2 words) (n-grams 3 words))))
@@ -28,8 +28,9 @@
     (map calc-tf-idf all-terms)))

 (defn tf-idf
-  "Calculates (term frequency * inverse document frequency) values for a corpus
-  of documents.
+  "Calculates (term frequency * inverse document frequency) values for a
+  corpus of documents.
+

   term-corpus: a sequence of term sequences. A term is a word, or bigram, or
                trigram, etc. Each term sequence should represent a single


Stabilizes completion.

Stabilizes completion.

--- test/onyx/coordinator/cluster_test.clj
+++ test/onyx/coordinator/cluster_test.clj
@@ -17,6 +17,8 @@
 (def sync-storage (:sync components))

 (def log (:log components))
+
+(def tx-queue (d/tx-report-queue (:conn log)))

 (def offer-spy (chan 1000))

@@ -64,7 +66,6 @@

             (loop [payload-node payload]
               (<! sync-spy)
-              (prn peer)

               (let [nodes (:nodes (extensions/read-place sync-storage payload-node))]
                 (extensions/on-change sync-storage (:status nodes) #(go (>! status-spy %)))
@@ -81,15 +82,15 @@

 (start-peers! peers)

-(testing "It must complete in under 10 seconds"
-  (Thread/sleep 10000))
+(testing "All 30 tasks complete"
+  (loop []
+    (let [db (:db-after (.take tx-queue))
+          query '[:find (count ?task) :where [?task :task/complete? true]]
+          result (ffirst (d/q query db))]
+      (when-not (= result 30)
+        (recur)))))

 (let [db (d/db (:conn log))]
-  (testing "All 30 tasks completed"
-    (let [query '[:find (count ?task) :where [?task :task/complete? true]]
-          result (ffirst (d/q query db))]
-      (is (= result 30))))
-
   (testing "No tasks are left incomplete"
     (let [query '[:find (count ?task) :where [?task :task/complete? false]]
           result (ffirst (d/q query db))]


Comment runner to verify circle ci errors

--- src/test/discuss/tests.cljs
+++ src/test/discuss/tests.cljs
@@ -8,7 +8,7 @@

 (enable-console-print!)

-(doo-tests 'discuss.components.clipboard-test
+#_(doo-tests 'discuss.components.clipboard-test
            'discuss.references.lib-test
            'discuss.utils.common-test
            'discuss.translations-test)


extract context watch handling into separate fns, update scheduler context config

--- src/thi/ng/fabric/core.cljc
+++ src/thi/ng/fabric/core.cljc
@@ -370,6 +370,21 @@
             [c-act colls] (coll-fn vertices)]
         [(into s-act c-act) sigs colls]))))

+(defn add-context-watches
+  [g watch-id queue]
+  (add-watch! g :add-vertex watch-id
+              (fn [[__ v]] (swap! queue into (signal! v sync-vertex-signal))))
+  (add-watch! g :remove-vertex watch-id
+              (fn [[__ v]] (swap! queue into (signal! v sync-vertex-signal))))
+  (add-watch! g :add-edge watch-id
+              (fn [[__ src dest]] (swap! queue into [src dest]))))
+
+(defn remove-context-watches
+  [g watch-id]
+  (remove-watch! g :add-vertex watch-id)
+  (remove-watch! g :remove-vertex watch-id)
+  (remove-watch! g :add-edge watch-id))
+
 (defn default-sync-context-opts
   []
   {:collect-thresh 0
@@ -419,9 +434,11 @@
   []
   {:collect-thresh 0
    :signal-thresh  0
-   :signal-fn      parallel-signal-pass
-   :collect-fn     parallel-collect-pass
-   :scheduler      two-pass-scheduler
+   ;;:signal-fn      parallel-signal-pass
+   ;;:collect-fn     parallel-collect-pass
+   ;;:scheduler      two-pass-scheduler
+   :processor      eager-probabilistic-vertex-processor
+   :scheduler      single-pass-scheduler
    :max-ops        1e6
    :threads        #?(:clj (inc (.availableProcessors (Runtime/getRuntime))) :cljs 1)})

@@ -437,9 +454,7 @@
         watch-id  (keyword (gensym))
         v-filter  (filter #(or (should-signal? % s-thresh) (should-collect? % c-thresh)))
         ->result  (fn [type sigs colls t0]
-                    (remove-watch! g :add-vertex watch-id)
-                    (remove-watch! g :remove-vertex watch-id)
-                    (remove-watch! g :add-edge watch-id)
+                    (remove-context-watches g watch-id)
                     (execution-result type sigs colls t0))]
     (reify
       #?@(:clj
@@ -456,22 +471,17 @@
         [_]
         (let [t0 (now)
               active (atom (sequence v-filter (vertices g)))
-              enable (atom #{})]
-          (add-watch! g :add-vertex watch-id
-                      (fn [[__ v]] (swap! enable into (signal! v sync-vertex-signal))))
-          (add-watch! g :remove-vertex watch-id
-                      (fn [[__ v]] (swap! enable into (signal! v sync-vertex-signal))))
-          (add-watch! g :add-edge watch-id
-                      (fn [[__ src dest]] (swap! enable into [src dest])))
+              queue  (atom #{})]
+          (add-context-watches g watch-id queue)
           (loop [colls 0, sigs 0]
             ;;(warn :active-count (count @active))
             (if (seq @active)
               (if (<= (+ colls sigs) max-ops)
                 (let [grp-size            (max 512 (long (/ (count @active) threads)))
                       [act' sigs' colls'] (scheduler grp-size @active)]
-                  ;;(warn :auto (count @enable))
-                  (reset! active (into (into #{} v-filter act') @enable))
-                  (reset! enable #{})
+                  ;;(warn :auto (count @queue))
+                  (reset! active (into (into #{} v-filter act') @queue))
+                  (reset! queue #{})
                   (recur (long (+ colls colls')) (long (+ sigs sigs'))))
                 (->result :max-ops-reached sigs colls t0))
               (->result :converged sigs colls t0))))))))
@@ -498,9 +508,7 @@
         notify-chan (async/chan (async/dropping-buffer 1))
         watch-id    (keyword (gensym))
         v-filter    (filter #(or (should-signal? % s-thresh) (should-collect? % c-thresh)))
-        ->result    (fn [type sigs colls t0]
-                      (warn :send-result type)
-                      (go (>! res-chan (execution-result type sigs colls t0))))]
+        ->result    (fn [type sigs colls t0] (go (>! res-chan (execution-result type sigs colls t0))))]
     (reify
       #?@(:clj
            [clojure.lang.IDeref
@@ -511,9 +519,7 @@
       IGraphExecutor
       (stop!
         [_]
-        (remove-watch! g :add-vertex watch-id)
-        (remove-watch! g :remove-vertex watch-id)
-        (remove-watch! g :add-edge watch-id)
+        (remove-context-watches g watch-id)
         (async/close! notify-chan))
       (notify!
         [_] (go (>! notify-chan true)) nil)
@@ -521,25 +527,17 @@
         [_]
         (let [t0     (atom (now))
               active (atom (sequence v-filter (vertices g)))
-              enable (atom #{})]
-          (add-watch! g :add-vertex watch-id
-                      (fn [[__ v]]
-                        (swap! enable into (signal! v sync-vertex-signal))))
-          (add-watch! g :remove-vertex watch-id
-                      (fn [[__ v]]
-                        (swap! enable into (signal! v sync-vertex-signal))))
-          (add-watch! g :add-edge watch-id
-                      (fn [[__ src dest]]
-                        (swap! enable into [src dest])))
+              queue (atom #{})]
+          (add-context-watches g watch-id queue)
           (go-loop [colls 0, sigs 0]
             ;;(warn :active-count (count @active))
             (if (seq @active)
               (if (<= (+ colls sigs) max-ops)
                 (let [grp-size            (max 512 (long (/ (count @active) threads)))
                       [act' sigs' colls'] (scheduler grp-size @active)]
-                  ;;(warn :auto (count @enable))
-                  (reset! active (into (into #{} v-filter act') @enable))
-                  (reset! enable #{})
+                  ;;(warn :auto (count @queue))
+                  (reset! active (into (into #{} v-filter act') @queue))
+                  (reset! queue #{})
                   (recur (long (+ colls colls')) (long (+ sigs sigs'))))
                 (do (stop! _)
                     (->result :max-ops-reached sigs colls @t0)))
@@ -549,7 +547,7 @@
                     (when (<! notify-chan)
                       (reset! t0 (now))
                       (reset! active (sequence v-filter (vertices g)))
-                      (reset! enable #{})
+                      (reset! queue #{})
                       ;;(warn :rerun (count @active))
                       (recur 0 0))))))
           res-chan)))))


fix ns

fix ns

--- src/thinking/sequences.cljc
+++ src/thinking/sequences.cljc
@@ -1,4 +1,4 @@
-(ns thinking.seqs
+(ns thinking.sequences
   (:require [clojure.zip :as z]))

 (def data


elasticsearch2cassandra - no test

elasticsearch2cassandra - no test

--- src/desafio/core.clj
+++ src/desafio/core.clj
@@ -35,8 +35,9 @@
                             :sync :boolean
                             :primary-key [:id]}))

-
-;; Elasticsearch
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;              Elasticsearch
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn esCreateIndexDesafio [esconn]
   (esi/create esconn index-name :mappings mapping-types :settings {"number_of_shards" 1}))
@@ -49,6 +50,7 @@
     (do
       (esd/put esconn index-name index-type (str (UUID/randomUUID)) {:timeline "vvmaciel"
                                                                      :text (str "texto orig es " n)
+                                                                     :created_at (.getTime (java.util.Date.))
                                                                      :sync false})
       (recur esconn (dec n)))))

@@ -82,6 +84,41 @@
     (let [hit (first hits)]
       ;;process hit
       (println hit)
+      (let [res (cql/select casconn "tweet" (casq/where {:id (UUID/fromString (:_id hit))}))]
+        (if (empty? res)
+          (do ;; put new cas entry and update es
+            (println "new entry on cassandra and update elasticsearch")
+            (cql/insert casconn "tweet" {:timeline (:timeline (:_source hit))
+                                         :text (:text (:_source hit))
+                                         :sync true
+                                         :id (UUID/fromString (:_id hit))
+                                         :created_at (:created_at (:_source hit))})
+            (esd/update-with-partial-doc esconn index-name index-type (:_id hit) {:sync true}))
+          (let ;; update entry
+              [tes (:created_at (:_source (esGetNotSyncTweets esconn)))
+               tcas (.getTime (:created_at (first res)))]
+            (println "what the newest?" )
+            (if (<= tes tcas)
+              (do ;; upgrade cas and es using cas
+                (esd/update-with-partial-doc esconn index-name index-type (:_id hit)
+                                             {:sync true
+                                              :text (:text (first res))
+                                              :timeline (:timeline (first res))})
+                (cql/update casconn "tweet"
+                            {:sync true
+                             :created_at (:created_at (:_source hit))}
+                            (casq/where {:id (UUID/fromString (:_id hit))})))
+            (do ;; upgrade cas and es using es
+              (esd/update-with-partial-doc esconn index-name index-type (:_id hit) {:sync true})
+              (cql/update casconn "tweet"
+                          {:timeline (:timeline (:_source hit))
+                           :text (:text (:_source hit))
+                           :sync true
+                           :id (UUID/fromString (:_id hit))
+                           :created_at (:created_at (:_source hit))}
+                          (casq/where {:id (UUID/fromString (:_id hit))})))))))
+
+
       (recur esconn casconn (rest hits)))))

@@ -89,8 +126,10 @@
   (let [hits (esGetNotSyncTweets esconn)]
     (es2cas esconn casconn hits)))

-
-;; Cassandra
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;                Cassandra
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 (defn casCreateKeyspaceDesafio [casconn]
   (cql/create-keyspace  casconn
                         keyspace-name
@@ -107,7 +146,6 @@
 (defn casDropTableTweet [casconn]
   (cql/use-keyspace casconn keyspace-name)
   (cql/drop-table casconn "tweet"))
-

 (defn casDeleteKeyspaceDesafio [casconn]
   (cql/drop-keyspace casconn keyspace-name))
@@ -137,6 +175,21 @@
   (let [hits (casGetNotSyncTweets casconn)]
     (cas2es esconn casconn hits)))

+
+
+;;; tests helpers
+
+(defn resetDBs [esconn casconn]
+  (esDeleteIndexDesafio esconn)
+  (esCreateIndexDesafio esconn)
+  (casDropTableTweet casconn)
+  (casCreateTableTweet casconn))
+
+(defn data10es3cas [esconn casconn]
+  (resetDBs esconn casconn)
+  (esPutRandomTweets esconn 10)
+  (casPutRandomTweets casconn 3))
+
 ;; Enable command-line invocation
 (defn -main [& args]
   (let [esconn (esr/connect "http://127.0.0.1:9200")


Document api/list-classes

Document api/list-classes

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -46,6 +46,9 @@
   dispatch)

 (defmulti list-classes
+  "Succeeds with a result Seq[Class] representing all Java classes in the
+  specified Version. Could succeed with an empty result. Fails if the specified
+  Version does not exist or of another failure is encountered."

   {:arglists '[[config version-thing]]}
   dispatch)


New primitive must return kw.

New primitive must return kw.

--- test/onyx/plugin/input_test.clj
+++ test/onyx/plugin/input_test.clj
@@ -123,7 +123,7 @@
      (Thread/sleep 7000)
      (when (= (swap! batch-num inc) 2)
        (throw (ex-info "Restartable" {:restartable? true}))))
-   :lifecycle/handle-exception (constantly true)})
+   :lifecycle/handle-exception (constantly :restart)})

 (def lifecycles
   [{:lifecycle/task :read-messages


Add test for nil-fill

Add test for nil-fill

--- test/semantic_csv/core_test.clj
+++ test/semantic_csv/core_test.clj
@@ -137,6 +137,8 @@
     (doseq [x [3443 4.555]
             f [->int ->long]]
       (is (= (f x) (long x)))))
+  (testing "with nil-fill"
+    (is (= (->double {:nil-fill 0.0} "") 0.0)))
   (testing "with string inputs containing spaces on the ends"
     (doseq [f [->int ->long ->float ->double]]
       (is (f " 3454 "))))


Allow addition of defrecords to Isla env.

* These define 'types' that may be instantiated with `thing is a thingy`.
* This instantiation creates the record for that type (which has slots and maybe methods).

--- src/isla/library.clj
+++ src/isla/library.clj
@@ -1,14 +1,19 @@
 (ns isla.library
   (:use [clojure.pprint])
   (:require [clojure.string :as str])
+  (:require [isla.user :as user])
   (:require [isla.utils :as utils]))

-(defn get-initial-env []
+(defn get-initial-env [& args]
+  (def extra-types (first args))
   {
    :ret nil
    :ctx {
          "write" (fn [env str]
                    (utils/output str) ;; print out
                    str) ;; add to context
-    }
+         }
+   :types (if (nil? extra-types)
+            user/types
+            (merge extra-types user/types))
   })


tweak

tweak

--- src/jsx_fun/core.clj
+++ src/jsx_fun/core.clj
@@ -59,9 +59,7 @@

 (defn transform-commonjs
   [filename src]
-  (let [js      [(SourceFile/fromCode
-                   filename
-                   src)]
+  (let [js      [(SourceFile/fromCode filename src)]
         options (set-options
                   {:lang-in :es5 :type :commonjs}
                   (CompilerOptions.))


Use store! to set localStorage and doc its usage

--- src/lt/objs/app.cljs
+++ src/lt/objs/app.cljs
@@ -52,7 +52,10 @@
     (when (not= "null" v)
       (js/JSON.parse v))))

-(defn store! [k v]
+(defn store!
+  "Store key and value in localStorage. If value is a string, fetch must be used
+  to get back the original value from localStorage."
+  [k v]
   (aset js/localStorage (name k) (if (string? v)
                                    (pr-str v)
                                    v)))
@@ -106,11 +109,11 @@
           :reaction (fn [this]
                       (when-not (.isFullScreen win)
                         (let [[width height] (.getSize win)]
-                          (set! js/localStorage.width width)
-                          (set! js/localStorage.height height))
+                          (store! :width width)
+                          (store! :height height))
                         (let [[x y] (.getPosition win)]
-                          (set! js/localStorage.x x)
-                          (set! js/localStorage.y y)))
+                          (store! :x x)
+                          (store! :y y)))
                       (set! js/localStorage.fullscreen (.isFullScreen win))))

 (behavior ::restore-fullscreen


handle fields and aliases

handle fields and aliases

--- pigpen-core/src/main/clojure/pigpen/cascading.clj
+++ pigpen-core/src/main/clojure/pigpen/cascading.clj
@@ -76,12 +76,19 @@
   (let [{:keys [init func]} expr]
     (update-in flowdef [:pipes pipe] #(Each. % (PigPenFunction. (str init) (str func)) Fields/RESULTS)))) ;(partial merge {:operation (PigPenFunction. (str init) (str func))}))))

+(defn- cascading-field [name-or-number]
+  (if (number? name-or-number)
+    (int name-or-number)
+    (str name-or-number)))
+
 (defmethod command->flowdef :field-projections
            [{:keys [projections pipe] :as x} flowdef]
   {:pre [(not-empty projections) (get-in flowdef [:pipes pipe])]}
   (println "flowdef" flowdef)
   (println "x" x)
-  (update-in flowdef [:pipes pipe] #(Each. % (Identity. (Fields. (into-array (map (fn [p] (str (:alias p))) projections)))))))
+  (let [fields (map #(cascading-field (:field %)) projections)
+        aliases (map #(cascading-field (:alias %)) projections)]
+    (update-in flowdef [:pipes pipe] #(Each. % (Fields. (into-array fields)) (Identity. (Fields. (into-array aliases)))))))

 (defmethod command->flowdef :group
            [{:keys [id keys join-types ancestors opts]} flowdef]


avere: reflexive=false

avere: reflexive=false

--- babel/italiano/lexicon.clj
+++ babel/italiano/lexicon.clj
@@ -248,7 +248,7 @@
    "avere"
    (let [avere-common {:synsem {:essere false
                                 :cat :verb
-                                :reflexive false}
+                                :sem {:reflexive false}}
                        :italiano {:italiano "avere"
                                   :future-stem "avr"
                                   :drop-e true
@@ -311,8 +311,6 @@
                                 :agr agr-of-subj-of-main-verb
                                 :subcat {:1 {:agr agr-of-subj-of-main-verb}
                                          :2 '()}}}}}))])
-
-
    "bello"
    [;; non-comparative
     (unify adjective


Answer for create-ex post

Answer for create-ex post

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -53,8 +53,8 @@
     (if (authenticate username password)
       (json-response {"token" (auth-token (get-user username)) "username" username} 200)
       (json-response {"error" "Authentication failed"} 401)))
-  (GET "/secret" {params :params cookies :cookies}
-    (is-authenticated? params cookies (json-response {"secret" "ken sent me"})))
+  (POST "/rest/v1/ex/:user" {params :params cookies :cookies}
+    (is-authenticated? params cookies (json-response {"user" (:user params), "secret" "ken sent me"})))

   ;; testing needed
   ;;(PUT "/rest/v1/put-ex/:user" [user body] (json-response (create-ex-wrapper user body)))


fix event code

fix event code

--- labs/architecture-examples/om/src/todomvc/app.cljs
+++ labs/architecture-examples/om/src/todomvc/app.cljs
@@ -90,7 +90,7 @@
 (defn clear-completed [app]
   (om/replace! app [:todos] (into [] (remove :completed (:todos app)))))

-(defn handle-event [app [type val]]
+(defn handle-event [app [type val :as e]]
   (case type
     :toggle  (toggle-todo val)
     :destroy (destroy-todo app val)
@@ -108,8 +108,7 @@
       (let [comm (chan)]
         (dom/set-state! owner :comm comm)
         (go (while true
-              (let [[e c] (<! comm)]
-                (handle-event app e))))))
+              (handle-event app (<! comm))))))
     dom/IDidUpdate
     (-did-update [_ _ _ _ _]
       (store "todos" app))


Add tools.jar to classpath

Add tools.jar to classpath

--- liverepl-agent/project.clj
+++ liverepl-agent/project.clj
@@ -3,6 +3,7 @@
   :license {:name "Copyright (C) 2009 David J. Powell.  See GitHub for license."}
   :url "https://github.com/djpowell/liverepl"
   :dependencies []
+  :plugins [[lein-jdk-tools "0.1.0"]]
   :java-source-paths ["src"]
   :lein-release {:scm :git                   ;; I guess you have to say it explicitly
                  :deploy-via :lein-install}  ;; don't attempt to do real deploy, we can't


Fix quoted examples in edn graphql converter

--- src-docs/com/wsscode/pathom/book/graphql/edn_converter.cljs
+++ src-docs/com/wsscode/pathom/book/graphql/edn_converter.cljs
@@ -1,6 +1,7 @@
 (ns com.wsscode.pathom.book.graphql.edn-converter
   (:require
     [cljs.reader :refer [read-string]]
+    [clojure.string :as str]
     [com.wsscode.pathom.book.app-types :as app-types]
     [com.wsscode.pathom.book.ui.codemirror :as codemirror]
     [com.wsscode.pathom.graphql :as gql]
@@ -15,7 +16,8 @@
   (gstr/toCamelCase (name s)))

 (defn pretty-print-string [x]
-  (with-out-str (cljs.pprint/pprint x)))
+  (str/replace (with-out-str (cljs.pprint/pprint x))
+    #"'" ""))

 (mutations/defmutation update-query [{:keys [ui/om-next-query]}]
   (action [{:keys [state ref]}]