Updated docstring.

Updated docstring.

--- search-app/src/cmr/search/web/routes.clj
+++ search-app/src/cmr/search/web/routes.clj
@@ -1,8 +1,8 @@
 (ns cmr.search.web.routes
   "This namespace is the one responsible for combining the routes intended for
   use by libraries and applications (API routes) and the routes intended for
-  human consumption (site routes). It also provides routes that apply to both
-  (e.g., robots.txt)."
+  human, browser, or web crawler consumption (site routes). It also provides
+  routes that apply to both (e.g., robots.txt)."
   (:require
     [clojure.java.io :as io]
     [clojure.string :as str]


Comment to avoid automatic startup of social-light sketch

--- spectacles/src/spectacles/social_light.clj
+++ spectacles/src/spectacles/social_light.clj
@@ -36,15 +36,15 @@
     (.drawNext (:wordcram state)))
   state)

-(q/defsketch spectacles
-  :title "Social Light"
-  :size [800 600]
-  ; setup function called only once, during sketch initialization.
-  :setup setup
-  ; update-state is called on each iteration before draw-state.
-  :update update-state
-  :draw draw-state
-  :features [:keep-on-top]
-  :middleware [m/fun-mode]
-  :features [:keep-on-top :present :no-start]
-  :bgcolor 0)
+;; (q/defsketch spectacles
+;;   :title "Social Light"
+;;   :size [800 600]
+;;   ; setup function called only once, during sketch initialization.
+;;   :setup setup
+;;   ; update-state is called on each iteration before draw-state.
+;;   :update update-state
+;;   :draw draw-state
+;;   :features [:keep-on-top]
+;;   :middleware [m/fun-mode]
+;;   :features [:keep-on-top :present :no-start]
+;;   :bgcolor 0)


Makes chart scaling work in Safari too

Makes chart scaling work in Safari too

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -205,12 +205,12 @@
     ;; size of the svg and listening to *its* resize event.
     (-> svg
         (.append "foreignObject")
-        (.style #js {:width "100%"
-                     :height "100%"})
+        (.attr #js {:width "100%"
+                    :height "100%"})
         (.append "xhtml:iframe")
-        (.style #js {:width "100%"
-                     :height "100%"
-                     :visibility "hidden"})
+        (.attr #js {:width "100%"
+                    :height "100%"})
+        (.style #js {:visibility "hidden"})
         ffirst
         .-contentWindow
         (gevents/listen "resize" #(when-let [redraw-fn (.property svg "redraw-fn")] (redraw-fn))))


Extend IRDFLiteral to basic clojure/java types

--- src/rdf-common/grafter/rdf/protocols.clj
+++ src/rdf-common/grafter/rdf/protocols.clj
@@ -1,6 +1,9 @@
 (ns grafter.rdf.protocols
   "Grafter protocols and types for RDF processing"
+  (:require [grafter.vocabularies.xsd :refer :all]
+            [grafter.url :refer [->java-uri]])
   (:import [java.net URI]
+           [java.util Date]
            [org.openrdf.model Literal]))

 (defprotocol IStatement
@@ -82,8 +85,6 @@
   (raw-value [this])
   (datatype-uri [this]))

-(def xsd:string (java.net.URI. "http://www.w3.org/2001/XMLSchema#string"))
-
 (def rdf:langString (java.net.URI. "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"))

 ;; TODO add tests to ensure that datatype-uri's etc are right
@@ -146,6 +147,88 @@

   IRDFString
   (language [this]
+    nil))
+
+(extend-protocol IRDFLiteral
+
+  java.math.BigInteger
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:integer))
+
+  java.math.BigDecimal
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:decimal))
+
+  Boolean
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:boolean))
+
+  Byte
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:byte))
+
+  Date
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:dateTime))
+
+  Double
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:double))
+
+  Float
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:float))
+
+  Integer
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:integer))
+
+  Long
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:integer))
+
+  Short
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:short))
+
+  String
+  (raw-value [t]
+    t)
+
+  (datatype-uri [t]
+    (->java-uri xsd:string))
+
+  (language [t]
     nil))

 (defn- destructure-quad [quad i default]


Formatting

Formatting

--- src/clj/clojurewerkz/statistiker/clustering/dbscan.clj
+++ src/clj/clojurewerkz/statistiker/clustering/dbscan.clj
@@ -16,8 +16,9 @@
     (->> initial
          (map u/double-point)
          (.cluster clusterer)
-         (map #(hash-map :points (map (fn [a] (with-meta (vec (.getPoint a))
-                                               (.getMetadata a)))
+         (map #(hash-map :points (map (fn [a]
+                                        (with-meta (vec (.getPoint a))
+                                          (.getMetadata a)))
                                       (.getPoints %)))))))

 (defn cluster-by


fix replicas graph in case of shutdown service / not running tasks

--- src/cljs/swarmpit/component/service/info/settings.cljs
+++ src/cljs/swarmpit/component/service/info/settings.cljs
@@ -39,8 +39,7 @@
     (html [:span image])))

 (rum/defc form-replicas < rum/static [tasks]
-  (let [desired-tasks (filter #(= "running" (:desiredState %)) tasks)
-        data (->> desired-tasks
+  (let [data (->> tasks
                   (map (fn [task]
                          (if (= "running" (:state task))
                            {:name  (:taskName task)
@@ -54,7 +53,7 @@
                   (into []))]
     (chart/pie
       data
-      (str (count desired-tasks) " " (inflect/pluralize-noun (count desired-tasks) "replica"))
+      (str (count tasks) " " (inflect/pluralize-noun (count tasks) "replica"))
       "Swarmpit-service-replicas-graph"
       "replicas-pie"
       {:formatter (fn [value name props]
@@ -62,7 +61,8 @@

 (defn- form-command [command]
   (when command
-    (html [:pre {:style {:fontSize "0.9em"
+    (html [:pre {:key   "command"
+                 :style {:fontSize "0.9em"
                          :margin   0}}
            (let [merged (str/join " " command)]
              (if (< 100 (count merged))
@@ -130,6 +130,7 @@
   (let [image-digest (get-in service [:repository :imageDigest])
         image (get-in service [:repository :image])
         resources (:resources service)
+        desired-tasks (filter #(not= "shutdown" (:desiredState %)) tasks)
         command (:command service)
         stack (:stack service)
         mode (:mode service)]
@@ -150,7 +151,13 @@
                       (comp/svg icon/edit))})
       (comp/card-content
         {:key "ssccd"}
-        (rum/with-key (form-replicas tasks) "ssccdd")
+        (if (not (empty? desired-tasks))
+          (rum/with-key (form-replicas desired-tasks) "ssccddr")
+          (html
+            [:span {:class "Swarmpit-message"
+                    :key   "ssccddm"}
+             (icon/info {:style {:marginRight "8px"}})
+             [:span "Service has been shut down."]]))
         (form-command command))
       (comp/card-content
         {:key "ssccl"}


+Gianluca and Giovanni,+Gianluca and Luisa

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -653,16 +653,32 @@
                    :human true}
              :propernoun true}}

-      "Giovanni and I"
-      [{:synsem {:cat :noun
-                 :pronoun true
-                 :case :nom
-                 :agr {:gender :masc
-                       :person :1st
-                       :number :plur}
-                 :sem {:human true
-                       :pred :giovanni-and-i}
-                 :subcat '()}}]
+   "Gianluca and Giovanni"
+   {:synsem {:agr {:number :plur
+                   :person :3rd
+                   :gender :masc}
+             :sem {:pred :gianluca-e-giovanni
+                   :human true}
+             :propernoun true}}
+
+   "Gianluca and Luisa"
+   {:synsem {:agr {:number :plur
+                   :person :3rd
+                   :gender :masc}
+             :sem {:pred :gianluca-e-luisa
+                   :human true}
+             :propernoun true}}
+
+   "Giovanni and I"
+   [{:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:gender :masc
+                    :person :1st
+                    :number :plur}
+              :sem {:human true
+                    :pred :giovanni-and-i}
+              :subcat '()}}]

       ;; TODO: account for "give" being ditransitive.
    "give" {:synsem {:cat :verb


fix typo

fix typo

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -689,7 +689,7 @@
                     :pred :go-upstairs
                     :subj {:animate true}}}
     :english {:past "went upstairs"
-              :participle "going upstrairs"
+              :participle "going upstairs"
               :present {:3sing "goes upstairs"}}}

    "grab"  {:synsem {:cat :verb


fix pred for 'changer'

fix pred for 'changer'

--- src/babel/francais/lexicon.clj
+++ src/babel/francais/lexicon.clj
@@ -95,7 +95,7 @@
                      :sem {:pred :drink}}}

    "changer" {:synsem {:cat :verb
-                      :sem {:pred :cambiare}}}
+                      :sem {:pred :change}}}

    "chanter" {:synsem {:cat :verb
                        :sem {:pred :sing}}}


Add suuport EMU unit in litedocx.unit package

--- src/bakyeono/litedocx/unit.clj
+++ src/bakyeono/litedocx/unit.clj
@@ -7,39 +7,51 @@
 ;;; Length units
 ;;; Base conversion
 (defconst cm-per-inch 2.54)
+(defconst inch-per-emu 1/914400)
 (defconst mm-per-cm 10)
 (defconst pt-per-px 3/4)
+(defconst pt-per-twip 1/20)
 (defconst px-per-inch 96)
-(defconst twip-per-pt 20)

 ;;; Reversion
 (defconst inch-per-cm (/ 1 cm-per-inch))
+(defconst emu-per-inch (/ inch-per-emu))
 (defconst cm-per-mm (/ 1 mm-per-cm))
 (defconst px-per-pt (/ 1 pt-per-px))
+(defconst twip-per-pt (/ pt-per-twip))
 (defconst inch-per-px (/ 1 px-per-inch))
-(defconst pt-per-twip (/ 1 twip-per-pt))

 ;;; Combination
-(defconst pt-per-inch (* pt-per-px px-per-inch))
-(defconst pt-per-cm (* pt-per-inch inch-per-cm))
-(defconst pt-per-mm (* pt-per-cm cm-per-mm))
-(defconst px-per-twip (* px-per-pt pt-per-twip))
-(defconst px-per-cm (* px-per-inch inch-per-cm))
-(defconst px-per-mm (* px-per-cm cm-per-mm))
-(defconst twip-per-px (* twip-per-pt pt-per-px))
-(defconst twip-per-inch (* twip-per-px px-per-inch))
-(defconst twip-per-cm (* twip-per-inch inch-per-cm))
-(defconst twip-per-mm (* twip-per-cm cm-per-mm))
+(defconst cm-per-emu (* cm-per-inch inch-per-emu))
+(defconst cm-per-px (* cm-per-inch inch-per-px))
+(defconst cm-per-pt (* cm-per-px px-per-pt))
+(defconst cm-per-twip (* cm-per-pt pt-per-twip))
 (defconst inch-per-mm (* inch-per-cm cm-per-mm))
 (defconst inch-per-pt (* inch-per-px px-per-pt))
 (defconst inch-per-twip (* inch-per-pt pt-per-twip))
-(defconst cm-per-px (* cm-per-inch inch-per-px))
-(defconst cm-per-pt (* cm-per-px px-per-pt))
-(defconst cm-per-twip (* cm-per-pt pt-per-twip))
 (defconst mm-per-inch (* mm-per-cm cm-per-inch))
+(defconst mm-per-emu (* mm-per-inch inch-per-emu))
 (defconst mm-per-px (* mm-per-inch inch-per-px))
 (defconst mm-per-pt (* mm-per-px px-per-pt))
 (defconst mm-per-twip (* mm-per-pt pt-per-twip))
+(defconst pt-per-inch (* pt-per-px px-per-inch))
+(defconst pt-per-emu (* pt-per-inch inch-per-emu))
+(defconst pt-per-cm (* pt-per-inch inch-per-cm))
+(defconst pt-per-mm (* pt-per-cm cm-per-mm))
+(defconst px-per-emu (* px-per-inch inch-per-emu))
+(defconst px-per-cm (* px-per-inch inch-per-cm))
+(defconst px-per-mm (* px-per-cm cm-per-mm))
+(defconst px-per-twip (* px-per-pt pt-per-twip))
+(defconst twip-per-px (* twip-per-pt pt-per-px))
+(defconst twip-per-inch (* twip-per-px px-per-inch))
+(defconst twip-per-emu (* twip-per-inch inch-per-emu))
+(defconst twip-per-cm (* twip-per-inch inch-per-cm))
+(defconst twip-per-mm (* twip-per-cm cm-per-mm))
+(defconst emu-per-cm (* emu-per-inch inch-per-cm))
+(defconst emu-per-mm (* emu-per-cm cm-per-mm))
+(defconst emu-per-px (* emu-per-inch inch-per-px))
+(defconst emu-per-pt (* emu-per-px px-per-pt))
+(defconst emu-per-twip (* emu-per-pt pt-per-twip))

 ;;; Functions
 (defn parse-unit


Smaller initial fiddle

Smaller initial fiddle

--- src/clj/cljsfiddle/handler.clj
+++ src/clj/cljsfiddle/handler.clj
@@ -44,7 +44,7 @@
 (def default-fiddle
   {:fiddle/css "p {\n  color: #f41;\n  font-family: helvetica;\n  font-size: 2em;\n  text-align: center\n}"
    :fiddle/html "
Hello,
\n"
-   :fiddle/cljs "(ns cljsfiddle\n  (:require [domina :as dom]))\n\n(dom/set-html! (dom/by-id \"msg\") \"ClojureScript\")\n"})
+   :fiddle/cljs "(ns cljsfiddle)\n\n(set! (.-innerHTML (.getElementById js/document \"msg\"))\n      \"CLJSFiddle\")\n"})

 (defn parse-ns-form [src]
   (try


changed precondition to avoid divide-by-zero

--- src/clj/forma/matrix/utils.clj
+++ src/clj/forma/matrix/utils.clj
@@ -101,7 +101,7 @@
   Example usage:
     (coll-avg [1 2 3 4]) => 2.5"
   [coll]
-  {:pre [(seq coll)]}
+  {:pre [(pos? (count coll))]}
   (float (/ (reduce + coll) (count coll))))

 (defn revolve


Display doc-lb entries as one of two different icons, depending on whether they are selected

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -13,7 +13,7 @@
             [seesaw.rsyntax]
             [clojure.java.browse]
             [clojure.java.shell]
-            [clojure.java.io]
+            [clojure.java.io :as io]
             [clojure.pprint]
             [clojure.set :as set]
             [clojure.string :as str]
@@ -209,51 +209,50 @@
                                               :special-forms ns-special-forms %1 %2 %3)
                             })

-;; Create maps from names of doc-lb entries to files containing icon
-;; images, and the other direction (to efficiently map selections back
-;; to names, which are used everywhere else in the code).
-
-;;(def icon-dir "file:/Users/jafinger/clj/clj-ns-browser/resources/")
-;;
-;;(def name-to-icon-desc
-;;  {"Doc" (str icon-dir "icon-doc.png"),
-;;   "Source" (str icon-dir "icon-source.png"),
-;;   "Examples" (str icon-dir "icon-examples.png"),
-;;   "Comments" (str icon-dir "icon-comments.png"),
-;;   "See alsos" (str icon-dir "icon-see-also.png"),
-;;   "Value" (str icon-dir "icon-value.png"),
-;;   "Meta" (str icon-dir "icon-meta.png")})
-
-(def name-to-icon-desc
-  {"Doc" (str (clojure.java.io/resource "icon-doc.png")),
-   "Source" (str (clojure.java.io/resource "icon-source.png")),
-   "Examples" (str (clojure.java.io/resource "icon-examples.png")),
-   "Comments" (str (clojure.java.io/resource "icon-comments.png")),
-   "See alsos" (str (clojure.java.io/resource "icon-see-also.png")),
-   "Value" (str (clojure.java.io/resource "icon-value.png")),
-   "Meta" (str (clojure.java.io/resource "icon-meta.png"))})
+
+;; Icons to display when the corresponding strings are selected or not
+;; in the doc-lb listbox.
+(def name-to-icon-descriptions
+  {"Doc"
+   {:icon-unselected (str (io/resource "icon-doc.png")),
+    :icon-selected (str (io/resource "icon-doc-selected-90x24.png"))}
+   "Source"
+   {:icon-unselected (str (io/resource "icon-source.png")),
+    :icon-selected (str (io/resource "icon-source-selected-90x24.png"))}
+   "Examples"
+   {:icon-unselected (str (io/resource "icon-examples.png")),
+    :icon-selected (str (io/resource "icon-examples-selected-90x24.png"))}
+   "Comments"
+   {:icon-unselected (str (io/resource "icon-comments.png")),
+    :icon-selected (str (io/resource "icon-comments-selected-90x24.png"))}
+   "See alsos"
+   {:icon-unselected (str (io/resource "icon-see-also.png")),
+    :icon-selected (str (io/resource "icon-see-also-selected-90x24.png"))}
+   "Value"
+   {:icon-unselected (str (io/resource "icon-value.png")),
+    :icon-selected (str (io/resource "icon-value-selected-90x24.png"))}
+   "Meta"
+   {:icon-unselected (str (io/resource "icon-meta.png")),
+    :icon-selected (str (io/resource "icon-meta-selected-90x24.png"))}
+   })

 (defn update-vals-in-map [m f]
   (reduce (fn [m [k v]]
             (assoc m k (f v)))
           m m))

-(def name-to-icon (update-vals-in-map name-to-icon-desc icon))
-
-(def icon-desc-to-name (set/map-invert name-to-icon-desc))
-
-(defn icon-to-name [i]
-  (icon-desc-to-name (str i)))
-
-(def doc-lb-name-list ["Doc" "Source" "Examples"
+(def name-to-selected-icon
+  (update-vals-in-map name-to-icon-descriptions
+                      (fn [v] (icon (:icon-selected v)))))
+
+(def name-to-unselected-icon
+  (update-vals-in-map name-to-icon-descriptions
+                      (fn [v] (icon (:icon-unselected v)))))
+
+(def doc-lb-value-list ["Doc" "Source" "Examples"
                         "Comments" "See alsos" "Value" "Meta"])
-(def doc-lb-value-list (map name-to-icon doc-lb-name-list))
 (def doc-lb-value-set (set doc-lb-value-list))
 (def doc-lb-cur-order (atom doc-lb-value-list))
-
-;; Needed for handling drag and drop to reorder items in the doc-lb
-;; listbox.
-(def icon-flavor (seesaw.dnd/local-object-flavor javax.swing.ImageIcon))

 (def all-buttons-with-atoms
@@ -290,7 +289,7 @@

 (defn clojuredocs-offline-mode! []
   (let [f (clojuredocs-snapshot-filename)]
-    (if (.exists (clojure.java.io/as-file f))
+    (if (.exists (io/as-file f))
       ;; TBD: Consider trying to handle errors while reading the file.
       (let [s (with-out-str (cd-client.core/set-local-mode! f))]
         [:ok s])
@@ -630,6 +629,14 @@

 ;; Init functions called during construction of a frame with its widget hierarchy

+(defn render-doc-lb-item [renderer info]
+  (let [{:keys [value selected?]} info]
+    (config! renderer
+             :icon (if selected?
+                     (name-to-selected-icon value)
+                     (name-to-unselected-icon value))
+             :text "")))
+
 (defn init-before-bind
   [root]
   (letfn [(id [kw] (select-id root kw))]
@@ -645,11 +652,12 @@
     (config! (id :ns-entries-lbl) :text "0")
     (config! (id :doc-lb)
              :model doc-lb-value-list
+             :renderer render-doc-lb-item
              :drag-enabled? true
              :drop-mode :insert
              :transfer-handler
              (seesaw.dnd/default-transfer-handler
-               :import [icon-flavor
+               :import [seesaw.dnd/string-flavor
                         (fn [{:keys [target data drop? drop-location] :as m}]
                           ;; Ignore anything dropped onto the list that is
                           ;; not in the original set of list elements.
@@ -663,7 +671,8 @@
                               (reset! doc-lb-cur-order new-order)
                               (config! target :model new-order))))]
                :export {:actions (constantly :copy)
-                        :start   (fn [c] [icon-flavor (selection c)])}))
+                        :start   (fn [c] [seesaw.dnd/string-flavor
+                                          (selection c)])}))
     (config! (id :edit-btn) :enabled? false)
     (config! (id :browse-btn) :enabled? false)
     (config! (id :clojuredocs-online-rb) :selected? true)
@@ -694,7 +703,7 @@
     (config! (id :doc-ta) :text "                                                                        ")
     (selection! (id :ns-cbx) "loaded")
     (selection! (id :vars-cbx) "Vars - public")
-    (selection! (id :doc-lb) (name-to-icon "Doc"))))
+    (selection! (id :doc-lb) "Doc")))

 (defn init-after-bind
@@ -728,7 +737,7 @@
          ))
      (selection! (id :ns-cbx) "loaded")
      (selection! (id :vars-cbx) "Vars - public")
-     (selection! (id :doc-lb) (name-to-icon "Doc")))))
+     (selection! (id :doc-lb) "Doc"))))

 (defn bind-all
@@ -950,14 +959,14 @@
       (b/filter (fn [[doc-tf doc-lb]]
 ;;                  (printf "(class doc-lb)=%s (seq doc-lb)='%s' (map ... doc-lb)='%s'\n"
 ;;                          (class doc-lb) (seq doc-lb)
-;;                          (seq (map icon-to-name doc-lb)))
+;;                          (seq doc-lb))
 ;;                  (flush)
                   (not (or (nil? doc-tf)  (= "" doc-tf)
                            (nil? doc-lb) (= "" doc-lb)))))
       (b/transform
         (fn [[doc-tf doc-lb]]
           (future
-            (let [s (render-doc-text doc-tf (map icon-to-name doc-lb))]
+            (let [s (render-doc-text doc-tf doc-lb)]
               (when-not (= s (config (id :doc-ta) :text))
                 (invoke-soon (config! (id :doc-ta) :text s))))))))
     ;;
@@ -992,8 +1001,7 @@
     ;; new text in doc-ta => dis/enable browser button
     (b/bind
       (id :doc-ta)
-      (b/transform (fn [o] (map icon-to-name
-                                (selection (id :doc-lb) {:multi? true}))))
+      (b/transform (fn [o] (selection (id :doc-lb) {:multi? true})))
       (b/transform (fn [o]
         (if (empty? (set/intersection (set o)
                                       #{"Examples" "See alsos" "Comments"}))
@@ -1013,7 +1021,7 @@
 ;;                     (printf "update edit-btn: (class o)=%s o='%s'\n"
 ;;                             (class o) (seq o))
 ;;                     (flush)
-                     (let [doc-set (set (map icon-to-name o))]
+                     (let [doc-set (set o)]
                        (or (doc-set "Source") (doc-set "All")))))
       (b/transform (fn [o]
         (when o (if (meta-when-file (config (id :doc-tf) :text))
@@ -1027,8 +1035,7 @@
     (b/bind
       (apply b/funnel [(id :doc-tf)
                        (b/selection (id :doc-lb) {:multi? true})])
-      (b/transform (fn [[doc-tf doc-lb]] [(config (id :doc-tf) :text)
-                                          (map icon-to-name doc-lb)]))
+      (b/transform (fn [[doc-tf doc-lb]] [(config (id :doc-tf) :text) doc-lb]))
       (b/transform (fn [[fqn doc-lb-sel]]
                      (let [doc-set (set doc-lb-sel)]
                        (if (or (doc-set "Value") (doc-set "All"))
@@ -1046,7 +1053,7 @@
       (b/selection (id :doc-lb) {:multi? true})
       (b/transform (fn [o]
         (when (= (.getName (type (id :doc-ta))) "org.fife.ui.rsyntaxtextarea.RSyntaxTextArea")
-          (let [selected-set (set (map icon-to-name o))]
+          (let [selected-set (set o)]
             (if (= selected-set
                    (set/intersection selected-set
                                      #{"Source" "Examples" "Meta"}))
@@ -1058,7 +1065,7 @@
       (id :browse-btn-atom)
       (b/notify-soon)
       (b/transform (fn [& oo]
-        (let [o (icon-to-name (selection (id :doc-lb)))]
+        (let [o (selection (id :doc-lb))]
           (when-let [fqn (config (id :doc-tf) :text)]
             (future
               (case o


Add display name to all components

Add display name to all components

--- src/cljs/chess/components.cljs
+++ src/cljs/chess/components.cljs
@@ -14,7 +14,10 @@
   (reify
     om/IRender
     (render [_]
-      (dom/div #js {:className (piece-class-name p)} nil))))
+      (dom/div #js {:className (piece-class-name p)} nil))
+    om/IDisplayName
+    (display-name [_]
+      "piece")))

 (defn square [[id p selected] owner {:keys [click-chan]}]
   (reify
@@ -25,7 +28,10 @@
             :id        id
             :onClick   #(put! click-chan id)}
        (if p
-         (om/build piece p))))))
+         (om/build piece p))))
+    om/IDisplayName
+    (display-name [_]
+      "square")))

 (defn board [{:keys [board] :as app-state} owner]
   (reify
@@ -59,4 +65,7 @@
                 (om/set-state! owner :selected nil))
               (if (b/in (deref board) new-selection)
                 (om/set-state! owner :selected new-selection))))
-          (recur))))))
+          (recur))))
+    om/IDisplayName
+    (display-name [_]
+      "board")))


Add replace-movement next & previous. Remove rest of onTouchEnd

--- src/cljs/movement/session.cljs
+++ src/cljs/movement/session.cljs
@@ -24,16 +24,14 @@
                           new-part (assoc part pos (merge old-movement new-movement))]
                       (session/assoc-in! [:movement-session :parts part-number] new-part))
       (or (= :next kw)
-          (= :previous kw)) (let [new-movement (first (shuffle (kw movement)))]
-                              #_(GET "movement" {:params        {:user-id (:user-id (session/get :user))
-                                                               :name    new-movement}
-                                               :handler       (fn [new-movement]
-                                                                (let [old-movement (dissoc movement :next :previous) ; remove data that may not be overwritten by merging with the new movement
-                                                                      part (session/get-in [:movement-session :parts part-number])
-                                                                      pos (first (positions #{movement} part))
-                                                                      new-part (assoc part pos (merge old-movement new-movement))]
-                                                                  (session/assoc-in! [:movement-session :parts part-number] new-part)))
-                                               :error-handler (fn [r] nil)}))
+          (= :previous kw))
+          (let [new-movement-name (first (shuffle (kw movement)))
+                old-movement (dissoc movement :next :previous) ; remove data that may not be overwritten by merging with the new movement
+                part (session/get-in [:movement-session :parts part-number])
+                pos (first (positions #{movement} part))
+                new-movement (get (data/get-movements-map) new-movement-name)
+                new-part (assoc part pos (merge old-movement new-movement))]
+            (session/assoc-in! [:movement-session :parts part-number] new-part))
       :else nil))

 (defn add-movement [category part-number]
@@ -125,16 +123,13 @@
       [:div.pure-g.movement {:id id}
        [:div.pure-u-1
         [:div.pure-g {:style {:cursor 'pointer}}
-         [:div.pure-u-1-5 {:onClick    (fn [e] (.preventDefault e) (reset! expand (not @expand)))
-                           :onTouchEnd (fn [e] (.preventDefault e) (reset! expand (not @expand)))}
+         [:div.pure-u-1-5 {:onClick    (fn [e] (.preventDefault e) (reset! expand (not @expand)))}
           [:img.graphic {:src   (str "http://s3.amazonaws.com/mumrik-movement-images/" image)
                          :title name :alt name}]]
          [:div.pure-u-2-5 {:onClick    (fn [e] (.preventDefault e) (reset! expand (not @expand)))
-                           :onTouchEnd (fn [e] (.preventDefault e) (reset! expand (not @expand)))
                            :style      {:display 'flex :text-align 'center}}
           [:h3.title {:style {:margin 'auto}} name]]
-         [:div.pure-u-1-5 {:onClick    (fn [e] (.preventDefault e) (reset! expand (not @expand)))
-                           :onTouchEnd (fn [e] (.preventDefault e) (reset! expand (not @expand)))}
+         [:div.pure-u-1-5 {:onClick    (fn [e] (.preventDefault e) (reset! expand (not @expand)))}

           [:div.pure-g
            [:div.pure-u-1
@@ -151,15 +146,11 @@
            [:div.pure-u-1
             (when (pos? rest) (r-component {:data rest :name "s pause"}))]]]

-         [:div.pure-u-1-5.set-area {
-                                    :onClick    #(inc-set-completed % m part-number)
-                                    :onTouchEnd #(inc-set-completed % m part-number)
-                                    }
+         [:div.pure-u-1-5.set-area {:onClick    #(inc-set-completed % m part-number)}
           [:div.pure-g
            [:div.pure-u-1
             [:i.fa.fa-minus
              {:onClick    #(dec-set-completed % m part-number)
-              :onTouchEnd #(dec-set-completed % m part-number)
               :style      {:opacity    (when-not performed-sets 0)
                            :color      (when performed-sets 'red)
                            :margin-top 5 :margin-right 5
@@ -204,13 +195,13 @@
              [:input {:style {:margin-left 3 :margin-right 3 :width 75}
                       :id    (str "rest-input" id) :type "number" :defaultValue rest :min 0}]
              [:span "sek"]]
-            [:a.pure-u-1-3.pure-button.pure-button-primary {:style      {:margin "5px 5px 5px 5px"}
-                                                            :onClick    (fn [e] (.preventDefault e) (update-movement {:id id :m m :parts parts :part-number part-number :pos pos}))
-                                                            :onTouchEnd (fn [e] (.preventDefault e) (update-movement {:id id :m m :parts parts :part-number part-number :pos pos}))}
-             "Oppdater"]]
+            [:a.pure-u-1-3.pure-button.pure-button-primary {
+                :style {:margin "5px 5px 5px 5px"}
+                :onClick #(update-movement {:id id :m m :parts parts :part-number part-number :pos pos})
+              } "Oppdater"]]
            [:div.pure-g
             [:a.pure-u.pure-button {:style   {:margin "5px 5px 5px 5px"}
-                                    :onClick #(remove-movement % m part-number) :onTouchEnd #(remove-movement % m part-number)
+                                    :onClick #(remove-movement % m part-number)
                                     :title   "Fjern øvelse"}
              [:i.fa.fa-remove {:style {:color "#CC9999" :opacity 0.8}}]
              "Fjern øvelse"]
@@ -221,17 +212,12 @@
               [:i.fa.fa-random {:style {:color "#99cc99" :opacity 0.8}}] "Bytt ut øvelse"]
             (when previous
               [:a.pure-u.pure-button {:style {:margin "5px 5px 5px 5px"}
-                                      :onClick #(;replace-movement % {:kw :previous :movement m :part-number part-number}
-                                                 )
-                                      :onTouchEnd #(;replace-movement % {:kw :previous :movement m :part-number part-number}
-                                                    ) :title "Bytt med enklere"}
+                                      :onClick #(replace-movement % {:kw :previous :movement m :part-number part-number})
+                                      :title "Bytt med enklere"}
                [:i.fa.fa-arrow-down {:style {:color "#99cc99" :opacity 0.8}}] "Bytt med enklere"])
             (when next
               [:a.pure-u.pure-button {:style {:margin "5px 5px 5px 5px"}
-                                      :onClick #(;replace-movement % {:kw :next :movement m :part-number part-number}
-                                                 )
-                                      ;:onTouchEnd #(;replace-movement % {:kw :next :movement m :part-number part-number}) :title "Bytt med vanskeligere"
-                                    }
+                                      :onClick #(replace-movement % {:kw :next :movement m :part-number part-number})}
                [:i.fa.fa-arrow-up {:style {:color "#99cc99" :opacity 0.8}}]
                "Bytt med vanskeligere"])]])]])))


Escape and blur cause an edit to cancel

Escape and blur cause an edit to cancel

--- src/cljs/retrobard/client.cljs
+++ src/cljs/retrobard/client.cljs
@@ -207,7 +207,7 @@
                          :className "new-environment"}
                     "New Environment")))))

-(defn handle-change [e data edit-key owner]
+(defn handle-change [e data edit-key]
   (om/transact! data edit-key (fn [_] (.. e -target -value))))

 (defn end-edit [text owner cb]
@@ -224,15 +224,18 @@
   (reify
     om/IInitState
     (init-state [_]
-      {:editing false})
+      {:editing false
+       :edit-text (get data edit-key)})
     om/IDidUpdate
     (did-update [this prev-props prev-state]
       (when (and (om/get-state owner :editing)
                  (not (:editing prev-state)))
         (focus-and-set-cursor (om/get-node owner "input"))))
     om/IRenderState
-    (render-state [_ {:keys [editing]}]
-      (let [text (get data edit-key)]
+    (render-state [this {:keys [editing edit-text]}]
+      (let [text (get data edit-key)
+            reset #(om/set-state! owner {:editing false
+                                         :edit-text text})]
         (dom/div #js {:className "note-content"}
                 (dom/p #js {:style (display (not editing))
                             :onClick (fn [el] (om/set-state! owner :editing true))}
@@ -240,15 +243,19 @@
                 (dom/textarea
                  #js {:className "edit-content-input"
                       :style (display editing)
-                      :value text
+                      :value edit-text
                       :ref "input"
-                      :onChange #(handle-change % data edit-key owner)
-                      :onKeyDown #(case (.-keyCode %)
-                                    13 (end-edit text owner on-edit)
-                                    nil)
+                      :onChange #(om/set-state! owner :edit-text (.. % -target -value))
+                      :onKeyDown (fn [e]
+                                   (case (.-keyCode e)
+                                     13 (do (handle-change e data edit-key)
+                                            (end-edit edit-text owner on-edit)
+                                            (.preventDefault e))
+                                     27 (reset)
+                                     nil))
                       :onBlur (fn [e]
                                 (when (om/get-state owner :editing)
-                                  (end-edit text owner on-edit)))}))))))
+                                  (reset)))}))))))

 (defn note-view [app owner]
   (reify


Show LogCat in window

Show LogCat in window

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -177,7 +177,8 @@
   (stop-thread thread)
   (let [project-map (read-project-clj path)
         params (leiningen.droid.utils/get-default-android-params project-map)]
-    (println (:adb-bin params))))
+    (->> (start-process process (:adb-bin params) "logcat" "*:I")
+         (start-thread thread in out))))

 (defn -main
   [& args]


Add SDK path during release again

Add SDK path during release again

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -255,6 +255,7 @@
     (is-android-project? path)
     (do (leiningen.droid.classpath/init-hooks)
       (-> (leiningen.droid/transform-into-release project)
+          add-sdk-path
           leiningen.droid/execute-release-routine))
     (is-ios-project? path)
     (leiningen.fruit/fruit project "release")


Also check :main from project.clj (start ring plugin only if there's no :main defined);

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -129,7 +129,8 @@

 (defn ring-project?
   [path]
-  (-> path read-project-clj :ring some?))
+  (let [{:keys [ring main]} (read-project-clj path)]
+    (and (some? ring) (nil? main))))

 (defn valid-project?
   [path]


Finished correcting calls to error-function

--- src/clojush/simplification.clj
+++ src/clojush/simplification.clj
@@ -74,7 +74,7 @@
                                        (dec how-many))))
                             ;; remove single paren pair
                             (remove-paren-pair program))
-              new-errors (error-function new-program)
+              new-errors (:errors (error-function {:program new-program}))
               new-total-errors (compute-total-error new-errors)] ;simplification bases its decision on raw error; HAH-error could also be used here
           (if (= new-errors errors) ; only keep the simplified program if its error vector is the same as the original program's error vector
             (recur (inc step) new-program new-errors new-total-errors)
@@ -82,7 +82,7 @@

 (defn auto-simplify-from-program
   [p error-function steps print? progress-interval]
-  (let [errs (error-function p)]
+  (let [errs (:errors (error-function {:program p}))]
     (auto-simplify (make-individual :program p
                                     :errors errs
                                     :total-error (reduce + errs)
@@ -191,7 +191,7 @@
                                                              {:max-points (* 10 (count genome))}))
            errors (if (:errors ind)
                     (:errors ind)
-                    (error-function program))]
+                    (:errors (error-function ind)))]
       (when (and (not (zero? print-progress-interval))
                  (or (>= step steps)
                      (zero? (mod step print-progress-interval))))
@@ -207,7 +207,7 @@
         (let [new-genome (apply-simplification-step-to-genome genome simplification-step-probabilities)
               new-program (translate-plush-genome-to-push-program (assoc ind :genome new-genome)
                                                                   {:max-points (* 10 (count genome))})
-              new-errors (error-function new-program)]
+              new-errors (:errors (error-function {:program new-program}))]
           (if (and (= new-errors errors)
                    (<= (count-points new-program) (count-points program)))
             (recur (inc step) new-genome new-program new-errors)


t.r.i.ExceptionInfo extends RuntimeException

--- src/main/clojure/clojure/tools/reader/impl/ExceptionInfo.clj
+++ src/main/clojure/clojure/tools/reader/impl/ExceptionInfo.clj
@@ -7,7 +7,7 @@
 ;;   You must not remove this notice, or any other, from this software.

 (ns ^:skip-wiki clojure.tools.reader.impl.ExceptionInfo
-  (:gen-class :extends java.lang.Exception
+  (:gen-class :extends java.lang.RuntimeException
               :init init
               :constructors {[String clojure.lang.IPersistentMap] [String]
                              [String clojure.lang.IPersistentMap Throwable] [String Throwable]}


bench test code reorganized

bench test code reorganized

--- storm-netty/test/clj/backtype/storm/messaging/bench_test.clj
+++ storm-netty/test/clj/backtype/storm/messaging/bench_test.clj
@@ -9,14 +9,8 @@
 (def task 1)
 (def msg_count 100000)

-(deftest test-netty-perf
-  (time (let [storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
-                    STORM-MESSAGING-NETTY-BUFFER-SIZE 1024000
-                    STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
-                    STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000}
-        context (TransportFactory/makeContext storm-conf)
-        server (.bind context nil port)
+(defn batch-bench [context]
+  (let [server (.bind context nil port)
         client (.connect context nil "localhost" port)]
     (doseq [num  (range 1 msg_count)]
       (let [req_msg (str num)]
@@ -28,22 +22,19 @@
         (is (= req_msg resp_msg))))
     (.close client)
     (.close server)
-    (.term context))))
+    (.term context)))
+
+(deftest test-netty-perf
+  (time (let [storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
+                    STORM-MESSAGING-NETTY-BUFFER-SIZE 1024000
+                    STORM-MESSAGING-NETTY-MAX-RETRIES 10
+                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
+                    STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000}
+              context (TransportFactory/makeContext storm-conf)]
+          (batch-bench context))))

 (deftest test-zmq-perf
   (time (let [storm-conf (merge (read-storm-config)
                           {STORM-MESSAGING-TRANSPORT  "backtype.storm.messaging.zmq"})
-        context (TransportFactory/makeContext storm-conf)
-        server (.bind context nil port)
-        client (.connect context nil "localhost" port)]
-    (doseq [num  (range 1 msg_count)]
-      (let [req_msg (str num)]
-        (.send client task (.getBytes req_msg))))
-    (doseq [num  (range 1 msg_count)]
-      (let [req_msg (str num)
-            resp (.recv server 0)
-            resp_msg (String. (.message resp))]
-        (is (= req_msg resp_msg))))
-    (.close client)
-    (.close server)
-    (.term context))))
+        context (TransportFactory/makeContext storm-conf)]
+          (batch-bench context))))


Fix pagination link for boards.

Fix pagination link for boards.

--- src/oc/storage/representations/board.clj
+++ src/oc/storage/representations/board.clj
@@ -80,9 +80,9 @@
   [board org-slug sort-type access-level params]
   (let [slug (:slug board)
         is-drafts-board? (= slug "drafts")
-        pagination-link (if is-drafts-board? [] (pagination-link org-slug slug sort-type params board))
+        page-link (when-not is-drafts-board? (pagination-link org-slug slug sort-type params board))
         ;; Everyone gets these
-        links (remove nil? [pagination-link
+        links (remove nil? [page-link
                             (self-link org-slug slug :recently-posted)
                             (when-not is-drafts-board?
                               (self-link org-slug slug :recent-activity))


add console.log snippet that was useful when debuggin

--- pedestal-app/test/semtag_web/integration_test.clj
+++ pedestal-app/test/semtag_web/integration_test.clj
@@ -43,5 +43,12 @@

 (comment
   (taxi/take-screenshot :file "out.png")
+  ;; To debug headless browser - inject in template
+  "<script>
+      var logs = [];
+      console.log = function(m) {
+        logs.push(m);
+      };
+    </script>"
   (println "LOGS: ")
   (doseq [log (taxi/execute-script "return logs;")] (println log)))


Allow more types in generated pig scripts

--- pigpen-pig/src/main/clojure/pigpen/pig/script.clj
+++ pigpen-pig/src/main/clojure/pigpen/pig/script.clj
@@ -206,7 +206,8 @@
                    pig-code)
         pig-schema (as-> alias %
                      (map (fn [a t] (str (name a)
-                                         (when t (str ":" (type->pig-type t)))))
+                                         (when (keyword? t) (str ":" (type->pig-type t)))
+                                         (when (string? t) (str ":" t))))
                           %
                           (concat types (repeat nil)))
                      (join ", " %)


remove debug vars

remove debug vars

--- src/restaurant_inspections_api/tasks.clj
+++ src/restaurant_inspections_api/tasks.clj
@@ -125,8 +125,6 @@
          (parse (slurp file)))
        csv-files))

-(def mydbg (atom []))
-
 (defn filter-new-inspections
   "filter the new inspections based in our current DB"
   [inspections]
@@ -146,7 +144,6 @@
          (map :inspection_visit_id)
          (set)
          (set/difference (set inspection-ids))
-         (reset! mydbg)
          (keep #(first (filter (fn [x] (= % (:inspection_visit_id x))) inspections))))))

 (defn process-load-data


s/stories/customers/

s/stories/customers/

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -257,7 +257,7 @@
                        Continuous integration and delivery is revolutionizing the way development teams operate by reducing barriers between your ideas and your production code.
                        Remember, it doesn't count until it ships."]
            [:p
-            [:a.shopify-link (open-ext {:href "/stories/shopify/"})
+            [:a.shopify-link (open-ext {:href "/customers/shopify/"})
              "See how Shopify does it"
              (common/ico :slim-arrow-right)]]]]]
         [:div.home-bottom-shelf


Start tabs & slug fix.

Start tabs & slug fix.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -98,7 +98,7 @@

 (defn postal-address
   ([property_data separator]
-     (str/join separator (postal-address-filter property_data)))
+     (str/trim (str/join separator (postal-address-filter property_data))))
   ([property_data]
      (postal-address property_data ", ")))

@@ -106,10 +106,11 @@
   "Create a slug for a property in the UI"
   [property]
   (let [property_data (:property_data property)]
-    (assoc property :slug (let [property_code (:property_code property)]
-                            (if-let [addr (postal-address property_data)]
-                              (str (or property_code "CODELESS") ", " addr)
-                              property_code)))))
+    (assoc property :slug (let [property_code (get property :property_code "CODELESS")
+                                addr (postal-address property_data)]
+                            (if (empty? addr)
+                              property_code
+                              (str property_code  ", " addr))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Data Fetchers
@@ -600,30 +601,35 @@
                (bs/panel
                 (:slug property-details)
                 [:div.col-md-12
-                 [:div.col-md-4
-                  [:dl.dl-horizontal
-                   [:dt "Property Code"] [:dd (:property_code property_data)]
-                   [:dt "Address"] [:dd (postal-address-html property_data)]
-                   [:dt "Property Type"] [:dd (:property_type property_data)]
-                   [:dt "Built Form"] [:dd (:built_form property_data)]
-                   [:dt "Age"] [:dd (:age property_data)]
-                   [:dt "Ownership"] [:dd (:ownership property_data)]
-                   [:dt "Project Phase"] [:dd (:project_phase property_data)]
-                   [:dt "Monitoring Hierarchy"] [:dd (:monitoring_hierarchy property_data)]
-                   [:dt "Practical Completion Date"] [:dd (:practical_completion_date property_data)]
-                   [:dt "Construction Date"] [:dd (:construction_date property_data)]
-                   [:dt "Conservation Area"] [:dd (:conservation_area property_data)]
-                   [:dt "Listed Building"] [:dd (:listed property_data)]
-                   [:dt "Terrain"] [:dd (:terrain property_data)]
-                   [:dt "Degree Day Region"] [:dd (:degree_day_region property_data)]
-                   ]]
-                 [:div.col-md-2
-                  (when-let [pic (:path (first (:photos property-details)))]
-                    [:img.img-thumbnail.tmg-responsive
-                     {:src (str "https://s3-us-west-2.amazonaws.com/get-embed-data/" pic)}])]
-                 [:div.col-md-6
-                  (for [ti (:technology_icons property_data)]
-                    [:img.tmg-responsive {:src ti :width 80 :height 80}])]
+                 [:ul.nav.nav-tabs {:role "tablist"}
+                  [:li.active [:a {:href "#"} "Overview"]]
+                  [:li [:a {:href "#"} "Profiles"]]
+                  [:li [:a {:href "#"} "Sensor Data"]]]
+                 [:div.col-md-12
+                  [:div.col-md-4
+                   [:dl.dl-horizontal
+                    [:dt "Property Code"] [:dd (:property_code property-details)]
+                    [:dt "Address"] [:dd (postal-address-html property_data)]
+                    [:dt "Property Type"] [:dd (:property_type property_data)]
+                    [:dt "Built Form"] [:dd (:built_form property_data)]
+                    [:dt "Age"] [:dd (:age property_data)]
+                    [:dt "Ownership"] [:dd (:ownership property_data)]
+                    [:dt "Project Phase"] [:dd (:project_phase property_data)]
+                    [:dt "Monitoring Hierarchy"] [:dd (:monitoring_hierarchy property_data)]
+                    [:dt "Practical Completion Date"] [:dd (:practical_completion_date property_data)]
+                    [:dt "Construction Date"] [:dd (:construction_date property_data)]
+                    [:dt "Conservation Area"] [:dd (:conservation_area property_data)]
+                    [:dt "Listed Building"] [:dd (:listed property_data)]
+                    [:dt "Terrain"] [:dd (:terrain property_data)]
+                    [:dt "Degree Day Region"] [:dd (:degree_day_region property_data)]
+                    ]]
+                  [:div.col-md-2
+                   (when-let [pic (:path (first (:photos property-details)))]
+                     [:img.img-thumbnail.tmg-responsive
+                      {:src (str "https://s3-us-west-2.amazonaws.com/get-embed-data/" pic)}])]
+                  [:div.col-md-6
+                   (for [ti (:technology_icons property_data)]
+                     [:img.tmg-responsive {:src ti :width 80 :height 80}])]]
                  [:div.col-md-12
                   (detail-section "Description" (:description property_data))
                   (detail-section "Project Summary" (:project_summary property_data))


Return type hint

Return type hint

--- messaging/src/immutant/messaging.clj
+++ messaging/src/immutant/messaging.clj
@@ -88,7 +88,7 @@
     (disj :client-id)
     (o/boolify :xa)))

-(defn queue
+(defn ^Queue queue
   "Establishes a handle to a messaging queue.

    If given a :context, the context must be remote, and is remembered and
@@ -118,7 +118,7 @@
 (o/set-valid-options! queue
   (o/boolify (o/opts->set Messaging$CreateQueueOption) :durable))

-(defn topic
+(defn ^Topic topic
   "Establishes a handle to a messaging topic.

    If given a :context, the context must be remote, and the context is


(maint) Remove unneeded testdir from test

The analytics tests were creating and deleting a testdir that wasn't needed.
This commit removes the testdir.

--- test/unit/puppetlabs/services/master/master_service_test.clj
+++ test/unit/puppetlabs/services/master/master_service_test.clj
@@ -53,27 +53,23 @@
     (let [version-check-params  (atom {})
           version-check-test-fn (fn [request-values update-server-url]
                                   (swap! version-check-params #(assoc % :request-values request-values
-                                                                        :update-server-url update-server-url)))
-          test-dir (doto "target/master-service-test" fs/mkdir)]
-      (try
-        (with-redefs
-          [version-check/check-for-updates! version-check-test-fn]
-          (logutils/with-test-logging
-            (bootstrap-testutils/with-puppetserver-running-with-mock-jrubies
-             "Mocking is safe here because we're not doing anything with JRubies, just making sure
-             the service starts and makes the right dujour calls"
-             app
-             {:jruby-puppet {:max-active-instances 1
-                             :master-conf-dir "dev-resources/puppetlabs/services/master/master_service_test/conf"}
-              :webserver {:port 8081}
-              :product {:update-server-url "http://notarealurl/"
-                        :name {:group-id "puppets"
-                               :artifact-id "yoda"}}}
-              (is (= {:group-id "puppets" :artifact-id "yoda"}
-                     (get-in @version-check-params [:request-values :product-name])))
-              (is (= "http://notarealurl/" (:update-server-url @version-check-params))))))
-        (finally
-          (fs/delete-dir test-dir)))))
+                                                                        :update-server-url update-server-url)))]
+      (with-redefs
+       [version-check/check-for-updates! version-check-test-fn]
+        (logutils/with-test-logging
+         (bootstrap-testutils/with-puppetserver-running-with-mock-jrubies
+          "Mocking is safe here because we're not doing anything with JRubies, just making sure
+          the service starts and makes the right dujour calls"
+          app
+          {:jruby-puppet {:max-active-instances 1
+                          :master-conf-dir "dev-resources/puppetlabs/services/master/master_service_test/conf"}
+           :webserver {:port 8081}
+           :product {:update-server-url "http://notarealurl/"
+                     :name {:group-id "puppets"
+                            :artifact-id "yoda"}}}
+          (is (= {:group-id "puppets" :artifact-id "yoda"}
+                 (get-in @version-check-params [:request-values :product-name])))
+          (is (= "http://notarealurl/" (:update-server-url @version-check-params))))))))

   (testing "master does not make an analytics call to dujour if opt-out exists"
     ; This atom will store the parameters passed to the version-check-test-fn, which allows us to keep the
@@ -82,24 +78,20 @@
     (let [version-check-params  (atom {})
           version-check-test-fn (fn [request-values update-server-url]
                                   (swap! version-check-params #(assoc % :request-values request-values
-                                                                        :update-server-url update-server-url)))
-          test-dir (doto "target/master-service-test" fs/mkdir)]
-      (try
-        (with-redefs
-          [version-check/check-for-updates! version-check-test-fn]
-          (logutils/with-test-logging
-            (bootstrap-testutils/with-puppetserver-running-with-mock-jrubies
-              "Mocking is safe here because we're not doing anything with JRubies, just making sure
-              the service starts and makes the right dujour calls"
-              app
-              {:jruby-puppet {:max-active-instances 1
-                             :master-conf-dir "dev-resources/puppetlabs/services/master/master_service_test/conf"}
-              :webserver {:port 8081}
-              :product {:update-server-url "http://notarealurl/"
-                        :name {:group-id "puppets"
-                               :artifact-id "yoda"}
-                        :check-for-updates false}}
-              (is (= nil (get-in @version-check-params [:request-values :product-name])))
-              (is (= nil (:update-server-url @version-check-params))))))
-        (finally
-          (fs/delete-dir test-dir))))))
+                                                                        :update-server-url update-server-url)))]
+      (with-redefs
+       [version-check/check-for-updates! version-check-test-fn]
+        (logutils/with-test-logging
+         (bootstrap-testutils/with-puppetserver-running-with-mock-jrubies
+          "Mocking is safe here because we're not doing anything with JRubies, just making sure
+          the service starts and makes the right dujour calls"
+          app
+          {:jruby-puppet {:max-active-instances 1
+                          :master-conf-dir "dev-resources/puppetlabs/services/master/master_service_test/conf"}
+           :webserver {:port 8081}
+           :product {:update-server-url "http://notarealurl/"
+                     :name {:group-id "puppets"
+                            :artifact-id "yoda"}
+                     :check-for-updates false}}
+          (is (= nil (get-in @version-check-params [:request-values :product-name])))
+          (is (= nil (:update-server-url @version-check-params)))))))))


add comments to clarify 'reset usage

add comments to clarify 'reset usage

--- dev/user.clj
+++ dev/user.clj
@@ -15,11 +15,13 @@
 ;; N.B.: (ns cljs.user (:use [clojure.zip :only [insert-child]])) (see http://stackoverflow.com/questions/12879027/cannot-use-in-clojurescript-repl)

 (defn go
-  "Initializes the current development system and starts it running."
+  "Start with Datomic."
   []
   (nt-config/start!))

-(defn go-jetty []
+(defn go-jetty
+  "Start with Datomic and Jetty."
+  []
   (nt-config/start! :jetty))

 (defn reset
@@ -28,7 +30,9 @@
      (nt-config/stop!)
      (refresh :after go-fn-symbol)))

-(defn reset-jetty []
+(defn reset-jetty
+  "Convenience fn if you want to reset and have Jetty."
+  []
   (reset 'user/go-jetty))

 (defn touch-that


comments

comments

--- dev/user.clj
+++ dev/user.clj
@@ -75,6 +75,7 @@
   ([]
    (re-init-dev 8080)))

+; parses legacy request log, spitting out URLs we don't understand
 (defn parse-request-log
   [request-log]
   (with-open [reader (clojure.java.io/reader request-log)]


Add fn: add-queue-token! for use with the REPL

--- dev/user.clj
+++ dev/user.clj
@@ -7,6 +7,7 @@
             [clojure.test :as test]
             [datomic.api :as d]
             [galleon]
+            [gangway.auth :as gw-auth]
             [navigator]))

 (defn stop! []
@@ -46,6 +47,13 @@
   [query & data-sources]
   (pprint (apply touch-that query data-sources)))

+(defn add-queue-token!
+  "Add a token to use the queues, takes an owner as a string
+   and an exipration time expressed in the number of months from
+   the current time as an int"
+  [owner expire]
+  (pprint (gw-auth/add-queue-token! owner expire (:db-conn galleon/system))))
+
 (comment
   (navigator/create-competency (:db-conn galleon/system) "comp1" "v1" :comp.status/active)
   (ptouch-that '[:find ?e :where [?e :comp/name]])


Instrument everything when testing

Instrument everything when testing

--- test/clj_chrome_devtools/chrome_test.clj
+++ test/clj_chrome_devtools/chrome_test.clj
@@ -3,7 +3,10 @@
   (:require [clj-chrome-devtools.automation.fixture :refer [create-chrome-fixture]]
             [clj-chrome-devtools.automation :refer :all]
             [clojure.test :as t :refer [deftest is testing]]
-            [clojure.java.io :as io]))
+            [clojure.java.io :as io]
+            [clojure.spec.test.alpha :as stest]))
+
+(stest/instrument)

 (defonce chrome-fixture (create-chrome-fixture))
 (t/use-fixtures :each chrome-fixture)


CMR-1980: Working recursive parse-hierarchical-keywords

--- search-app/src/cmr/search/api/keyword.clj
+++ search-app/src/cmr/search/api/keyword.clj
@@ -18,15 +18,6 @@
       :bad-request (format "The keyword scheme [%s] is not supported. Valid schemes are: %s"
                            (name keyword-scheme)
                            (pr-str (map name (keys kms/keyword-scheme->field-names)))))))
-
-; (defn- parse-hierarchical-keywords
-;   "Returns keywords in a hierarchical fashion for the given keyword scheme and keywords."
-;   [keyword-scheme keyword-hierarchy keywords]
-;   (when-let [subfield (first keyword-hierarchy)]
-;     (let [all-values-for-subfield (map subfield keywords)]
-;       (for [value all-values-for-subfield]
-;         (parse-hierarchical-keywords keyword-scheme (rest keyword-hierarchy) keywords)))))
-

 ;; Sample output

@@ -90,8 +81,32 @@
     {:category all-topics})

-  (parse-hierarchical-keywords :science-keywords keyword-hierarchy keywords)
- )
+  {:category (parse-hierarchical-keywords keyword-hierarchy keywords nil nil)}
+
+  (def keywords
+   (vals (kms/get-keywords-for-keyword-scheme
+           {:system (cmr.indexer.system/create-system)} :science-keywords)))
+  )
+
+(defn- parse-hierarchical-keywords
+  "Returns keywords in a hierarchical fashion for the given keyword scheme and keywords."
+  [keyword-hierarchy keywords prev-field prev-value]
+  (when-let [field (first keyword-hierarchy)]
+    (let [next-field (second keyword-hierarchy)]
+      (let [values-for-field (keep (fn [k-word] (when (and (nil? (next-field k-word))
+                                                           (field k-word)
+                                                           (or (nil? prev-field)
+                                                               (= prev-value (prev-field k-word))))
+                                                  {:value (field k-word)
+                                                   :uuid  (:uuid k-word)})) keywords)]
+        (for [value values-for-field
+              :let [subfields (parse-hierarchical-keywords
+                                (rest keyword-hierarchy) keywords field (:value value))]]
+          (if (seq subfields)
+            (assoc value
+                   :subfields [(name next-field)]
+                   next-field subfields)
+            value))))))

 (def keyword-api-routes
   (context "/keywords" []


Update mapping to be compatible with es 2.3

--- src/ctia/stores/es/mapping.clj
+++ src/ctia/stores/es/mapping.clj
@@ -4,6 +4,8 @@
 ;; It aschews nested objects since they are performance risks, and
 ;; restricts the _all to a minimal set.

+;; not that fields with the same name, nee to have the same mapping,
+;; even in different entities.  That means

 (def ts {:type "date" :format "date_time"})

@@ -27,12 +29,12 @@

 (def attack-pattern
   {:properties
-   {:description text
+   {:description all_text
     :capec_id string}})

 (def malware-instance
   {:properties
-   {:description text
+   {:description all_text
     :malware_type string}})

 (def observable
@@ -55,7 +57,7 @@

 (def tool
   {:properties
-   {:description text
+   {:description all_text
     :type string
     :references string
     :vendor string
@@ -64,7 +66,7 @@

 (def infrastructure
   {:properties
-   {:description text
+   {:description all_text
     :type string}})

 (def related-identities
@@ -77,7 +79,7 @@

 (def tg-identity
   {:properties
-   {:description text
+   {:description all_text
     :related_identities related-identities}})

 (def victim-targeting
@@ -96,7 +98,7 @@
 (def activity
   {:properties
    {:date_time ts
-    :description text}})
+    :description all_text}})

 (def related-indicators
   {:properties
@@ -172,7 +174,7 @@
 (def affected-asset
   {:properties
    {:type string
-    :description text
+    :description all_text
     :ownership_class string
     :management_class string
     :location_class string
@@ -236,10 +238,10 @@
 (def vulnerability
   {:properties
    {:title all_string
-    :description text
+    :description all_text
     :is_known {:type "boolean"}
     :is_public_acknowledged {:type "boolean"}
-    :short_description text
+    :short_description all_text
     :cve_id string
     :osvdb_id string
     :source string
@@ -250,13 +252,13 @@

 (def weakness
   {:properties
-   {:description text
+   {:description all_text
     :cwe_id string}})

 (def configuration
   {:properties
-   {:description text
-    :short_description text
+   {:description all_text
+    :short_description all_text
     :cce_id string}})

 (def sighting
@@ -283,7 +285,7 @@
      :confidence string
      :severity {:type "integer"}
      :valid_time valid-time
-     :reason text
+     :reason all_text
      :source_uri string
      :reason_uri string
      :indicators related-indicators
@@ -301,7 +303,7 @@
      :judgement string
      :source string
      :feedback {:type "integer"}
-     :reason string
+     :reason all_text
      :owner string
      :created ts
      :modified ts}}})
@@ -345,7 +347,7 @@
     :include_in_all false
     :properties
     {:id all_string
-     :title all_text
+     :title all_string
      :description all_text
      :type string
      :valid_time valid-time
@@ -359,7 +361,7 @@
      :source string
      :ttp_type string
      :expires ts
-     :indicators all_string
+     :indicators related-indicators
      :owner string
      :created ts
      :modified ts}}})
@@ -370,7 +372,7 @@
     :include_in_all false
     :properties
     {:id all_string
-     :title all_text
+     :title all_string
      :description all_text
      :type string
      :valid_time valid-time
@@ -396,7 +398,7 @@
     :properties
     {:id all_string
      :type string
-     :title all_text
+     :title all_string
      :description all_text
      :valid_time valid-time
      :names all_string
@@ -422,7 +424,7 @@
     :properties
     {:id all_string
      :type string
-     :title all_text
+     :title all_string
      :description all_text
      :valid_time valid-time
      :stage string
@@ -444,7 +446,7 @@
     :properties
     {:id all_string
      :type string
-     :title all_text
+     :title all_string
      :description all_text
      :valid_time valid-time
      :confidence string
@@ -482,7 +484,7 @@
     :properties
     {:id all_string
      :type string
-     :title all_text
+     :title all_string
      :description all_text
      :valid_time valid-time
      :version string


formatting

formatting

--- test/onyx/plugin/input_log_kill_test.clj
+++ test/onyx/plugin/input_log_kill_test.clj
@@ -73,8 +73,7 @@
       (ensure-datomic! db-uri people2))))

 (deftest ^:ci datomic-input-log-kill-test
-  (let [
-        {:keys [env-config peer-config datomic-config]}
+  (let [{:keys [env-config peer-config datomic-config]}
         (read-config (clojure.java.io/resource "config.edn") {:profile :test})
         db-uri (str (:datomic/config datomic-config) (java.util.UUID/randomUUID))
         job (build-job db-uri 10 1000)


Improved description for the download dependencies checkbox.

--- ccw.support.examples/src/ccw/support/examples/labrepl/wizards/LabreplCreateProjectPage.clj
+++ ccw.support.examples/src/ccw/support/examples/labrepl/wizards/LabreplCreateProjectPage.clj
@@ -41,7 +41,7 @@
     (let [run-lein-deps-button (Button. composite SWT/CHECK)
           run-repl-button (Button. composite SWT/CHECK)]
       (doto run-lein-deps-button
-        (.setText "Run \"lein deps\" to download dependencies (Internet connection required)")
+        (.setText "Run \"lein deps\" to download dependencies (Internet connection required,\ndownloads third-party software from Clojars repository)")
         (.setSelection true)
         (.addSelectionListener
           (proxy [SelectionAdapter] []


Fixed bug where refs were not visible after execution caused by update in the library examples.

--- src/clj_formal_specifications_app/spec.clj
+++ src/clj_formal_specifications_app/spec.clj
@@ -12,7 +12,7 @@

 (defn spec-ref-entry?
   [map-entry]
-  (contains? (meta (var-get (val map-entry))) :spec-ref))
+  (contains? (meta (val map-entry)) :spec-ref))

 (defn conj-actions
   [actions action-entry]


4clojure:: impl the triangle-min-path (hard) graph algorithms

--- src/clojure_learning/triangle_min_path.clj
+++ src/clojure_learning/triangle_min_path.clj
@@ -10,29 +10,114 @@
     (use [clojure.repl])
     (require [clojure.test :refer :all]))

-(defn find-min-path
-  [points]
-  (let [exp (int (Math/pow 2 (count points)))]
-     (reduce
-       (fn [acc v]
-          (conj acc
-              (reduce
-                  (fn [inner-acc el] (into inner-acc (repeat exp el)))
-                  [] v)))
-        [] points)))
+(defn triangle-min-path
+  [points]
+  (letfn [(repeat-each-times [vov times]
+            (letfn [(-repeat-each-times
+                      [[head & tail] curr times repeated]
+                      (if (or (zero? times) (nil? head)) repeated
+                        (if (zero? curr)
+                          (recur tail times times (conj repeated head))
+                          (recur (cons head tail) (dec curr) times (conj repeated head)))))]
+                (-repeat-each-times vov (dec times) (dec times) [])))
+          (repeat-matrix [[head-xs & tail-xs] times matrix-repeated]
+            (if (nil? head-xs) matrix-repeated
+              (recur tail-xs (dec times) (conj matrix-repeated (repeat-each-times head-xs times)))))
+          (trim-sides [xs how-many]
+            (reverse
+              (drop how-many
+                    (reverse
+                        (drop how-many xs)))))
+         (trim-sides-by-first [matrix]
+            (reduce
+              (fn [acc xs]
+                (let [half-diff (quot (- (count xs) (count (last acc))) 2)]
+                  (conj acc (trim-sides xs half-diff))))
+              [(first matrix)] (rest matrix)))]

+      (->>
+          (-> (repeat-matrix points ((comp inc inc count) points) [])
+              trim-sides-by-first)
+        (apply map vector)  ;; transpose to cols: map can take as many colls: will map as vector x1 y1... x2 y2...
+        (map #(reduce + %)) ;; build sum list
+        (apply min))
+))

-(deftest test-find-min-path
+(triangle-min-path '([1]
+                [2 4]
+               [5 1 4]
+              [2 3 4 5])) ;; 7 -> NICE :
+
+(triangle-min-path '([3]
+                [2 4]
+               [1 9 3]
+              [9 9 2 4]
+             [4 6 6 7 8]
+            [5 7 3 5 1 4])) ;; 20:: 3->4->3->2->7->1
+
+;; let's build a function which takes
+(defn repeat-each-times [vov times]
+  "func that: sequential number-of-times -> sequential of each element duplicated the number-of-times"
+  (letfn [(-repeat-each-times [[head & tail] curr times repeated]
+            (if (or (zero? times) (nil? head)) repeated
+              (if (zero? curr)
+                (recur tail times times (conj repeated head))
+                (recur (cons head tail) (dec curr) times (conj repeated head)))))]
+    (-repeat-each-times vov (dec times) (dec times) [])))
+
+(deftest test-repeat-each-times
+  (testing "func should duplicate the elements of a sequential the number-of-times"
+    (is
+      (= [1 1 3 3] (repeat-each-times [1 3] 2)) ;; true
+      (= [2 2 2 4 4 4] (repeat-each-times [2 4] 3)) ;; true
+      (= [1 1 1] (repeat-each-times [1] 3)) ;; true
+  )))
+
+(defn trim-sides [xs how-many]
+  "function that takes a coll and trims the l-side and r-side with the number of items"
+  (reverse (drop how-many (reverse (drop how-many (vec xs))))))
+
+(deftest test-trim-sides
+  (testing "trim-sides func which drops the leading + trailing num of elements from a sequence"
+    (is (= (list 3) (trim-sides [1 2 3 4 5] 2)))  ;; true
+))
+
+(defn trim-sides-by-last [matrix]
+  (reduce
+    (fn [acc xs]
+      (let [half-diff (quot (- (count xs) (count (last acc))) 2)]
+      (conj acc (trim-sides xs half-diff))))
+    [(last matrix)] (butlast matrix)))
+
+(deftest test-trim-sides-by-last
+  (testing "should trim the sides of each row from matrix by last matrix-row num of elements"
+    (is (= [[1 2 3 4 5 6 7 8] [3 4 5 6 7 8 9 10]] (trim-sides-by-last [[1 2 3 4 5 6 7 8 9 10 11 12] [1 2 3 4 5 6 7 8]])))
+)) ;; true
+
+(defn trim-sides-by-first [matrix]
+  (reduce
+    (fn [acc xs]
+      (let [half-diff (quot (- (count xs) (count (last acc))) 2)]
+      (conj acc (trim-sides xs half-diff))))
+    [(first matrix)] (rest matrix)))
+
+(deftest test-trim-sides-by-first
+  (testing "should trim the sides of each row from matrix by first matrix-row num of elements"
+    (is (= [[1 2 3 4 5 6 7 8] [3 4 5 6 7 8 9 10]] (trim-sides-by-first [[1 2 3 4 5 6 7 8] [1 2 3 4 5 6 7 8 9 10 11 12]])))
+)) ;; true
+
+;; ultimate abs test :)
+(deftest test-triangle-min-path
   (testing "triangle-min-path to find the min path and reduce it using add func"
-      (is (= 7 (find-min-path '([1]
+      (is (= 7 (triangle-min-path '([1]
                                [2 4]
                               [5 1 4]
-                             [2 3 4 5]))))
-  ))
-;; 1->2->1->3
+                             [2 3 4 5])))) ;; true:: 1->2->1->3

-(Math/pow 2 2)
-(find-min-path '([1]
-                [2 4]
-               [5 1 4]
-              [2 3 4 5]))
+      (is (= 20 (triangle-min-path '([3]
+                                [2 4]
+                               [1 9 3]
+                              [9 9 2 4]
+                             [4 6 6 7 8]
+                            [5 7 3 5 1 4])))) ;; fail: 26 != 20:: 3->4->3->2->7->1
+))


handling clojure.couchdb exception in case that the document is missing

--- src/com/narkisr/couchfs/initialization.clj
+++ src/com/narkisr/couchfs/initialization.clj
@@ -2,9 +2,17 @@
   (:import com.narkisr.protocols.Directory
            com.narkisr.protocols.Root
            com.narkisr.protocols.MetaFolder
-           com.narkisr.protocols.File)
-  (:require [com.narkisr.couchfs.couch-access :as couch])
-  (:use (com.narkisr (file-info :only [fname parent-path combine parent-name file-path un-hide hide]) (fs-logic ))))
+           com.narkisr.protocols.File
+           couchdb.errors.DocumentNotFound)
+  (:require
+    [com.narkisr.couchfs.couch-access :as couch]
+     [couchdb.errors]
+    )
+  (:use
+    [slingshot.slingshot :only [try+]]
+    (com.narkisr
+      (file-info :only [fname parent-path combine parent-name file-path un-hide hide])
+      (fs-logic))))

 (defn- inner-file [file-name desc mime content-fn size-fn couch-id ]
   (File. file-name 0644 [:description desc :mimetype mime :couch-id couch-id] (/ (System/currentTimeMillis) 1000) content-fn size-fn))
@@ -15,12 +23,16 @@

 (defn attachment [couch-id file-name details]
   (with-xattr [:attachment true]
-              (inner-file file-name  "A Couchdb document attachment" (details :content_type) (couch/couch-attachment-content couch-id file-name) #(details :length) couch-id) ))
+    (inner-file file-name  "A Couchdb document attachment" (details :content_type) (couch/couch-attachment-content couch-id file-name) #(details :length) couch-id) ))
+
+(defn safe-attaments [couch-id]
+  (try+ (couch/attachments couch-id)
+        (catch DocumentNotFound _ [])))

 (defn- attachments [couch-id]
   (reduce
     (fn [res [file-name details]]
-      (assoc res file-name (attachment couch-id file-name details))) {} (couch/attachments couch-id)))
+      (assoc res file-name (attachment couch-id file-name details))) {} (safe-attaments couch-id)))

 (defn meta-folder [couch-id hidden]
   (MetaFolder. hidden 0444 [:description "Couch meta folder"] (/ (System/currentTimeMillis) 1000) (json-file couch-id)))


disconnect in :after fixture

disconnect in :after fixture

--- test/server/socketio-interface-test.cljs
+++ test/server/socketio-interface-test.cljs
@@ -27,7 +27,9 @@
                (.on socket "connect" (fn []
                                        (println "Connected to server!")
                                        (done)))))
-   :after  fixtures/flush-all})
+   :after  (fn []
+             (.disconnect socket)
+             (fixtures/flush-all))})

 (deftest sign-in
   (let [username "test-username-sign-in"


Better docstring for open-tabular-file.

Better docstring for open-tabular-file.

--- src/grafter/tabular/common.clj
+++ src/grafter/tabular/common.clj
@@ -61,7 +61,12 @@

 (defmulti open-tabular-file
   "Takes a File or String as an argument and coerces it based upon its
-file extension into a concrete grafter table.
+file extension into its concrete low-level representation, provided by
+the file adapter.
+
+This is intended to be used by adapter developers, and developers who
+need access to low level details.  Specific to the adapter.  Normal
+users should prefer open-all-datasets.

 Supported files are currently csv or Excel's xls or xlsx files.


write to type

write to type

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -182,7 +182,7 @@
                                                       false)}
                                      ;; TODO: experiment with a contentEditable div
                                      (dom/input #js {:type "text"
-                                                     :placeholder "Write something..."
+                                                     :placeholder "Type something..."
                                                      :value (or (:layer/text layer) "")
                                                      ;; TODO: defaults for each layer when we create them
                                                      :style (clj->js (merge text-style


trim input text before saving

trim input text before saving

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -53,7 +53,7 @@
                                                                        (throw "Couldn't create doc."))))]
                                                     (d/transact! issue-db [{:db/id -1
                                                                             :issue/created-at (datetime/server-date)
-                                                                            :issue/title issue-title
+                                                                            :issue/title (str/trim issue-title)
                                                                             :issue/author (:cust/email cust)
                                                                             :issue/document doc-id
                                                                             :frontend/issue-id fe-id}])
@@ -110,7 +110,7 @@
                                               (d/transact! issue-db [{:db/id issue-id
                                                                       :issue/comments (merge {:db/id -1
                                                                                :comment/created-at (datetime/server-date)
-                                                                                :comment/body comment-body
+                                                                                :comment/body (str/trim comment-body)
                                                                                :comment/author (:cust/email cust)
                                                                                :frontend/issue-id (utils/squuid)}
                                                                                (when parent-id
@@ -155,7 +155,7 @@
             submit #(do (utils/stop-event %)
                         (when issue-description
                           (d/transact! issue-db [{:db/id (:db/id issue)
-                                                  :issue/description issue-description}]))
+                                                  :issue/description (str/trim issue-description)}]))
                         (clear-form))]
         (html
          (if editing?


pixelfont example

pixelfont example

--- examples/pixelfont/src/pixelfont/core.cljs
+++ examples/pixelfont/src/pixelfont/core.cljs
@@ -1,17 +1,40 @@
 (ns pixelfont.core
-  (:require ))
+  (:require [infinitelives.pixi.canvas :as c]
+            [infinitelives.pixi.events :as e]
+            [infinitelives.pixi.resources :as r]
+            [infinitelives.pixi.texture :as t]
+            [infinitelives.pixi.sprite :as s]
+            [infinitelives.pixi.pixelfont :as pf]
+            [cljs.core.async :refer [<!]])
+  (:require-macros [cljs.core.async.macros :refer [go]]
+                   [infinitelives.pixi.macros :as m]
+                   [infinitelives.pixi.pixelfont :as pf]))

-(enable-console-print!)
+(defonce canvas
+  (c/init {:layers [:bg]
+           :background 0x404040
+           :expand true}))

-(println "Edits to this text should show up in your developer console.")
+(defonce main-thread
+  (go
+    (<! (r/load-resources canvas :bg ["img/fonts.png"]))

-;; define your app data so that it doesn't get over-written on reload
-
-(defonce app-state (atom {:text "Hello world!"}))
+    (pf/pixel-font :big "img/fonts.png" [127 84] [250 128]
+                   :chars ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                           "abcdefghijklmnopqrstuvwxyz"
+                           "0123456789!?#`'.,"])

-(defn on-js-reload []
-  ;; optionally touch your app-state to force rerendering depending on
-  ;; your application
-  ;; (swap! app-state update-in [:__figwheel_counter] inc)
-)
+    (m/with-sprite canvas :bg
+      [text (pf/make-text :big "TestWordage")]
+      (while true (<! (e/next-frame)))
+      )
+
+    ;(t/set-texture! :font (r/get-texture :fonts :nearest))
+
+    #_ (m/with-sprite canvas :bg
+      [rabbit (s/make-sprite :font :xhandle 0.2 :yhandle 0.2 :scale 2)]
+      (loop [angle 0]
+        ;(s/set-rotation! rabbit angle)
+        (<! (e/next-frame))
+        (recur (+ 0.01 angle))))))


Correct cue clicks when not at origin page.

--- src/afterglow/web/routes/show_control.clj
+++ src/afterglow/web/routes/show_control.clj
@@ -163,7 +163,7 @@
   [page-info kind]
   (let [[left bottom] (:view page-info)
         [_ column row] (clojure.string/split kind #"-")
-        [x y] (map + (map #(Integer/valueOf %) [column row]) [bottom left])
+        [x y] (map + (map #(Integer/valueOf %) [column row]) [left bottom])
         [cue active] (show/find-cue-grid-active-effect (:show page-info) x y)]
     (if cue
       (with-show (:show page-info)


add issuer image to endorsement modal

add issuer image to endorsement modal

--- src/cljs/salava/badge/ui/endorsement.cljs
+++ src/cljs/salava/badge/ui/endorsement.cljs
@@ -19,6 +19,7 @@

     [:div {:style {:margin-bottom "20px"}}
      [:h5
+      (when (:image_file issuer) [:img {:src (str "/" (:image_file issuer)) :style {:width "65px" :height "auto" :padding "7px"}}])
       [:a {:href "#"
            :on-click #(do (.preventDefault %) (mo/set-new-view [:badge :issuer] (:id issuer)))
            } (:name issuer)]


free ips list

free ips list

--- src/hypervisors/networking.clj
+++ src/hypervisors/networking.clj
@@ -147,6 +147,11 @@
   [hyp]
   (map #( -> % (Long/parseLong) long-to-ip) (wcar (car/zrangebyscore (ips-key hyp) 1 1))))

+(defn list-free-ips
+  "List free ips in human readable form (mainly for debugging)."
+  [hyp]
+  (map #( -> % (Long/parseLong) long-to-ip) (wcar (car/zrangebyscore (ips-key hyp) 0 0))))
+
 #_(celestial.model/set-env :dev (list-used-ips :proxmox))

 (defn correlate


figwheel.main: expand and document config schema

--- figwheel-main/src/figwheel/main/schema.clj
+++ figwheel-main/src/figwheel/main/schema.clj
@@ -17,19 +17,28 @@
                      [::figwheel-core
                       ::hot-reload-cljs
                       ::load-warninged-code
+                      ::validate-config
+                      ::rebel-readline
+                      ::watch-time-ms
+                      ::pprint-config
+                      ::mode
                       ::watch-dirs
-                      ::reload-clj-files
+                      ::css-dirs
                       ::ring-handler
                       ::ring-server
                       ::ring-server-options
                       ::ring-stack
                       ::ring-stack-options
-                      ::mode
-                      ::pprint-config
+
+                      ::reload-clj-files
                       ::open-file-command
                       ::client-print-to
-                      ::validate-config
-                      ::rebel-readline
+                      ::log-level
+                      ::log-file
+                      ::log-syntax-error-style
+                      ::ansi-color-output
+                      ::target-dir
+
                       ]))

 (s/def ::figwheel-core boolean?)
@@ -96,35 +105,218 @@
   :wait-time-ms 50")

 (s/def ::pprint-config boolean?)
+(spec-doc
+ ::pprint-config
+ "When :pprint-config is set to true. The figwheel.main will print the
+computed config information and will terminate the process. Useful for
+understanding what figwheel.main adds to your configuration before it
+compiles your build.
+Default: false
+
+:pprint-config true")

 (s/def ::mode #{:build-once :repl :serve})
+(spec-doc
+ ::mode
+ "The mode indicates the behavior that occurs after a compile.
+
+:repl indicates that repl sill be started
+:serve indicates that a server will be started
+:build-once indicates that a compile will not be follwed by any action
+
+This is mainly intended for use when you are launching figwheel.main from a script.
+
+Normally defaults to :repl")
+

 (s/def ::watch-dirs (s/coll-of (s/and non-blank-string?
                                       directory-exists?)))
+(spec-doc
+ ::watch-dirs
+ "A list of ClojureScript source directories to be watched and compiled on change.
+
+:watch-dirs [\"cljs-src\"]")
+

 (s/def ::css-dirs (s/coll-of (s/and non-blank-string?
                                     directory-exists?)))
-
-;; TODO make this verify that the handler exists
+(spec-doc
+ ::css-dirs
+ "A list of CSS source directories to be watched and reloaded into the browser.
+
+:css-dirs [\"resource/public/css\"]")
+
+;; TODO make this verify that the handler exists?
 (s/def ::ring-handler (s/or :non-blank-string non-blank-string?
                             :symbol symbol?))
+(spec-doc
+ ::ring-handler
+ "A symbol or string indicating a ring-handler to embed in the
+figwheel.repl server. This aids in quickly getting a dev server up and
+running. If the devserver doesn't meet your needs you can simply start
+your own server, the figwheel.client will still be able to connect to its
+websocket endpoint. Default: none")
+
+(s/def ::ring-server-options (s/keys :opt-un [::port]))
+(spec-doc
+ ::ring-server-options
+ "All the options to forward to the ring-jetty-adapter/run-jetty function
+which figwheel.main uses to run its ring server.
+
+All the available options are documented here:
+https://github.com/ring-clojure/ring/blob/master/ring-jetty-adapter/src/ring/adapter/jetty.clj#L127
+
+This will normally be used to set the :port and :host of the server.
+
+Most uses of these options are considered advanced if you find
+yourself using many of these options you problably need to run your
+own server outside of figwheel.main.")
+
+(s/def ::ring-stack (s/or :non-blank-string non-blank-string?
+                          :symbol symbol?))
+
+(spec-doc
+ ::ring-stack
+ "The fighweel.repl server has a notion of
+a :ring-stack. The :ring-stack is a set of base ring-middleware to
+wrap around a supplied :ring-handler.
+
+The default :ring-stack is a slightly modified
+ring.middleware.defaults/wrap-defaults")
+
+(s/def ::ring-stack-options map?)
+(spec-doc
+ ::ring-stack-options
+ (str "The fighweel.repl server has a notion of
+a :ring-stack. The :ring-stack is a set of base ring-middleware to
+wrap around a supplied :ring-handler.
+
+The default :ring-stack is a slightly modified
+ring.middleware.defaults/wrap-defaults.
+
+:ring-stack-options are the options that figwheel.repl supplies to
+ring.middleware.defaults/wrap-defaults.
+
+The default options are slightly modified from ring.middleware.defaults/site-defaults:
+
+" (when-let [opt (resolve 'figwheel.server.ring/default-options)]
+    (with-out-str (clojure.pprint/pprint (deref opt))))
+"
+You can override these options by suppling your own to :ring-stack-options
+
+If these options are changed significantly don't be suprised if the
+figwheel stops behaving correctly :)"))

 (s/def ::reload-clj-files (s/or :bool boolean?
                                 :extension-coll (s/coll-of #{:clj :cljc})))
+(spec-doc
+ ::reload-clj-files
+ "Figwheel naively reloads clj and cljc files on the :source-paths.
+It doesn't reload clj dependent files like tools.namspace.
+
+Figwheel does note if there is a macro in the changed clj or cljc file
+and then marks any cljs namespaces that depend on the clj file for
+recompilation and then notifies the figwheel client that these
+namespaces have changed.
+
+If you want to disable this behavior:
+
+  :reload-clj-files false
+
+Or you can specify which suffixes will cause the reloading
+
+  :reload-clj-files #{:clj :cljc}")

 (s/def ::open-file-command non-blank-string?)
+(spec-doc
+ ::open-file-command
+   "A path to an executable shell script that will be passed a file and
+line information for a particular compilation error or warning.
+
+A script like this would work
+ie. in  ~/bin/myfile-opener
+#! /bin/sh
+emacsclient -n +$2:$3 $1
+
+The add this script in your config:
+
+  :open-file-command \"myfile-opener\"
+
+But thats not the best example because Figwheel handles 'emacsclient'
+as a special case so as long as 'emacsclient' is on the shell path you can
+simply do:
+
+  :open-file-command \"emacsclient\"
+
+and Figwheel will call emacsclient with the correct args.")

 (s/def ::client-print-to (s/coll-of #{:console :repl}))
+(spec-doc
+ ::client-print-to
+ "The figwheel.repl client can direct printed (via pr) output to the
+repl and or the console. :client-print-to is a list of where you
+want print output directed. The output choices are :console and :repl
+Default: [:console :repl]
+
+  :client-print-to [:console]")

 (s/def ::log-level #{:error :info :debug :trace :all :off})
+(spec-doc
+ ::log-level
+ "The level to set figwheel.main java.util.logger to.
+Can be one of: :error :info :debug :trace :all :off
+
+  :log-level :error")

 (s/def ::log-file non-blank-string?)
+(spec-doc
+ ::log-file
+ "The name of a file to redirect the figwheel.main logging to. This
+will only take effect when a REPL has been started.
+
+  :log-file \"figwheel-main.log\"")

 (s/def ::log-syntax-error-style #{:verbose :concise})
+(spec-doc
+ ::log-syntax-error-style
+ "Figwheel.main logging prints out compile time syntax errors which
+includes displaying the erroneous code.
+Setting :log-syntax-error-style to :concise will cause the logging to
+not display the erroneous code.
+Available options: :verbose, :concise
+Default: :verbose
+
+  :log-syntax-error-style :concise" )

 (s/def ::ansi-color-output boolean?)
+(spec-doc
+ ::ansi-color-output
+   "Figwheel makes an effort to provide colorful text output. If you need
+to prevent ANSI color codes in figwheel output set :ansi-color-output
+to false.  Default: true
+
+  :ansi-color-output false")

 (s/def ::target-dir non-blank-string?)
+(spec-doc
+ ::target-dir
+ "A String that specifies the target directory component of the path
+where figwheel.main outputs compiled ClojureScript
+
+The default :output-dir is composed of:
+[[:target-dir]]/public/cljs-out/[[build-id]]
+
+The default :output-to is composed of:
+[[:target-dir]]/public/cljs-out/[[build-id]]-main.js
+
+If you are using the default figwheel.repl server to serve compiled
+assets, it is very important that the :target-dir be on the classpath.
+
+The default value of :target-dir is \"target\"
+
+  :target-dir \"cljs-target\"")
+
+(s/def ::connect-url non-blank-string?)

 #_(exp/expound ::edn {:watch-dirs ["src"]
                       :ring-handler "asdfasdf/asdfasdf"


add profile definitions for db

add profile definitions for db

--- src/kixi/hecuba/storage/db.clj
+++ src/kixi/hecuba/storage/db.clj
@@ -26,6 +26,7 @@
 (defmethod gen-key :project [typ payload] ((sha1-keyfn :name :programme-id) payload))
 (defmethod gen-key :entity [typ payload] ((sha1-keyfn :property-code :project-id) payload))
 (defmethod gen-key :device [typ payload] ((sha1-keyfn :description :entity-id) payload))
+(defmethod gen-key :profile [typ payload] ((sha1-keyfn :timestamp :entity-id) payload))

 (defmethod gen-key :sensor [typ payload] nil)
 (defmethod gen-key :sensor-metadata [typ payload] nil)
@@ -43,6 +44,7 @@
 (defmethod get-primary-key-field :project [typ] :id)
 (defmethod get-primary-key-field :entity [typ] :id)
 (defmethod get-primary-key-field :device [typ] :id)
+(defmethod get-primary-key-field :profile [typ] :id)
 (defmethod get-primary-key-field :user [typ] :id) ; TODO should be username...
 (defmethod get-primary-key-field :user-session [typ] :id)
 (defmethod get-primary-key-field :dataset [typ] :id)
@@ -52,6 +54,7 @@
 (defmethod get-table :project [_] "projects")
 (defmethod get-table :property [_] "entities")
 (defmethod get-table :entity [_] "entities")
+(defmethod get-table :profile [_] "profiles")
 (defmethod get-table :device [_] "devices")
 (defmethod get-table :sensor [_] "sensors")
 (defmethod get-table :sensor-metadata [_] "sensor_metadata")
@@ -104,7 +107,7 @@
   (update! [_ typ payload where]
     (assert where "No where clause")
     (alia/execute session
-     (hayt/update (get-table typ)
+     (hayt/update (get-table typ)
                   (hayt/set-columns (cassandraify payload))
                   (hayt/where (cassandraify-v where)))))


each whale should have a unique id try creating whales in parallel - Batcher is a single point of contention

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -88,9 +88,10 @@
     (start-client "Cetacea")))

 (def attributes
-     (list
+     (list
+      :id (Integer/TYPE)
+      :version (Integer/TYPE)
       :time DateMidnight
-      :version (Integer/TYPE)
       :type String
       :length (Float/TYPE)
       :weight (Float/TYPE)))
@@ -137,11 +138,10 @@
 ;; nil

 (def #^Class Whale (apply make-class "org.dada.demo.whales.Whale" Object attributes))
-(def #^Metadata whale-metadata (apply metadata Whale :time :version attributes))
+(def #^Metadata whale-metadata (apply metadata Whale :id :version attributes))
 (def #^Model whales (model "Whales" whale-metadata))

-(def num-whales 10000)
-(def start-time 0)
+(def num-whales 1000000)

 (insert *metamodel* whales)

@@ -227,10 +227,10 @@
 ;;----------------------------------------

 (def longer-whales-weight
-     (dtransform longer-whales "weight" :time :version :time :version :weight))
+     (dtransform longer-whales "weight" :id :version :id :version :weight))

 (def #^Model heavier-whales-length
-     (dtransform heavier-whales "length" :time :version :time :version :length))
+     (dtransform heavier-whales "length" :id :version :id :version :length))

 ;;----------------------------------------
 ;; demonstrate transformation - a synthetic field - metric tons per metre
@@ -239,9 +239,9 @@
 (dtransform
  whales
  "tonsPerMetre"
- :time
+ :id
  :version
- :time
+ :id
  :version
  (list
   :tonsPerMetre
@@ -263,9 +263,9 @@
        '(:type)
        #(= "narwhal" %))
       "length"
-      :time
+      :id
       :version
-      :time
+      :id
       :version
       :length)
      )
@@ -430,29 +430,32 @@
 ;; simplify splitting - Sparse splitting should use Object keys, not only int
 ;; transform needs to suppport synthetic attributes

-;; create 10,000 whales and insert them into model
- ;;whales
-(doall
- (let [batcher (Batcher. 999 1000 (list whales))
-       #^Creator creator (.getCreator whale-metadata)
-       max-length-x-100 (* max-length 100)
-       max-weight-x-100 (* max-weight 100)]
-   (for [id (range start-time (+ start-time num-whales))]
-     (insert
-      batcher
-      (.create
-       creator
-       (into-array
-	Object
-	[(DateMidnight. (+ (rand-int 10) 2000)
-			(+ (rand-int 12) 1)
-			(+ (rand-int 28) 1))
-	 0
-	 (rnd types)
-	 (/ (rand-int max-length-x-100) 100)
-	 (/ (rand-int max-weight-x-100) 100)]))))))
-
-(println "LOADED!")
+;; create some whales...
+(time
+ (doall
+  (let [batcher (Batcher. 999 1000 (list whales))
+	#^Creator creator (.getCreator whale-metadata)
+	max-length-x-100 (* max-length 100)
+	max-weight-x-100 (* max-weight 100)]
+    (pmap
+     (fn [id]
+	 (insert
+	  whales ;; batcher
+	  (.create
+	   creator
+	   (into-array
+	    Object
+	    [id
+	     0
+	     (DateMidnight. (+ (rand-int 10) 2000)
+			    (+ (rand-int 12) 1)
+			    (+ (rand-int 28) 1))
+	     (rnd types)
+	     (/ (rand-int max-length-x-100) 100)
+	     (/ (rand-int max-weight-x-100) 100)]))))
+     (range num-whales)))))
+
+(println "LOADED: " num-whales)

 ;; need some form of pluggable sorting algorithm


remove obsolete runSilent reference

remove obsolete runSilent reference

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -50,7 +50,6 @@
      :implements [org.micromanager.api.IAcquisitionEngine2010]
      :init init
      :constructors {[org.micromanager.api.ScriptInterface] []}
-     :methods [[runSilent [] java.util.concurrent.BlockingQueue]]
      :state state))

 ;; test utils


CMR-3369: Updated comment

CMR-3369: Updated comment

--- access-control-app/src/cmr/access_control/data/bulk_index.clj
+++ access-control-app/src/cmr/access_control/data/bulk_index.clj
@@ -34,9 +34,16 @@
        (apply util/max-compare)))

 (defn bulk-index-with-revision-date
-  "See documentation for bulk-index. This is a temporary function added for supporting replication
-  using DMS. It does the same work as bulk-index, but instead of returning the number of concepts
-  indexed it returns a map with keys of :num-indexed and :max-revision-date."
+  "Index many concepts at once using the elastic bulk api. The concepts to be indexed are passed
+  directly to this function - it does not retrieve them from metadata db (tag associations for
+  collections WILL be retrieved, however). The bulk API is invoked repeatedly if necessary -
+  processing batch-size concepts each time. Returns the number of concepts that have been indexed.
+
+  Valid options:
+  * :all-revisions-index? - true indicates this should be indexed into the all revisions index
+  * :force-version? - true indicates that we should overwrite whatever is in elasticsearch with the
+  latest regardless of whether the version in the database is older than the _version in elastic.
+  Returns a map with keys of :num-indexed and :max-revision-date."
   ([context concept-batches]
    (bulk-index-with-revision-date context concept-batches nil))
   ([context concept-batches options]


Add logging dependency to modular.ring

Add logging dependency to modular.ring

--- modules/ring/project.clj
+++ modules/ring/project.clj
@@ -1,8 +1,9 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/ring "0.5.1"
+(defproject juxt.modular/ring "0.5.2-SNAPSHOT"
   :description "A modular extension that represents the Ring interface"
   :url "https://github.com/juxt/modular/tree/master/modules/ring"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
-  :dependencies [[prismatic/schema "0.2.1"]])
+  :dependencies [[prismatic/schema "0.2.1"]
+                 [org.clojure/tools.logging "0.2.6"]])


Regularised the bass.#

Regularised the bass.#

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -51,19 +51,24 @@
   {:time (concat [3/4] (repeat 12 1/4) [1/2 1 1/2] (repeat 12 1/4) [3])
    :pitch (concat [4 4] (run 2 -3) [-1 -2 0] (run 3 5) (repeat 3 1) [2] (run -1 1) [0 -1] (run 5 0))})

-(defn lower [v] (- v 7))
-(def bass (update-all
-            {:time (range 25)
-             :pitch (map lower (mapcat (partial repeat 3) (concat (run 0 -3) (run -5 -3) [0 7])))}
-            [:pitch :time] natural-map ))
+(defn melody [notes]
+  (let [functionalise #(update-all % [:time :pitch] natural-map)
+        ground-time (update :time sums)]
+    (-> notes ground-time functionalise)))
+
+(def bassline
+  {:time (repeat 24 1)
+   :pitch (mapcat (partial repeat 3) (concat (run 0 -3) (run -5 -3) [0 7]))})
+
+(def bass
+ (let [lower-note #(- % 7)
+       lower-melody (update :pitch #(connect lower-note %))]
+   (-> bassline melody lower-melody)))

 (defn subsequent [melody1 melody2]
   (merge-with concat melody1 melody2))

-(def melody
-  (let [functionalise #(update-all % [:time :pitch] natural-map)
-        ground-time #(update-in % [:time] sums)]
-    (functionalise (ground-time (reduce subsequent [call response development])))))
+(def leader (melody (reduce subsequent [call response development])))

 (defn melody# [melody]
   (let [notes (update-all melody [:pitch :time] natural-seq)
@@ -88,8 +93,8 @@
         with-sharps (update :pitch #(comp (sharps [12 22]) %))
         with-flats (update :pitch #(comp (flats [37]) %))]
     (-> bass in-key with-beat melody#)
-    (-> melody after-a-half canone-alla-quarta in-key with-beat melody#)
-    (-> melody after-a-half in-key with-sharps with-flats with-beat melody#)
+    (-> leader after-a-half canone-alla-quarta in-key with-beat melody#)
+    (-> leader after-a-half in-key with-sharps with-flats with-beat melody#)
     ))

 (play#)