indentation

indentation

--- src/test/clojure/clojure/test/check/clojure_test_test.cljc
+++ src/test/clojure/clojure/test/check/clojure_test_test.cljc
@@ -68,10 +68,10 @@
           (= {:test-var "trial-counts", :result true, :num-tests 5000})))

   (binding [ct/*report-trials* true]
-     (let [output (capture-test-var #'trial-counts)]
-       (is (re-matches #?(:clj  #"(?s)\.{5}.+"
-                          :cljs #"\.{5}[\s\S]+")
-                       output))))
+    (let [output (capture-test-var #'trial-counts)]
+      (is (re-matches #?(:clj  #"(?s)\.{5}.+"
+                         :cljs #"\.{5}[\s\S]+")
+                      output))))

   (binding [ct/*report-trials* ct/trial-report-periodic
             ct/*trial-report-period* 500]
@@ -85,17 +85,17 @@
       (is (= trial-report-1 @last-trial-report)
           "calling with other :type keeps last-trial-report constant")
       (is (re-seq
-            #"(Passing trial \d{3} / 1000 for .+\n)+"
-            (capture-test-var #'long-running-spec)))
+           #"(Passing trial \d{3} / 1000 for .+\n)+"
+           (capture-test-var #'long-running-spec)))
       (is (> @last-trial-report trial-report-1)
           "running the test makes last-trial-report to increment")))

   (let [[report-counters stdout]
         #?(:clj
            (binding [ct/*report-shrinking* true
-                      ; need to keep the failure of this-is-supposed-to-fail from
-                      ; affecting the clojure.test.check test run
-                      *report-counters* (ref *initial-report-counters*)]
+                     ;; need to keep the failure of this-is-supposed-to-fail from
+                     ;; affecting the clojure.test.check test run
+                     *report-counters* (ref *initial-report-counters*)]
              (let [out (capture-test-var #'this-is-supposed-to-fail)]
                [@*report-counters* out]))

@@ -111,9 +111,9 @@
                [(:report-counters env) report-str])))]
     (is (== 1 (:fail report-counters)))
     (is (re-seq
-          #?(:clj
-             #"(?s)Shrinking vector-elements-are-unique starting with parameters \[\[.+"
+         #?(:clj
+            #"(?s)Shrinking vector-elements-are-unique starting with parameters \[\[.+"

-             :cljs
-             #"Shrinking vector-elements-are-unique starting with parameters \[\[[\s\S]+")
-          stdout))))
+            :cljs
+            #"Shrinking vector-elements-are-unique starting with parameters \[\[[\s\S]+")
+         stdout))))


Fixed multipart-params bug that occurs with Clojure 1.3.0

--- ring-core/src/ring/middleware/multipart_params.clj
+++ ring-core/src/ring/middleware/multipart_params.clj
@@ -38,26 +38,23 @@
     (.getItemIterator (FileUpload.) context)))

 (defn- parse-file-item
-  "Parse a FileItemStream into a parameter value. If the request is a file the
+  "Parse a FileItemStream into a key-value pair. If the request is a file the
   supplied store function is used to save it."
   [^FileItemStream item store]
-  (if (.isFormField item)
-    (Streams/asString (.openStream item))
-    (store {:filename     (.getName item)
-            :content-type (.getContentType item)
-            :stream       (.openStream item)})))
+  [(.getFieldName item)
+   (if (.isFormField item)
+     (Streams/asString (.openStream item))
+     (store {:filename     (.getName item)
+             :content-type (.getContentType item)
+             :stream       (.openStream item)}))])

 (defn- parse-multipart-params
   "Parse a map of multipart parameters from the request."
   [request encoding store]
-  (reduce
-   (fn [params item]
-     (assoc-param params
-                  (.getFieldName item)
-                  (parse-file-item item store)))
-   {}
-   (file-item-seq
-    (request-context request encoding))))
+  (->> (request-context request encoding)
+       (file-item-seq)
+       (map #(parse-file-item % store))
+       (reduce (fn [m [k v]] (assoc-param m k v)) {})))

 (defn- load-var
   "Returns the var named by the supplied symbol, or nil if not found. Attempts


update hawk

update hawk

fixes #496

--- sidecar/project.clj
+++ sidecar/project.clj
@@ -23,7 +23,7 @@
    [clj-stacktrace "0.2.8"]
    [figwheel "0.5.9-SNAPSHOT"
       :exclusions [org.clojure/tools.reader]]
-   [hawk "0.2.10" :exclusions [org.clojure/clojure]]
+   [hawk "0.2.11" :exclusions [org.clojure/clojure]]

    [org.clojure/tools.nrepl "0.2.12"]
    ;; for config validation


added missing nrepl dependency

added missing nrepl dependency

fixes #394

--- sidecar/project.clj
+++ sidecar/project.clj
@@ -23,6 +23,7 @@
     :exclusions [org.clojure/tools.reader]]
    [hawk "0.2.9" :exclusions [org.clojure/clojure]]

+   [org.clojure/tools.nrepl "0.2.12"]
    ;; for config validation
    [clj-fuzzy "0.3.1"]
    [fipp "0.6.4"]])


Update project.clj

Update project.clj

--- examples/project.clj
+++ examples/project.clj
@@ -3,8 +3,9 @@
   :plugins [[lein-gorilla "0.4.0"]]
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/tools.cli "0.3.5"]
-                 [anglican "1.0.0"]
+                 [anglican "1.0.1"]
                  [anglican-infcomp "0.1.0-SNAPSHOT"]
-                 [net.polyc0l0r/clj-hdf5 "0.2.2-SNAPSHOT"]]
+                 [net.polyc0l0r/clj-hdf5 "0.2.2-SNAPSHOT"]
+                 [rhizome "0.2.7"]]
   :java-source-paths ["src/helpers"]
   :main examples.core)


change Interns to use card targeting

change Interns to use card targeting

--- src/clj/game/cards-operations.clj
+++ src/clj/game/cards-operations.clj
@@ -176,15 +176,10 @@
                               :effect (effect (trash target))}}}

    "Interns"
-   {:prompt "Install a card from Archives or HQ?" :choices ["Archives" "HQ"]
-    :msg (msg "install a card from " target)
-    :effect (effect (resolve-ability
-                      {:prompt "Choose a card to install"
-                       :not-distinct true
-                       :choices (req (filter #(not= (:type %) "Operation")
-                                             ((if (= target "HQ") :hand :discard) corp)))
-                       :effect (effect (corp-install target nil {:no-install-cost true}))}
-                      card targets))}
+   {:prompt "Choose a card to install from Archives or HQ" :show-discard true
+    :choices {:req #(and (not= (:type %) "Operation")
+                         (or (= (:zone %) [:hand]) (= (:zone %) [:discard])))}
+    :effect (effect (corp-install target nil {:no-install-cost true}))}

    "Invasion of Privacy"
    {:trace {:base 2 :msg (msg "reveal the Runner's Grip and trash up to " (- target (second targets)) " resources or events")


Add a web API to invoke the hyphenator

Add a web API to invoke the hyphenator

--- src/clj/hyphen_keeper/handler.clj
+++ src/clj/hyphen_keeper/handler.clj
@@ -6,6 +6,7 @@
             [hiccup.page :refer [html5 include-css include-js]]
             [hyphen-keeper
              [db :as db]
+             [hyphenate :as hyphenate]
              [middleware :refer [wrap-api-middleware wrap-site-middleware]]]
             [ring.util.response :as response]))

@@ -46,6 +47,7 @@

 (defroutes api-routes
   (context "/api" []
+   (GET "/hyphenate" [spelling word] (hyphenate/hyphenate spelling word))
    (GET "/words" [spelling search] (word-list spelling search))
    (POST "/words" [word hyphenation spelling] (word-add word hyphenation spelling))
    (PUT "/words" [word hyphenation spelling] (word-add word hyphenation spelling))


clojure collision

clojure collision

--- src/clojure/embla3d/new_world.clj
+++ src/clojure/embla3d/new_world.clj
@@ -30,6 +30,30 @@
   (let [item (.createItem world id position scale mesh)]
     item))

+
+;;Collision Functions--------------------------------------------
+;;TODO check if 2 items are in collision
+(defn check-collision!
+  "Check if 2 items are in collision in the `world` with the
+  specified items"
+  [world & {:keys [item1 item2]}]
+
+  (let [boolean (.isInCollision world item1 item2)]
+    boolean))
+
+;;TODO create a boundingbox to an item
+(defn create-boudingbox!
+  "Create a boundingbox in the `world` with the
+  specified id, position, scale"
+  [world & {:keys [id position scale]
+           :or   {id       "can't read the doc..."
+                  position [0 0 -2]
+                  scale    1}}]
+
+  (let [item (.createBoundingBox world id position scale)]
+    item))
+
+
 ;; Mesh Functions------------------------------------------------
 ;;TODO create basic meshes
 (defn create-mesh! "" []


Updating spelling 'surpress*' -> 'suppress*'

--- src/leiningen/ancient/utils/test.clj
+++ src/leiningen/ancient/utils/test.clj
@@ -4,7 +4,7 @@
   (:require [leiningen.core.main :as main]))

 (defn- run-test-task!
-  "Run a single test task, surpressing output and returnin a boolean value indicating
+  "Run a single test task, suppressing output and returnin a boolean value indicating
    whether the task finished without calling `main/abort`."
   [project task]
   (try
@@ -23,9 +23,9 @@
   (if-let [task (get-in project [:aliases "test-ancient"])]
     (let [r (run-test-task! project task)]
       (when-not r
-        (main/info "Tests failed (use ':no-tests' if you want to surpress testing)."))
+        (main/info "Tests failed (use ':no-tests' if you want to suppess testing)."))
       r)
     (do
       (main/info "No regression test task given.")
-      (main/info "(Use the alias 'test-ancient' to specify one or the option ':no-tests' to surpress testing.)")
+      (main/info "(Use the alias 'test-ancient' to specify one or the option ':no-tests' to suppress testing.)")
       true)))


Sending link in Email Body (#216)

Sending link in Email Body (#216)

--- server/src/spacon/components/notification/core.clj
+++ server/src/spacon/components/notification/core.clj
@@ -38,7 +38,7 @@

 (defn- email-recipient
   [id recipient message]
-  (let [body (str (:body message) "\n" (build-notification-link id))]
+  (let [body (str (build-notification-link id))]
     (send-message conn {:from    "mobile@boundlessgeo.com"
                         :to      (str recipient)
                         :subject (str (:title message))
@@ -46,11 +46,11 @@

 (defn- send->email
   [message]
-  (let [recipients (zipmap (:notif-ids message) (:to message))]
-    (map (fn [[id recipient]]
-           (email-recipient id recipient message)
-           (notifmodel/mark-as-sent id))
-         recipients)))
+  (let [recipients (do (zipmap (:notif-ids message) (:to message)))]
+    (doall (map (fn [[id recipient]]
+                  (email-recipient id recipient message)
+                  (notifmodel/mark-as-sent id))
+                recipients))))

 (defn- process-channel [mqtt input-channel]
   (go (while true


Reformat day8.re-frame-10x.styles ns

Reformat day8.re-frame-10x.styles ns

--- src/day8/re_frame_10x/styles.cljs
+++ src/day8/re_frame_10x/styles.cljs
@@ -153,9 +153,9 @@
    ["*"
     {:transform-origin "0px 0px 0px"}]
    ["html|* > svg"
-    {:transform-origin "50% 50%"}]
-
-   ])
+    {:transform-origin "50% 50%"}]])
+
+

 (def label-mixin {:color      text-color
                   :background background-gray-hint
@@ -357,7 +357,7 @@
                         :transform "rotate(-45deg)"}]
       [:input {:border "none"}
        ["&::placeholder"
-        {:color common/medium-gray
+        {:color      common/medium-gray
          :font-style "italic"}]]]]]
    [:.filter-control-input
     {:display "flex"
@@ -379,8 +379,8 @@
                          :padding          (px 5)
                          :font-weight      "600"
                          ;; TODO: figure out how to hide long events
-                         :text-overflow    "ellipsis"}]
-    ]
+                         :text-overflow    "ellipsis"}]]
+
    [(s/& :.external-window) {:display "flex"
                              :height  (percent 100)
                              :flex    "1 1 auto"}]
@@ -444,26 +444,26 @@
    ;; https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
    [:.dont-break-out
     {
-     "overflow-wrap" "break-word"
-     "word-wrap" "break-word"
-
-     "-ms-word-break" "break-all"
+     "overflow-wrap"   "break-word"
+     "word-wrap"       "break-word"
+
+     "-ms-word-break"  "break-all"
      ; This is the dangerous one in WebKit, as it breaks things wherever
-     "word-break" "break-all"
+     "word-break"      "break-all"
      ; /* Instead use this non-standard one: */
-     :word-break "break-word"
+     :word-break       "break-word"

      ; /* Adds a hyphen where the word breaks, if supported (No Blink) */
-     "-ms-hyphens" "auto"
-     "-moz-hyphens" "auto"
+     "-ms-hyphens"     "auto"
+     "-moz-hyphens"    "auto"
      "-webkit-hyphens" "auto"
-     "hypens" "auto"}]])
+     "hypens"          "auto"}]])

 (def highlight-js-solarized
   ;; From https://github.com/isagalaev/highlight.js/blob/master/src/styles/solarized-light.css
-  [[:.hljs {"display"    "block"
-            "padding"    "0.5em"
-            "color"      "#657b83"}]
+  [[:.hljs {"display" "block"
+            "padding" "0.5em"
+            "color"   "#657b83"}]
    [:.hljs-comment :.hljs-quote
     {"color" "#93a1a1"}]
    [:.hljs-keyword :.hljs-selector-tag :.hljs-addition
@@ -492,8 +492,8 @@
    [".hljs-emphasis"
     {"font-style" "italic"}]
    [".hljs-strong"
-    {"font-weight" "bold"}]
-   ])
+    {"font-weight" "bold"}]])
+

 (def at-keyframes-styles
@@ -501,16 +501,16 @@
     [(at-keyframes :pulse-previous-re-frame-10x
                    [:from {:color "white"
                            :left  (when slide? "-100%")}]
-                   [:to   {:left  (when slide? "0%")}])
+                   [:to {:left (when slide? "0%")}])
      (at-keyframes :pulse-next-re-frame-10x
                    [:from {:color "white"
                            :left  (when slide? "100%")}]
-                   [:to   {:left  (when slide? "0%")}])
+                   [:to {:left (when slide? "0%")}])
      (at-keyframes :fade-clipboard-msg-re-frame-10x
-                   [:0%   {:margin-left "100px"}]
-                   [:5%   {:margin-left "0px"
-                           :opacity     "1"}]
-                   [:90%  {:opacity "1"}])]))
+                   [:0% {:margin-left "100px"}]
+                   [:5% {:margin-left "0px"
+                         :opacity     "1"}]
+                   [:90% {:opacity "1"}])]))

 (def panel-styles


Minor changes on frontend project.clj

Minor changes on frontend project.clj

--- frontend/project.clj
+++ frontend/project.clj
@@ -17,10 +17,12 @@

                  ;; runtime
                  [com.cognitect/transit-cljs "0.8.239"]
-                 [rum "0.10.8"]
+                 [rum "0.10.8" :exclusions [cljsjs/react cljsjs/react-dom]]
+                 ;; [cljsjs/react-with-addons "15.4.2-1"]
                  [cljsjs/react "15.4.2-1"]
                  [cljsjs/react-dom "15.4.2-1"]
                  [cljsjs/react-dom-server "15.4.2-1"]
+
                  [cljsjs/moment "2.17.1-0"]
                  [funcool/potok "1.2.0"]
                  [funcool/struct "1.0.0"]


Refactor, re-name body-creation-fn to out-format-fn.

--- src/dsbdp/data_processing_dsl.clj
+++ src/dsbdp/data_processing_dsl.clj
@@ -69,7 +69,7 @@
 (declare create-proc-fn)

 (defn- create-bindings-vector
-  [input rules body-creation-fn output nesting-level]
+  [input rules out-format-fn output nesting-level]
   (reduce
     (fn [v rule]
       (let [rule-name (first rule)
@@ -83,7 +83,7 @@
                                                       nested-expr-tmp (create-let-expression
                                                                         input
                                                                         (vec rule-expression)
-                                                                        body-creation-fn
+                                                                        out-format-fn
                                                                         output
                                                                         (inc nesting-level))
                                                       nested-expr-ret-tmp (last nested-expr-tmp)
@@ -108,7 +108,7 @@
             (every? vector? rule-expression)) (let [nested-expr (create-let-expression
                                                                   input
                                                                   rule-expression
-                                                                  body-creation-fn
+                                                                  out-format-fn
                                                                   output
                                                                   (inc nesting-level))]
                                                 (conj v (prefix-rule-name rule-name nesting-level) nested-expr))
@@ -121,7 +121,7 @@
                                                                                (create-let-expression
                                                                                input
                                                                                v
-                                                                                body-creation-fn
+                                                                                out-format-fn
                                                                                output
                                                                                (inc nesting-level)))
                                                                   :default (do
@@ -135,10 +135,10 @@
     rules))

 (defn- create-let-expression
-  [input rules body-creation-fn output nesting-level]
+  [input rules out-format-fn output nesting-level]
   `(let
-    ~(create-bindings-vector input rules body-creation-fn output nesting-level)
-    ~(reverse (into '() (body-creation-fn rules output nesting-level)))))
+    ~(create-bindings-vector input rules out-format-fn output nesting-level)
+    ~(reverse (into '() (out-format-fn rules output nesting-level)))))

 (defn- create-let-body-vec-java-map-out
   [rules output nesting-level]
@@ -240,17 +240,17 @@
         rules (:rules dsl-expression)
         output-sym (if (.endsWith output-type *incremental-indicator-suffix*)
                      'output)
-        let-body-creation-fn (condp (fn [^String v ^String s] (.startsWith s v)) output-type
-                               "java-map" create-let-body-vec-java-map-out
-                               "clj-map" create-let-body-vec-clj-map-out
-                               "csv-str" create-let-body-vec-csv-str-out
-                               "json-str" create-let-body-vec-json-str-out
-                               (do
-                                 (println "Unknown output type:" output-type)
-                                 (println "Defaulting to :java-map as output type.")
-                                 create-let-body-vec-java-map-out))
+        output-format-fn (condp (fn [^String v ^String s] (.startsWith s v)) output-type
+                           "java-map" create-let-body-vec-java-map-out
+                           "clj-map" create-let-body-vec-clj-map-out
+                           "csv-str" create-let-body-vec-csv-str-out
+                           "json-str" create-let-body-vec-json-str-out
+                           (do
+                             (println "Unknown output type:" output-type)
+                             (println "Defaulting to :java-map as output type.")
+                             create-let-body-vec-java-map-out))
 ;        _ (println "Created data processing function vector from DSL:" fn-body-vec)
-        fn-body (create-let-expression input-sym rules let-body-creation-fn output-sym 0)
+        fn-body (create-let-expression input-sym rules output-format-fn output-sym 0)
 ;        _ (println "Created data processing function body:" fn-body)
 ;        _ (pprint fn-body)
 ;        _ (println "")


Populate the project tree correctly

Populate the project tree correctly

--- src/net/sekao/nightcode/projects.clj
+++ src/net/sekao/nightcode/projects.clj
@@ -4,31 +4,43 @@
            [javafx.scene.control TreeItem TreeCell]
            [javafx.collections FXCollections]))

+(declare file-node)
+
+(defn get-children [files]
+  (let [children (FXCollections/observableArrayList)]
+    (run! #(.add children (file-node %)) files)
+    children))
+
 (defn file-node [file]
   (let [path (.getCanonicalPath file)
         custom-file (proxy [File] [path]
                       (toString []
-                        (.getName this)))]
+                        (.getName this)))
+        children (->> (reify FilenameFilter
+                        (accept [this dir filename]
+                          (not (.startsWith filename "."))))
+                      (.listFiles file)
+                      get-children
+                      delay)]
     (proxy [TreeItem] [custom-file]
       (getChildren []
-        (let [files (.listFiles file
-                      (reify FilenameFilter
-                        (accept [this dir filename]
-                          (not (.startsWith filename ".")))))
-              children (FXCollections/observableArrayList)]
-          (run! #(.add children (file-node %)) files)
-          children))
+        (if-not (realized? children)
+          (doto (proxy-super getChildren)
+            (.addAll @children))
+          (proxy-super getChildren)))
       (isLeaf []
         (not (.isDirectory file))))))

 (defn root-node [state]
   (let [project-files (->> (:project-set state)
                            (map #(io/file %))
-                           (sort-by #(.getName %)))]
+                           (sort-by #(.getName %)))
+        children (delay (get-children project-files))]
     (proxy [TreeItem] []
       (getChildren []
-        (let [children (FXCollections/observableArrayList)]
-          (run! #(.add children (file-node %)) project-files)
-          children))
+        (if-not (realized? children)
+          (doto (proxy-super getChildren)
+            (.addAll @children))
+          (proxy-super getChildren)))
       (isLeaf []
         false))))


Refactor ack-segment loog

Refactor ack-segment loog

--- src/onyx/messaging/acking_daemon.clj
+++ src/onyx/messaging/acking_daemon.clj
@@ -27,30 +27,44 @@

 (defrecord AckState [state completed?])

-(defn ack-segment [ack-state completion-ch message-id completion-id ack-val]
-  (let [rets
-        (swap!
-          ack-state
-          (fn [as]
-            (let [state (:state as)
-                  ack (get state message-id)]
-              (if ack
-                (let [updated-ack-val (bit-xor ^long (:ack-val ack) ^long ack-val)]
-                  (if (zero? updated-ack-val)
-                    (->AckState (dissoc state message-id) true)
-                    (->AckState (assoc state message-id (assoc ack :ack-val updated-ack-val)) false)))
-                (if (zero? ^long ack-val)
-                  (->AckState state true)
-                  (->AckState (assoc state message-id (->Ack nil completion-id ack-val nil (now))) false))))))]
+(defn update-found-ack [state found-ack message-id ack-val]
+  (let [updated-ack-val (bit-xor ^long (:ack-val found-ack) ack-val)]
+    (if (zero? updated-ack-val)
+      (->AckState (dissoc state message-id) true)
+      (->AckState (assoc state message-id (assoc found-ack :ack-val updated-ack-val)) false))))
+
+(defn fully-acked [state]
+  (->AckState state true))
+
+(defn add-ack [state message-id ack-val completion-id]
+  (->AckState (assoc state message-id (->Ack nil completion-id ack-val nil (now)))
+              false))
+
+(defn update-ack-state [ack-state ack]
+  (let [ack-val ^long (:ack-val ack)
+        state (:state ack-state)
+        message-id (:id ack)
+        found-ack (get state message-id)]
+    (cond found-ack
+          (update-found-ack state found-ack message-id ack-val)
+
+          (zero? ^long ack-val)
+          (fully-acked state)
+
+          :else
+          (add-ack state message-id ack-val (:completion-id ack)))))
+
+(defn ack-segment [ack-state completion-ch ack]
+  (let [rets (swap! ack-state (fn [as] (update-ack-state as ack)))]
     (when (:completed? rets)
       (>!! completion-ch
-           {:id message-id :peer-id completion-id}))))
+           {:id (:id ack)
+            :peer-id (:completion-id ack)}))))

 (defn ack-segments-loop [ack-state acking-ch completion-ch]
   (loop []
     (when-let [ack (<!! acking-ch)]
-      (ack-segment ack-state completion-ch
-                   (:id ack) (:completion-id ack) (:ack-val ack))
+      (ack-segment ack-state completion-ch ack)
       (recur)))
   (timbre/info "Stopped Ack Messages Loop"))


progress on slideexplorer2

progress on slideexplorer2

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

--- plugins/SlideExplorer2/src/slide_explorer/display.clj
+++ plugins/SlideExplorer2/src/slide_explorer/display.clj
@@ -1,12 +1,24 @@
 (ns slide_explorer.display
   (:import (javax.swing JFrame)
-           (java.awt Canvas Graphics Graphics2D)
+           (java.awt Canvas Graphics Graphics2D RenderingHints)
+           (java.awt.event MouseAdapter)
            (java.awt.image BufferedImage WritableRaster)
            (java.awt.geom AffineTransform)
-           mmcorej.TaggedImage
-           (org.micromanager.utils MDUtils))
-  (:use [org.micromanager.mm :only (json-to-data)]))
+           (java.io ByteArrayInputStream)
+           (javax.imageio ImageIO)
+           (mmcorej TaggedImage)
+           (org.micromanager.utils GUIUpdater ImageUtils MDUtils))
+  (:use [org.micromanager.mm :only (mmc load-mm json-to-data)]))

+(load-mm)
+
+(defrecord screen-properties [x y z width height zoom])
+
+(def screen-state (atom nil))
+
+(defn snap-image []
+  (. mmc snapImage)
+  (. mmc getTaggedImage))

 (defn image-data [^TaggedImage tagged-image]
   {:pixels (.pix tagged-image)
@@ -18,14 +30,79 @@

 (defn buffered-image
   ([[w h] pixels]
-  (let [image (BufferedImage. w h BufferedImage/TYPE_BYTE_INDEXED)
-        raster (cast WritableRaster (.getData image))]
-    (.setPixels raster 0 0 w h pixels)
-    image))
+    (let [image (ImageIO/read (ByteArrayInputStream. pixels))
+          raster (cast WritableRaster (.getData image))]
+      (.setPixels raster 0 0 w h pixels)
+      image))
   ([^TaggedImage tagged-image]
     (buffered-image (get-image-dimensions tagged-image) (.pix tagged-image))))
+
+(defn enable-anti-aliasing
+  ([^Graphics g]
+    (enable-anti-aliasing g true))
+  ([^Graphics g on]
+    (let [graphics2d (cast Graphics2D g)]
+      (.setRenderingHint graphics2d
+                         RenderingHints/KEY_ANTIALIASING
+                         (if on RenderingHints/VALUE_ANTIALIAS_ON
+                           RenderingHints/VALUE_ANTIALIAS_OFF)))))

-(defn main-canvas
-  (proxy [Canvas] []
-    (paint [^Graphics g]
-           (.drawImage (cast Graphics2D g) (AffineTransform.) nil))))
+(defn draw-tile [^Graphics2D g image-data]
+  (.drawImage g (buffered-image [512 512] (:pixels image-data))
+              (AffineTransform.) nil))
+
+(defn paint-tiles [canvas]
+  (println (java.util.Date.))
+  (doseq [x (range 10 100 10)]
+    (.drawOval (.getGraphics canvas)
+               x x
+               (- (.getWidth canvas) (* 2 x))
+               (- (.getHeight canvas) (* 2 x)))))
+
+(defn paint-screen [canvas]
+  (enable-anti-aliasing (.getGraphics canvas))
+  (paint-tiles canvas)
+  (println (.getBounds canvas)))
+
+(defn handle-drags [component position-atom]
+  (let [drag-origin (atom nil)
+        mouse-adapter
+        (proxy [MouseAdapter] []
+          (mousePressed [e]
+                        (println e)
+                        (reset! drag-origin {:x (.getX e) :y (.getY e)})
+                        (println @drag-origin))
+          (mouseReleased [e]
+                         (println e)
+                         (reset! drag-origin nil)
+                         (println @drag-origin))
+          (mouseDragged [e]
+                        (println e)
+                        (let [x (.getX e) y (.getY e)]
+                          (swap! position-atom update-in [:x]
+                                 + (- x (:x @drag-origin)))
+                          (swap! position-atom update-in [:y]
+                                 + (- y (:y @drag-origin)))
+                          (reset! drag-origin {:x (.getX e) :y (.getY e)}))
+                        (println @position-atom)))]
+    (doto component
+      (.addMouseListener mouse-adapter)
+      (.addMouseMotionListener mouse-adapter))))
+
+(defn main-canvas []
+  (let [updater (GUIUpdater.)]
+    (doto (proxy [Canvas] []
+            (paint [^Graphics g] (paint-screen this))))))
+
+(defn main-frame []
+  (doto (JFrame. "Slide Explorer II")
+    .show
+    (.setBounds 10 10 500 500)))
+
+(defn show []
+  (let [canvas (main-canvas)]
+    (.add (.getContentPane (main-frame)) canvas)
+    canvas))
+
+;;;;;;;;
+


better output on for tests

better output on for tests

--- kafka-clj/test/kafka_clj/pool_impl_tests.clj
+++ kafka-clj/test/kafka_clj/pool_impl_tests.clj
@@ -210,8 +210,8 @@
                   (prn "idle waiting on latch")
                   (.await count-latch 60 TimeUnit/SECONDS)
                   (prn "idle got latch")
-                  (prn "count v: " (count v) " = " (count (keys @created-atoms)))
-                  (prn "vals " (clojure.string/join "," (vals @created-atoms)))
+                  (prn "count v: " (count v) " = " (count (keys @created-atoms)) " keys " (mapv str (keys @created-atoms)))
+                  (prn "vals " (clojure.string/join "," (mapv deref (vals @created-atoms))))

                   (try
                     (and


fix closure js conversion cache bug

fix closure js conversion cache bug

cache index would double in size on each compile

--- src/main/shadow/build/closure.clj
+++ src/main/shadow/build/closure.clj
@@ -1368,9 +1368,9 @@
         (.getSourceMap cc)

         injected-libs
-        (-> (.get injected-libraries-field cc)
-            (keys)
-            (into #{}))]
+        (->> (.get injected-libraries-field cc)
+             (keys)
+             (into #{}))]

     (throw-errors! state cc result)


Copy generators impl details from the old cljs code

Most of these are avoiding use of HOFs for performance (at least in
cljs-land). Another was a bad argument name.

--- src/main/clojure/clojure/test/check/generators.cljc
+++ src/main/clojure/clojure/test/check/generators.cljc
@@ -67,9 +67,9 @@
   of random number generators."
   [rr]
   (lazy-seq
-        (let [[r1 r2] (random/split rr)]
-          (cons r1
-                (lazy-random-states r2)))))
+   (let [[r1 r2] (random/split rr)]
+     (cons r1
+           (lazy-random-states r2)))))

 (defn- gen-seq->seq-gen
   "Takes a sequence of generators and returns a generator of sequences (er, vectors)."
@@ -84,7 +84,7 @@
 (defn fmap
   [f gen]
   (assert (generator? gen) "Second arg to fmap must be a generator")
-  (gen-fmap (partial rose/fmap f) gen))
+  (gen-fmap #(rose/fmap f %) gen))

 (defn return
@@ -135,7 +135,7 @@
   ([generator max-size]
    (let [r (random/make-random)
          size-seq (make-size-range-seq max-size)]
-     (core/map (comp rose/root #(call-gen generator %1 %2))
+     (core/map #(rose/root (call-gen generator %1 %2))
                (lazy-random-states r)
                size-seq))))

@@ -164,11 +164,11 @@

 (defn- halfs
   [n]
-  (take-while (partial not= 0) (iterate #(quot % 2) n)))
+  (take-while #(not= 0 %) (iterate #(quot % 2) n)))

 (defn- shrink-int
   [integer]
-  (core/map (partial - integer) (halfs integer)))
+  (core/map #(- integer %) (halfs integer)))

 (defn- int-rose-tree
   [value]
@@ -273,7 +273,7 @@
   (assert (every? generator? generators)
           "Arg to one-of must be a collection of generators")
   (bind (choose 0 (dec (count generators)))
-        (partial nth generators)))
+        #(nth generators %)))

 (defn- pick
   [[h & tail] n]
@@ -313,11 +313,11 @@
               #(gen-pure (rose/fmap v %)))))

 (defn- such-that-helper
-  [max-tries pred gen tries-left rand-seed size]
+  [max-tries pred gen tries-left rng size]
   (if (zero? tries-left)
     (throw (ex-info (str "Couldn't satisfy such-that predicate after "
                          max-tries " tries.") {}))
-    (let [[r1 r2] (random/split rand-seed)
+    (let [[r1 r2] (random/split rng)
           value (call-gen gen r1 size)]
       (if (pred (rose/root value))
         (rose/filter pred value)
@@ -414,7 +414,7 @@

 (def neg-int
   "Generate negative integers bounded by the generator's `size` parameter."
-  (fmap (partial * -1) nat))
+  (fmap #(* -1 %) nat))

 (def s-pos-int
   "Generate strictly positive integers bounded by the generator's `size`
@@ -485,7 +485,7 @@
   if it's not already."
   [coll]
   (let [index-gen (choose 0 (dec (count coll)))]
-    (fmap (partial reduce swap (vec coll))
+    (fmap #(reduce swap (vec coll) %)
           ;; a vector of swap instructions, with count between
           ;; zero and 2 * count. This means that the average number
           ;; of instructions is count, which should provide sufficient
@@ -510,7 +510,7 @@
   `key-gen` and values chosen from `val-gen`."
   [key-gen val-gen]
   (let [input (vector (tuple key-gen val-gen))]
-    (fmap (partial into {}) input)))
+    (fmap #(into {} %) input)))

 (defn hash-map
   "Like clojure.core/hash-map, except the values are generators.
@@ -527,7 +527,7 @@
         vs (take-nth 2 (rest kvs))]
     (assert (every? generator? vs)
             "Value args to hash-map must be generators")
-    (fmap (partial zipmap ks)
+    (fmap #(zipmap ks %)
           (apply tuple vs))))

 (def char


RawTable and RawColumn need to be in our load-from-h2 command.

--- src/metabase/cmd/load_from_h2.clj
+++ src/metabase/cmd/load_from_h2.clj
@@ -21,6 +21,8 @@
                              [pulse-channel :refer [PulseChannel]]
                              [pulse-channel-recipient :refer [PulseChannelRecipient]]
                              [query-execution :refer [QueryExecution]]
+                             [raw-table :refer [RawTable]]
+                             [raw-column :refer [RawColumn]]
                              [revision :refer [Revision]]
                              [segment :refer [Segment]]
                              [session :refer [Session]]
@@ -35,6 +37,8 @@
    This is done so we make sure that we load load instances of entities before others
    that might depend on them, e.g. `Databases` before `Tables` before `Fields`."
   [Database
+   RawTable
+   RawColumn
    User
    Setting
    Dependency


Added core.async dependency to the project.

--- app/project.clj
+++ app/project.clj
@@ -17,7 +17,8 @@
                  [reagent "0.5.0"]
                  [secretary "1.2.3"]
                  [com.novemberain/monger "2.0.1"]
-                 [clj-time "0.9.0"]]
+                 [clj-time "0.9.0"]
+                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]]
   :main ^:skip-aot clj-web-example.main
   :target-path "target/%s"
   :profiles {:dev {:resource-paths ["target/dev"]


move response-log agent to locally bound var rather than namespaced

This allows multiple load tests to run if desired without stomping on a global var.

--- ws-client/src/main/clojure/ws/client/ws-client.clj
+++ ws-client/src/main/clojure/ws/client/ws-client.clj
@@ -3,7 +3,7 @@
   (:require [clj-http.client :as http]
             [clojure.java.io :as io]))

-(declare send-requests response-log)
+(declare send-requests)

 (defn run-load-test
   "Execute load test against given URL
@@ -15,23 +15,22 @@
   ([url] (run-load-test url (-> (Runtime/getRuntime) .availableProcessors)))
   ([url num-threads]
     (println "Starting load test")
-    (with-open [log-writer (writer "/tmp/test2.txt")]
-      (println "Log file opened")
-      (http/with-connection-pool {:timeout 500 :threads 20 :insecure? false :default-per-route 20}
-        (let [futures (doall (for [i (range num-threads)]
-                             (future
-                               (println "send-requests starting in thread: " (Thread/currentThread))
-                               (send-requests url 10 log-writer num-threads))))]
-          (println "starting")
-          (doseq [f futures]
-            ; wait for each future to complete
-            (deref f))
-          ; (println (deref f 900 #(future-cancel f))) ; this isn't working (returns function but doesn't execute it)
-          (println "Done load test."))))))
-
-
-; used for sending response logs to and serializing them to output
-(def response-log (agent 0))
+    ; response-log-agent: used for sending response logs to and serializing them to output
+    (let [response-log-agent (agent 0)]
+	    (with-open [log-writer (writer "/tmp/test2.txt")]
+	      (println "Log file opened")
+	      (http/with-connection-pool {:timeout 500 :threads 20 :insecure? false :default-per-route 20}
+	        (let [futures (doall (for [i (range num-threads)]
+	                             (future
+	                               (println "send-requests starting in thread: " (Thread/currentThread))
+	                               (send-requests url 10 log-writer response-log-agent num-threads))))]
+	          (println "starting")
+	          (doseq [f futures]
+	            ; wait for each future to complete
+	            (deref f))
+	          ; (println (deref f 900 #(future-cancel f))) ; this isn't working (returns function but doesn't execute it)
+	          (println "Done load test.")))))))
+

 (defmacro duration-in-millis
   "Evaluates expr and records the time it took in millis.
@@ -45,8 +44,8 @@
 (defn- send-response-log
   "Function that will 'send-off' for asynchronously logging response metrics.
    This function itself should not nothing blocking."
-  [time-in-millis log-writer num-threads]
-  (send-off response-log (fn [count]
+  [time-in-millis response-log-agent log-writer num-threads]
+  (send-off response-log-agent (fn [count]
               (.write log-writer (str "timestamp:" (System/currentTimeMillis) " threads: " num-threads " duration: " time-in-millis "\n"))
               (if (= 10 count)
                 (do
@@ -58,14 +57,14 @@

 (defn- send-requests
   "Send an HTTP request 'count' times and log metrics after each response."
-  [url count log-writer num-threads]
+  [url count log-writer response-log-agent num-threads]
   (dotimes [n count]
       (let
         ; we generate a random id to seed the request with a different arg each request
         [url (str url "?id=" (rand-int 999999))]
         ; perform http/get inside duration-in-millis macro which passes the
         ; duration of the http/get function to the following function
-        (duration-in-millis (http/get url) #(send-response-log % log-writer num-threads))
+        (duration-in-millis (http/get url) #(send-response-log % response-log-agent log-writer num-threads))
         )))


fix #10591 error when scrolling account view

Signed-off-by: yenda <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>

--- src/status_im/ui/screens/wallet/account/styles.cljs
+++ src/status_im/ui/screens/wallet/account/styles.cljs
@@ -32,7 +32,7 @@
    anim-y
    {:toValue 0
     :duration 200
-    :easing (.-ease ^js (animation/easing))
+    :easing (.-ease ^js animation/easing)
     :useNativeDriver true}))

 (defn bottom-send-recv-buttons-lower [anim-y y]
@@ -40,5 +40,5 @@
    anim-y
    {:toValue y
     :duration 200
-    :easing (.-ease ^js (animation/easing))
+    :easing (.-ease ^js animation/easing)
     :useNativeDriver true}))


Published wrong version.

Published wrong version.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -758,10 +758,7 @@
   domination-edge
   [?d ?s]
   (all
-    (aspect ?d)
-    (aspect ?s)
-    (!= ?d ?s)
-    (conda ;;to shortcut edges that would succeeds for both
+    (conde
       [(aspect-dominates-aspect-explicitly+ ?d ?s)]
       [(aspect-dominates-aspect-implicitly+ ?d ?s)])))

@@ -777,14 +774,14 @@
       (aspect-dominates-aspect ?dominator ?subordinate [])))
   ([?dominator ?subordinate ?explored-subs]
     (fresh [?sub]
-           (conde
-             [(aspect-dominates-aspect-explicitly+ ?dominator ?sub)]
-             [(aspect-dominates-aspect-implicitly+ ?dominator ?sub)])
+           (domination-edge ?dominator ?sub)
+           (fails (contains ?explored-subs ?sub))
            (conde
              [(== ?subordinate ?sub)]
              [(fresh [?new-explored-subs]
                      (equals ?new-explored-subs (conj ?explored-subs ?sub))
-                     (aspect-dominates-aspect ?sub ?subordinate ?new-explored-subs))]))))
+                     (aspect-dominates-aspect ?sub ?subordinate ?new-explored-subs))])
+           (fails (aspect-dominates-aspect-explicitly+ ?subordinate ?dominator)))))

 ;; Link between World (aka weaverworld) and AJProjectModelFacade (aka xcut)


Relations type|synthetic, member|synthetic, nestedtype-outertype+, topleveltype.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -311,8 +311,16 @@
     (succeeds (.isNested ?resolvedtype))))

 (defn
+  topleveltype
+  "Relation of non-nested types known to the AspectJ weaver."
+  [?type]
+  (all
+    (type ?type)
+    (equals false (.isNested ?type))))
+
+(defn
   nestedtype-outertype
-  "Relation between a nested and its outer type.
+  "Relation between a nested and its immediate outer type.

    e.g., (ekeko* [?i ?o]  (interface ?i) (nestedtype-outertype ?i ?o))

@@ -321,6 +329,16 @@
   (all
     (nestedtype ?nested)
     (equals ?outer (.getOuterClass ?nested)))) ;also returns other outer types
+
+(defn
+  nestedtype-outertype+
+  "Relation between a nested and one of its encompassing outer types."
+  [?nested ?outer]
+  (conde
+    [(nestedtype-outertype ?nested ?outer)]
+    [(fresh [?o]
+            (nestedtype-outertype ?nested ?o)
+            (nestedtype-outertype ?o ?outer))]))

 (defn
@@ -334,7 +352,6 @@
            [(== ?outermost ?outer)])))

-
 (defn
   aspect
   "Relation of aspects known to the weaver."
@@ -487,31 +504,56 @@
      (fresh [?type]
             (type-member ?type ?member))]))

-;(defn
-;  type-member
-;  "Relation between a type and one of its declared members as known to the weaver."
-
 (defn-
-  resolvedmember-synthetic?
-  [?resolvedmember ?syntheticbool]
-  (all
-    (member ?resolvedmember)
-    (equals ?syntheticbool (.isSynthetic ?resolvedmember))))
-
-(defn
-  syntheticmember
-  "Relation of synthetic members."
-  [?resolvedmember]
-  (all
-    (resolvedmember-synthetic? ?resolvedmember true)))
+  type|ajsynthetic?
+  [?type ?boolean]
+  (all
+    (equals ?boolean (.isSynthetic ?type))))
+
+
+(defn
+  type|nonsynthetic
+  "Relation of types that are not AspectJ synthetic."
+  [?type]
+  (all
+    (type ?type)
+    (type|ajsynthetic? ?type false)))
+
+(defn
+  type|synthetic
+  "Relation of types that are AspectJ synthetic."
+  [?type]
+  (all
+    (type ?type)
+    (type|ajsynthetic? ?type true)))
+
+
+(defn-
+  member|ajsynthetic?
+  [?member ?boolean]
+  (all
+    ;;note: do not use .isSynthetic on ResolvedMember,
+    ;;those are java-based synthetics (rather than ajc-based synthetics)
+    (equals ?boolean (.isAjSynthetic ?member))))
+
+
+
+(defn
+  member|synthetic
+  "Relation of members that are AspectJ synthetic (e.g., hasAspect())."
+  [?member]
+  (all
+    (member ?member)
+    (member|ajsynthetic? ?member true)))

-(defn
-  nonsyntheticmember
-  "Relation of nonsynethic members."
-  [?resolvedmember]
-  (all
-     (resolvedmember-synthetic? ?resolvedmember false)))
-
+;;TODO: perhaps filter out using signature?
+(defn
+  member|nonsynthetic
+  "Relation of members that are not AspectJ synthetic. Still includes members implementing ITD."
+  [?member]
+  (all
+    (member ?member)
+    (member|ajsynthetic? ?member false)))

 (defn
   aspect-declaredinterface


Remove helper `complete-select-query` since it's redundant

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -84,16 +84,6 @@
 ;;
 ;; Select Query
 ;;
-
-(defn- complete-select-query
-  [statements]
-  (let [query-map (into {} statements)]
-    (if (nil? (or (:what-columns query-map)
-                  (:what-column query-map)
-                  (:what-count query-map)
-                  (:what-fcall query-map)))
-      (conj statements (all))
-      statements)))

 (let [where-clause (fn [query-builder m]
                      (reduce #(.and %1 %2)
@@ -155,7 +145,6 @@
   (defn select
     [table-name & statements]
     (->> (conj statements (from table-name))
-         (complete-select-query)
          (sort-by #(get order (first %)))
          ;; (map second)
          (reduce (fn [builder [statement-name statement-args]]


Fix ordering in ns form

Fix ordering in ns form

--- test/com/nomistech/clojure_the_language/c_850_utils/s_200_test_utils.clj
+++ test/com/nomistech/clojure_the_language/c_850_utils/s_200_test_utils.clj
@@ -1,8 +1,8 @@
 (ns com.nomistech.clojure-the-language.c-850-utils.s-200-test-utils
   (:require [clojure.core.async :as a]
             [clojure.string :as str]
-            [taoensso.timbre :as timbre]
-            [midje.sweet :refer :all]))
+            [midje.sweet :refer :all]
+            [taoensso.timbre :as timbre]))

 ;;;; ___________________________________________________________________________
 ;;;; ---- with-ignore-logging ----


Step 4: Moving entities

Step 4: Moving entities

--- desktop/src-common/brain_gain_or_drain/screens/game.clj
+++ desktop/src-common/brain_gain_or_drain/screens/game.clj
@@ -5,6 +5,15 @@
                       [utils :as u]]
             [brain-gain-or-drain [entity :refer :all]
                                  [domain :refer :all]]))
+
+(defn move-entity
+  [delta-time logo]
+  (let [delta-x (* 4 60 delta-time)]
+    (assoc logo :x (-> (:x logo) (- delta-x)))))
+
+(defn move-entities
+  [delta-time entities]
+  (mapv #(move-entity delta-time %) entities))

 (defscreen game-screen
   :on-show
@@ -24,6 +33,7 @@
     (clear!)
     (->> entities
          (bind-entities (:resources screen))
+         (move-entities (:delta-time screen))
          (render! screen)))

   :on-resize


Add helper ns.

Add helper ns.

--- src/videotest/tri_cv/motion_core.clj
+++ src/videotest/tri_cv/motion_core.clj
@@ -1,5 +1,6 @@
 (ns videotest.tri-cv.motion-core
   (:require
+   [quil.applet :as qa :only [applet-close]]
    [quil.core :as q]
    [quil.middleware :as m]
    [videotest.tri-cv.cv :as cv])


STORM-596:delete extra ')' in function loader#launch-receive-thread!

--- storm-core/src/clj/backtype/storm/daemon/worker.clj
+++ storm-core/src/clj/backtype/storm/daemon/worker.clj
@@ -384,7 +384,7 @@
     (:receiver-thread-count worker)
     (:port worker)
     (:transfer-local-fn worker))
-    :kill-fn (fn [t] (exit-process! 11))))
+    :kill-fn (fn [t] (exit-process! 11)))

 (defn- close-resources [worker]
   (let [dr (:default-shared-resources worker)]


A wide wrapper for the standard clojure.pprint

--- src/polismath/pretty_printers.clj
+++ src/polismath/pretty_printers.clj
@@ -1,4 +1,5 @@
-(ns polismath.pretty-printers)
+(ns polismath.pretty-printers
+  (:require 'clojure.pprint :refer :all))

 (defn str-repeat [s n]
@@ -17,3 +18,9 @@
       (prindent indent 2 c))))

+(defn wide-pp [x]
+  (binding [*print-miser-width*  400
+            *print-right-margin* 400]
+    (pprint x)))
+
+


remove ph logo

remove ph logo


Bugfix for CIRCLE-1348

Bugfix for CIRCLE-1348

https://circleci.atlassian.net/browse/CIRCLE-1348

3 links to the outer site need `open-ext` love

--- src-cljs/frontend/components/errors.cljs
+++ src-cljs/frontend/components/errors.cljs
@@ -40,11 +40,11 @@
              [:h3 "You may have been logged out. "]
              [:p.error-message
               "Learn more about "
-              [:a {:href "/"} "CircleCI"]
+              [:a (open-ext {:href "/"}) "CircleCI"]
               " , "
-              [:a {:href "/mobile/osx/"} "CircleCI for OS X"]
+              [:a (open-ext {:href "/mobile/osx/"}) "CircleCI for OS X"]
               ", or "
-              [:a {:href "/enterprise/"} "CircleCI for Enterprise"]
+              [:a (open-ext {:href "/enterprise/"}) "CircleCI for Enterprise"]
               "."]]
             :else "Something completely unexpected happened")]]
         [:.jumbotron


Uncomment features in footer

Uncomment features in footer

--- src-cljs/frontend/components/footer.cljs
+++ src-cljs/frontend/components/footer.cljs
@@ -18,7 +18,7 @@
      [:ul.list-unstyled
       [:li.header "Product"]
       ;; TODO: features page
-      ;; [:li [:a {:href "/features"} "Features"]]
+      [:li [:a {:href "/features"} "Features"]]
       [:li [:a {:href "/mobile"} "Mobile"]]
       [:li [:a {:href "/enterprise"} "Enterprise"]]
       (when-not (config/enterprise?)


CMR-762: Added ocsd fields.

CMR-762: Added ocsd fields.

--- src/cmr/search/results_handlers/atom_results_handler.clj
+++ src/cmr/search/results_handlers/atom_results_handler.clj
@@ -5,7 +5,6 @@
             [cmr.search.services.query-service :as qs]
             [cmr.search.services.query-execution.granule-counts-results-feature :as gcrf]
             [cmr.search.services.query-execution.facets-results-feature :as frf]
-            [cmr.indexer.data.concepts.granule :as idxg]
             [clojure.data.xml :as x]
             [clojure.walk :as walk]
             [cheshire.core :as json]
@@ -67,12 +66,22 @@
    "access-value" ;; needed for acl enforcment
    ])

+(def ocsd-fields
+  "The fields for orbit calculated spatil domains, in the order that they are stored in the jason
+  string in the index."
+  [:equator-crossing-date-time
+   :equator-crossing-longitude
+   :orbital-model-name
+   :orbit-number
+   :start-orbit-number
+   :stop-orbit-number])
+
 (defn ocsd-json->map
   "Conver the orbit calculated spatial domain json string from elastic into a map. The string
   is stored internally as a vector of values."
   [json-str]
   (let [value-array (json/decode json-str)]
-    (zipmap idxg/ocsd-fields value-array)))
+    (zipmap ocsd-fields value-array)))

 (defn- collection-elastic-result->query-result-item
   [elastic-result]


CMR-2810 Checks additional fields in ACL tombstone

--- access-control-app/int_test/cmr/access_control/int_test/acl_crud_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_crud_test.clj
@@ -211,11 +211,11 @@
                                                                  :collection_applicable true
                                                                  :provider_id "PROV1"}}
                                         {:token token}))
-        coll1 (u/save-collection token {:entry-title "coll1"
-                                        :native-id "coll1"
-                                        :entry-id "coll1"
-                                        :short-name "coll1"
-                                        :provider-id "PROV1"})]
+        coll1 (u/save-collection {:entry-title "coll1"
+                                  :native-id "coll1"
+                                  :entry-id "coll1"
+                                  :short-name "coll1"
+                                  :provider-id "PROV1"})]
     (testing "created ACL grants permissions (precursor to testing effectiveness of deletion)"
       (is (= {coll1 ["read"]}
              (json/parse-string
@@ -242,7 +242,13 @@
       (is (= nil
              (ac/get-acl (u/conn-context) acl-concept-id))))
     (testing "tombstone can be retrieved from Metadata DB"
-      (is (:deleted (mdb/get-latest-concept (u/conn-context) acl-concept-id))))
+      (is (= {:deleted true
+              :revision-id 2
+              :metadata ""
+              :concept-id acl-concept-id}
+             (select-keys
+               (mdb/get-latest-concept (u/conn-context) acl-concept-id)
+               [:deleted :revision-id :metadata :concept-id]))))
     (testing "permissions granted by the ACL are no longer in effect"
       (is (= {coll1 []}
              (json/parse-string


test-construction just failed on openjdk and ibm

--- dada-core/src/test/clojure/org/dada/core/test_clojure.clj
+++ dada-core/src/test/clojure/org/dada/core/test_clojure.clj
@@ -39,12 +39,12 @@

 ;;     ))

-(import java.lang.reflect.Constructor)
-(deftest test-construction
-  (let [^Constructor c (.getConstructor Value (into-array Class [Object]))]
-    (is (faster 10000000 (Value. 0) (.newInstance c (into-array Object [0]))))
-    (let [^{:tag (type (into-array Object []))} a (into-array Object [0])]
-      (is (faster 100000000 (Value. 0) (.newInstance c a))))))
+;; (import java.lang.reflect.Constructor)
+;; (deftest test-construction
+;;   (let [^Constructor c (.getConstructor Value (into-array Class [Object]))]
+;;     (is (faster 10000000 (Value. 0) (.newInstance c (into-array Object [0]))))
+;;     (let [^{:tag (type (into-array Object []))} a (into-array Object [0])]
+;;       (is (faster 100000000 (Value. 0) (.newInstance c a))))))

 ;; I'm not going to test this - just make a note of it...
 (deftest test-record-vs-pojo


Add support for API links and tables.

Add support for API links and tables.

--- hyde-pallet-core/src/com/palletops/hyde_pallet/core.clj
+++ hyde-pallet-core/src/com/palletops/hyde_pallet/core.clj
@@ -68,10 +68,74 @@
 ;; #dd/start test
 (defrecord Snippet [snippet])
 (defmethod hyde/render Snippet [s]
-  (let [snippets (:snippets api)
+  (let [snippets (:snippets *api*)
         key (keyword (:snippet s))]
     (:content (get snippets key))))
 ;; #dd/end
+
+(defn render-table [[headers rows]]
+  (str
+   "

\n"
+   (apply str (map #(format "%s	\n" %) headers) )
+   "

\n"
+   "
\n"
+   (apply str
+          (map
+           #(format "
%s
\n"
+                    (apply str
+                           (map
+                            (fn [x]
+                              (str "{% capture content %}"
+                                   x
+                                   "{% endcapture %}{{ content | markdownify }}	"))
+                            %)))
+           rows))
+   "

\n"))
+
+(defrecord Table [table])
+(defmethod hyde/render Table [t]
+  (render-table (:table t)))
+
+(defn get-api
+  ([api name]
+     (let [nss (map :vars (:namespaces api))
+           hits (mapcat (partial filter #(= name (:name %))) nss)
+           hitn (count hits)]
+       (cond
+        (> hitn 1) (throw
+                    (ex-info
+                     (format "The api name %s appears in more than one namespace: %s"
+                             name
+                             (map :ns hits))
+                     {}))
+        (= hitn 1) (first hits)
+        (= hitn 0) (throw
+                    (ex-info
+                     (format "the api name %s is not found" name)
+                     {}))))))
+
+(defrecord Api-Link [name])
+(defmethod hyde/render Api-Link [api]
+  (let [entry (get-api *api* (:name api))]
+    (format "[%s](/api.html#%s)" (:name api) (:name api))))
+
+(defrecord Api-Entry [name])
+(defmethod hyde/render Api-Entry [api]
+  (let [entry (get-api *api* (:name api))]
+    (str "
"
+     (format "%s/%s: %s "
+             (:ns entry)
+             (:name entry)
+             (with-out-str (clojure.pprint/pprint (:arglists entry))))
+     "
where:
"
+     (render-table [["Parameter" "Description"] [["api-doc" "Documentation on this api doc"]]])
+     "
")))
+
+(defn load-api []
+  (clean-api
+   ;; TODO: the source paths should come from the project
+   {:namespaces (doall (docudata/docudata ["src"] {}))
+    :snippets (doall (docudata/snippets-in-path "."))}))

 (defn build-site [root jekyll-config site-config]
   (hyde/create-collections-dirs! root site-config)
@@ -90,17 +154,15 @@
     [{:title "Home" :href "/"}
      {:title "Documentation" :href "/README.html"}
      {:title "API" :href "/api.html"}
-     {:title "About" :href "/about"}]})
+     {:title "Example" :href "/example.html"}]})

   (binding [hyde/*tag-map* {'pallet/project #'->Project
-                            'hyde/snippet #'->Snippet}
-            *api* (clean-api
-                  ;; TODO: the source paths should come from the project
-                  {:namespaces (doall (docudata/docudata ["src"] {}))
-                   :snippets (doall (docudata/snippets-in-path "."))}
-                  ;;(edn/read-string (slurp "target/docudata.edn"))
-                  )]
-    (hyde/write-data! root "api-doc" *api*)
+                            'hyde/snippet #'->Snippet
+                            'pallet/table #'->Table
+                            'pallet/api-link #'->Api-Link
+                            'pallet/api-entry #'->Api-Entry}
+            *api* (load-api)]
+    (hyde/write-data! root "api-doc" *api* {})
     (hyde/write-collection!
      root
      "api"


DM + RS | #145 | Stonecutter 26 | Fix unit tests

--- test/objective8/unit/workflows/stonecutter_test.clj
+++ test/objective8/unit/workflows/stonecutter_test.clj
@@ -1,12 +1,13 @@
 (ns objective8.unit.workflows.stonecutter-test
   (:require [midje.sweet :refer :all]
+            [stonecutter-oauth.client :as soc]
             [objective8.utils :as utils]
             [objective8.front-end.workflows.stonecutter :refer :all]))

 (fact "stonecutter-sign-in generates the correct response"
       (stonecutter-sign-in {:stonecutter-config ...config...}) => ...stonecutter-sign-in-response...
       (provided
-        (authorisation-redirect-response ...config...) => ...stonecutter-sign-in-response...))
+        (soc/authorisation-redirect-response ...config...) => ...stonecutter-sign-in-response...))

 (fact "stonecutter-callback redirects to the sign-in workflow with the auth-provider-user-id set in the session"
       (stonecutter-callback {:stonecutter-config ...config... :params {:code ...auth-code...}})
@@ -14,7 +15,7 @@
                     :headers {"Location" (str utils/host-url "/sign-up")}
                     :session {:auth-provider-user-id "stonecutter-USER_ID"}})
       (provided
-        (request-access-token! ...config... ...auth-code...)
+        (soc/request-access-token! ...config... ...auth-code...)
         => {:status :success
             :token {:user-id "USER_ID"}}))


Fixed some test errors

Fixed some test errors

--- test/src/dda/pallet/dda_managed_ide/domain_test.clj
+++ test/src/dda/pallet/dda_managed_ide/domain_test.clj
@@ -28,9 +28,13 @@
                          :password "pwd"}
                   :target-type :remote-aws
                   :ide-platform #{:atom}
-                  :git   {:os-user :test
-                          :user-email "email"
-                          :repos {:mytest ["https://github.com:my/test.git"]}}}
+                  :git   {:test
+                          {:user-email "email"
+                           :repo {:mytest [{:host "github.com"
+                                            :protocol :https
+                                            :orga-path "my"
+                                            :repo-name "test"
+                                            :server-type :github}]}}}}
    :dda-vm-domain {:user {:name "test", :password "pwd"},
                    :target-type :remote-aws,
                    :usage-type :desktop-ide}


Use revolver.house/kaffi as slack message url

--- src/clj/mokkameister/resources/slack.clj
+++ src/clj/mokkameister/resources/slack.clj
@@ -16,7 +16,7 @@
    4 "Femte gong? "})

 (def ^:private mokkameister-link
-  "<https://mokkameister.herokuapp.com/|Mokkameister>")
+  "<https://revolver.house/kaffi/|Mokkameister>")

 (defn- coffee-message-starting [{:keys [slack-user brew-time]} today-count]
   (format "God nyhendnad folket! %s%s starta nett traktaren, kaffi om %d minuttar!"


added new and better modulus wrap

added new and better modulus wrap

--- src/cljs/defender_cljs/canvas/scene.cljs
+++ src/cljs/defender_cljs/canvas/scene.cljs
@@ -50,23 +50,16 @@
 ;;based on the current position of the main camera
 ;;this gives the impression that the actors are on a finite map bound on the x axis

-(defn modulus-wrap
-  "the map world is [-map-width/2, map-width/2]. This function wraps
-  the x coordinate into that range"
-  [x]
-  (let [[camx _ _] (a/get-position camera/main-camera)
-        extent (/ c/map-width 2)
-        xmax (+ camx extent)
-        xmin (- camx extent)]
-    (cond
-     (> x xmax)
-     (+ xmin (rem x xmax))
-     (< x xmin)
-     (- xmax (rem x xmin))
-     :else x)))
+(defn modulus-wrap [entity-x camera-x]
+  (let [xmin 0
+        xmax map-width
+        local-x (- entity-x camera-x)]
+    (if (or (> local-x xmax) (< local-x xmin))
+      (+ camera-x (mod local-x xmax))
+      entity-x)))

 (defn generate-fixed-width-map []
-  (let [[x _ _] (a/get-position camera/main-camera)
+  (let [[cam-x _ _] (a/get-position camera/main-camera)
         actors
         (filter
          (fn [actor]
@@ -75,8 +68,8 @@
             :else true))
          @(:actor-list main))]
     (doseq [actor actors]
-      (let [[xpos ypos zpos] (a/get-position actor)
-            xpos (modulus-wrap xpos)]
+      (let [[entity-x ypos zpos] (a/get-position actor)
+            entity-x (modulus-wrap entity-x cam-x)]
         (a/set-position! actor [xpos ypos zpos])))))

 (system/add-system!


Propertly handle nil doc

Propertly handle nil doc

Fixes #49

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -68,9 +68,10 @@
     :repl-special-function true))

 (defn reflow [text]
-  (-> text
-    (s/replace #" \n  " "")
-    (s/replace #"\n  " " ")))
+  (and text
+    (-> text
+     (s/replace #" \n  " "")
+     (s/replace #"\n  " " "))))

 (defn ^:export read-eval-print [line]
   (binding [ana/*cljs-ns* @current-ns


file exist check

file exist check

--- src/clojure/zensols/model/classifier.clj
+++ src/clojure/zensols/model/classifier.clj
@@ -143,11 +143,12 @@
   file is missing"
   [name & {:keys [fail-if-not-exists?] :or {fail-if-not-exists? true}}]
   (let [res (model-read-resource name)
-        exists? (and (instance? File res) (.exists res))]
-    (if (and fail-if-not-exists? (instance? File res) (not exists?))
+        file-res? (instance? File res)
+        exists? (and file-res? (.exists res))]
+    (if (and fail-if-not-exists? file-res? (not exists?))
       (throw (ex-info (format "no model file found: %s" res)
                       {:file res})))
-    (if-not exists?
+    (if (and file-res? (not exists?))
       (log/infof "no model resource found %s" res)
       (do
         (log/infof "reading model from %s" res)


Push branch to github.

Push branch to github.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -411,4 +411,4 @@
                                          (:ancestors parent1)))
            :is-random-replacement
            (if variant false true)
-      )))
+      )))


add auth to frontend

add auth to frontend


fixed tick race condition

fixed tick race condition

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -181,13 +181,14 @@
   (swap! app-state merge (make-game @app-state default-size))
   (defonce tick-loop
     (go-loop [tick 0]
+      (<! (timeout (:tick-ms @app-state)))
+      (<! raf-chan)
       (let [app        @app-state
             moves      (:moves app)
-            move-count (count moves)]
+            move-count (count moves)
+            tick       (if (>= tick move-count) 0 tick)]
         (swap! app-state assoc :tick tick)
         (paint-canvas! app tick)
-        (<! raf-chan)
-        (<! (timeout (:tick-ms app)))
         (if (or (zero? move-count) (= tick (dec move-count)))
           (recur 0)
           (recur (inc tick)))))))


Some refactoring

Some refactoring


Fix clearing svg

Fix clearing svg

--- src/export_server/utils/rasterizator.clj
+++ src/export_server/utils/rasterizator.clj
@@ -34,9 +34,6 @@
       (clojure.string/replace #"stroke=\"rgba\(([^,\)]*),([^,\)]*),([^,\)]*),([^,\)]*)\)\""
                               "stroke=\"rgb($1,$2,$3)\" stroke-opacity=\"$4\"")))

-(defn- clear-svg [svg]
-  (-> svg remove-empty-img remove-opacity replace-rgba))
-
 (defn- trim-svg-string [str]
   (let [left-trim-str (clojure.string/replace str #"^\"" "")
         right-trim-str (clojure.string/replace left-trim-str #"\"$" "")]
@@ -45,6 +42,9 @@
 (defn- remove-cursor [svg]
   (clojure.string/replace svg #"cursor\s*:\s*[\w-]+\s*;?\s*" ""))

+(defn- clear-svg [svg]
+  (-> svg remove-cursor remove-empty-img remove-opacity replace-rgba))
+
 ;====================================================================================
 ; SVG --> PDF
 ;====================================================================================
@@ -52,7 +52,7 @@
   (try
     (with-open [out (new ByteArrayOutputStream)]
       (pdf [{:size pdf-size :orientation (if landscape :landscape nil)}
-            [:svg {:translate [x y]} (clear-svg (remove-cursor (trim-svg-string svg)))]]
+            [:svg {:translate [x y]} (clear-svg (trim-svg-string svg))]]
            out)
       {:ok true :result (.toByteArray out)})
     (catch Exception e {:ok false :result (.getMessage e)})))
@@ -64,7 +64,7 @@
 (defn svg-to-jpg [svg widht height force-transparent-white quality]
   (try
     (with-open [out (new ByteArrayOutputStream)]
-      (let [svg (-> svg remove-cursor remove-empty-img replace-rgba)
+      (let [svg (clear-svg svg)
             string-reader (new StringReader svg)
             transcoder-input (new TranscoderInput string-reader)
             transcoder-output (new TranscoderOutput out)
@@ -83,7 +83,7 @@
 (defn svg-to-png [svg widht height force-transparent-white]
   (try
     (with-open [out (new ByteArrayOutputStream)]
-      (let [svg (-> svg remove-cursor remove-empty-img replace-rgba)
+      (let [svg (clear-svg svg)
             string-reader (new StringReader svg)
             transcoder-input (new TranscoderInput string-reader)
             transcoder-output (new TranscoderOutput out)


colorize floats; fix macro form printing

--- src/com/billpiel/sayid/string_output2.clj
+++ src/com/billpiel/sayid/string_output2.clj
@@ -239,18 +239,18 @@
          [(tkn "!" :fg 1 :bg 7) (tkn " ")])
        (if parent-name
          [(tkn (if-not (nil? form)
-                      form
-                      name)
-                    :fg 0 :bg* (dec depth) :bold false)
+                 [form]
+                 name)
+               :fg 0 :bg* (dec depth) :bold false)
           (when macro?
             (tkn [" => " (str xpanded-frm)]
-                      :fg* (dec depth) :bg 0 :bold false))
-          (tkn "  " (str parent-name)
-                    :fg* (dec depth) :bg 0 :bold false)]
+                 :fg* (dec depth) :bg 0 :bold false))
+          (tkn ["  " (str parent-name)]
+               :fg* (dec depth) :bg 0 :bold false)]
          (tkn name :fg* (dec depth) :bg 0 :bold false))
        (tkn "  ")
        (tkn (-> tree :id str)
-                 :fg 7)])))
+            :fg 7)])))

 (defmacro when-sel
   [kw & body]
@@ -331,6 +331,7 @@
 (defn apply-type-colors-to-token
   [token]
   (let [type->color {:int :cyan
+                     :float :cyan
                      :string :magenta
                      :keyword :yellow
                      :symbol :cyan


Make «die-with-error» to be a macro

Make «die-with-error» to be a macro

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

--- src/conexp/util.clj
+++ src/conexp/util.clj
@@ -192,13 +192,10 @@
                   0)]
     (split-at index sequence)))

-(defn die-with-error
+(defmacro die-with-error
   "Stops program by raising the given error with strings as message."
   [^Class error, strings]
-  (assert (isa? error Throwable))
-  (throw (.. error
-             (getConstructor (into-array Class [String]))
-             (newInstance (into-array Object [(apply str strings)])))))
+  `(throw (new ~error ^String (apply str ~strings))))

 (defn illegal-argument
   "Throws IllegalArgumentException with given strings as message."


add :simple-check.clojure-test/defspec metadata to each test var

--- src/simple_check/clojure_test.clj
+++ src/simple_check/clojure_test.clj
@@ -21,8 +21,9 @@
      ;; Don't think we'll know what the solution is until simple-check
      ;; integration with another test framework is attempted.
      (require 'simple-check.core)
-     (defn ~(vary-meta name assoc :test
-                       `#(#'assert-check (assoc (~name) :test-var (str '~name))))
+     (defn ~(vary-meta name assoc
+                       ::defspec true
+                       :test `#(#'assert-check (assoc (~name) :test-var (str '~name))))
        ([] (~name ~default-times))
        ([times# & {:keys [seed# max-size#] :as quick-check-opts#}]
           (apply


Reduce weight of gridlines.

Reduce weight of gridlines.

--- metlog-vault/src-client/metlog_client/tsplot.cljs
+++ metlog-vault/src-client/metlog_client/tsplot.cljs
@@ -61,7 +61,7 @@
   {:grid
    {:line-width 0
     :stroke-style "#707070"
-    :line-dash #js [ 2 2 ]}
+    :line-dash #js [ 1 1 ]}

    :grid-emphasis
    {:line-width 0


Add key

Add key

--- src/squelch/nodes/oscillator.cljs
+++ src/squelch/nodes/oscillator.cljs
@@ -16,7 +16,7 @@
   (though the AudioParam returned is read-only, the value it represents is
   not.)"
   [oscillator frequency]
-  (set! (.- oscillator) frequency))
+  (set! (.-frequency oscillator) frequency))

 (defn get-detune
   "An a-rate AudioParam representing detuning of oscillation in cents (though


empty sections

empty sections

Former-commit-id: 739ca7cb1babd1b818bcd81e1867ce9d8ddae048

--- src/syng_im/components/react.cljs
+++ src/syng_im/components/react.cljs
@@ -15,7 +15,9 @@
    (merge {:underlay-color :transparent} props)
    content])
 (def toolbar-android (r/adapt-react-class (.-ToolbarAndroid js/React)))
-(def list-view (r/adapt-react-class (.-ListView js/React)))
+(def list-view-class (r/adapt-react-class (.-ListView js/React)))
+(defn list-view [props]
+  [list-view-class (merge {:enableEmptySections true} props)])
 (def scroll-view (r/adapt-react-class (.-ScrollView js/React)))
 (def touchable-without-feedback (r/adapt-react-class (.-TouchableWithoutFeedback js/React)))
 (def text-input-class (r/adapt-react-class (.-TextInput js/React)))


Add schema to the rulebase structure.

Add schema to the rulebase structure.

--- src/main/clojure/clara/rules/compiler.clj
+++ src/main/clojure/clara/rules/compiler.clj
@@ -9,16 +9,30 @@
             [clara.rules.schema :as schema]
             [schema.core :as sc]
             [schema.macros :as sm])
-  (:import [clara.rules.engine ProductionNode QueryNode LocalTransport LocalSession]))
+  (:import [clara.rules.engine ProductionNode QueryNode JoinNode NegationNode TestNode
+                               AccumulateNode AlphaNode LocalTransport LocalSession]))

 ;; Protocol for loading rules from some arbitrary source.
 (defprotocol IRuleSource
   (load-rules [source]))

+;; These nodes exist in the beta network.
+(def BetaNode (sc/either ProductionNode QueryNode JoinNode
+                         NegationNode TestNode AccumulateNode))
+
 ;; A rulebase -- essentially an immutable Rete network with a collection of alpha and beta nodes and supporting structure.
-(defrecord Rulebase [alpha-roots beta-roots productions queries production-nodes query-nodes id-to-node]
-  IRuleSource
-  (load-rules [this] this)) ; A rulebase can be viewed as a rule loader; it simply loads itself.
+(sm/defrecord Rulebase [;; Map of matched type to the alpha nodes that handle them.
+                        alpha-roots :- {sc/Any [AlphaNode]}
+                        ;; Root beta nodes (join, accumulate, etc.)
+                        beta-roots :- [BetaNode]
+                        ;; Productions in the rulebase.
+                        productions :- [schema/Production]
+                        ;; Production nodes.
+                        production-nodes :- [ProductionNode]
+                        ;; Map of queries to the nodes hosting them.
+                        query-nodes :- {sc/Any QueryNode}
+                        ;; May of id to one of the beta nodes (join, accumulate, etc)
+                        id-to-node :- {sc/Num BetaNode}])

 (def ^:private reflector
   "For some reason (bug?) the default reflector doesn't use the
@@ -624,11 +638,10 @@
                    {}
                    alpha-nodes)]

-    (map->Rulebase
+    (strict-map->Rulebase
      {:alpha-roots alpha-map
       :beta-roots beta-roots
-      :productions (filter :rhs productions)
-      :queries (remove :rhs productions)
+      :productions productions
       :production-nodes production-nodes
       :query-nodes query-map
       :id-to-node id-to-node})))


This is a better name

This is a better name

--- src/doctopus/db.clj
+++ src/doctopus/db.clj
@@ -235,7 +235,7 @@
   (select documents
           (where {:uri uri})))

-(defn get-document-for-tentacle
+(defn get-all-documents-for-tentacle
   [tentacle]
   (select documents
           (where {:tentacle_name (:name tentacle)})))


* :domino.smtpd.inet   Setup specific network interface for smtpd.

--- src/domino/core.clj
+++ src/domino/core.clj
@@ -6,7 +6,9 @@
         domino.notes
         clojure.tools.logging)
   (:require clojure.repl domino.import domino.export)
-  (:import javax.mail.internet.MimeMessage javax.mail.Session
+  (:import java.net.InetAddress
+           javax.mail.Session
+           javax.mail.internet.MimeMessage
            java.util.Properties
            org.subethamail.smtp.server.SMTPServer
            (org.subethamail.smtp.helper SimpleMessageListener SimpleMessageListenerAdapter))
@@ -74,6 +76,8 @@
 (defn -main
   []
   (doto *smtp-server*
+    (.setBindAddress (or (InetAddress/getByName (:domino.smtpd.inet *domino-properties*))
+                         nil))
     (.setPort (:domino.smtpd.port *domino-properties*))
     (.start))
   (run))


Change sample data

Change sample data

--- src/bakyeono/litedocx.clj
+++ src/bakyeono/litedocx.clj
@@ -13,7 +13,7 @@
   [dst styles resources]
   (let [content-types-xml (w/content-types-xml resources)
         rels-rels (w/rels-rels)
-        doc-props-app-xml (w/doc-props-app-xml :application "docx4j" :app-version 2.7)
+        doc-props-app-xml (w/doc-props-app-xml :application "litedocx" :app-version 1.0)
         doc-props-core-xml (w/doc-props-core-xml)
         word-document-xml (w/word-document-xml
                             (w/table "a1" :center [964 964 8072]


minor fixup stuff

minor fixup stuff

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
@@ -11,14 +11,6 @@
     [org.broadinstitute.firecloud-ui.page.workspace.details :refer [render-workspace-details]]
     [org.broadinstitute.firecloud-ui.utils :as utils]
     ))
-
-
-
-(defn- WSAccessLevelKeyFunc [accessLevel]
-  (case accessLevel
-    "OWNER" 0
-    "WRITER" 1
-    "READER" 2))

 (defn- render-modal [state refs nav-context]
@@ -116,19 +108,19 @@
                    {:text "Running" :pred #(= "Running" (:status %))}
                    {:text "Exception" :pred #(= "Exception" (:status %))}]
          :columns
-         [{:sort-by (fn [m] (:status m))
+         [{:sort-by :none :filter-by :none
            :header [:div {:style {:marginLeft -6}} "Status"] :starting-width 60
-           :content-renderer (fn [data] [StatusCell {:data data}]) :filter-by :none}
-          {:sort-by :text  :as-text :name
+           :content-renderer (fn [data] [StatusCell {:data data}])}
+          {:as-text :name :sort-by :text
            :header "Workspace" :starting-width 450
-           :content-renderer (fn [data] [WorkspaceCell {:data data}]) :filter-by :name}
+           :content-renderer (fn [data] [WorkspaceCell {:data data}])}
           {:header "Description" :starting-width 400
            :content-renderer (fn [description]
                                [:div {:style {:padding "1.1em 0 0 14px"
                                               :fontStyle (when-not description "oblique")}}
                                 (or description "No description provided")])}
           {:header "Access Level"  :starting-width 150
-           :sort-by WSAccessLevelKeyFunc :sort-initial :asc
+           :sort-by #(case % "OWNER" 0 "WRITER" 1 "READER" 2) :sort-initial :asc
            :content-renderer
            (fn [accessLevel]
              [:div {:style {:padding "1.1em 0 0 14px"}}


Fix iplayer-download-cmd to use System/home.

--- src/beebster_clj/core.clj
+++ src/beebster_clj/core.clj
@@ -63,8 +63,12 @@
 (defn iplayer-download-command
   "concatenate index and mode to download command"
    [index mode]
-  (list "get-iplayer" (apply str "modes=" mode "1") "output=~/Videos" "-g" index))
-
+   (list "get-iplayer" (apply str "modes=" mode "1")
+         (apply str "output=" (System/getenv "HOME") "/Videos/") "-g" index))
+
+
+
+
 (defn get-url
   "return /info url string concatenated with index"
   [index]


floating ip test works

floating ip test works

--- test/celestial/integration/workflows/openstack.clj
+++ test/celestial/integration/workflows/openstack.clj
@@ -4,11 +4,13 @@
   (:require
     [celestial.fixtures.core :refer (with-defaults is-type? with-admin with-conf)]
     [celestial.persistency.systems :as s]
-    [celestial.fixtures.data :refer
-     (redis-type local-conf redis-openstack)]
+    [celestial.fixtures.data :refer (redis-type local-conf redis-openstack)]
     [celestial.fixtures.populate :refer (populate-system)]
     [celestial.integration.workflows.common :refer (spec get-spec)]
-    [celestial.workflows :as wf])
+    [celestial.workflows :as wf]
+    [openstack.networking :refer (addresses-ip)]
+    [clojure.java.data :refer [from-java]]
+    [openstack.provider :refer (servers)])
   (:use midje.sweet)
  )

@@ -38,14 +40,16 @@
           (wf/puppetize redis-type (spec)) => nil
           (wf/destroy (spec)) => nil)

-      (fact "openstack floating ip":integration :openstack :workflow
+      (fact "openstack floating ip" :integration :openstack :workflow :floating
         ; will be run only if FIP env var is defined
         (when-let [fip (System/getenv "FIP")]
-           (wf/create (spec {:machine {:ip fip}})) => nil
+           (s/partial-system ((spec) :system-id) {:openstack {:floating-ip fip}})
            (:openstack (spec)) => (contains {:floating-ip fip})
+           (wf/create (spec)) => nil
+           (let [{:keys [tenant instance-id networks]} (:openstack (spec))]
+             (second (addresses-ip (.get (servers tenant) instance-id) (first networks))) => fip)
            (wf/stop (spec)) => nil
            (wf/reload (spec)) => nil
-           #_(instance-desc (get-spec :aws :endpoint) (get-spec :aws :instance-id)) => (contains {:public-ip-address fip})
            (:openstack (spec)) => (contains {:floating-ip fip})
            (wf/destroy (spec)) => nil
           ))


Workaround for occasional concurrency issue in the peer-manager

Simultaneous clones seems to cause a concurrency issue, even though a
deep clone is performed. As assoc/dissoc is a very occasional
operation, occurring only when peers join, a simple lock around the
clone is a good enough fix for now.

--- src/onyx/messaging/aeron/peer_manager.clj
+++ src/onyx/messaging/aeron/peer_manager.clj
@@ -1,10 +1,14 @@
 (ns onyx.messaging.aeron.peer-manager
-  "Fast way for peer group subscribers to dispatch via short id to peer channels"
+  "Fast way for peer group subscribers to multiplex via a short id to peer channels. "
   (:refer-clojure :exclude [assoc dissoc])
+  (:require [taoensso.timbre :refer [fatal info] :as timbre])
   (:import [uk.co.real_logic.agrona.collections Int2ObjectHashMap Int2ObjectHashMap$EntryIterator]))

 (defrecord PeerChannels [acking-ch inbound-ch release-ch retry-ch])

+;; Note, slow to assoc/dissoc to as it clones with a lock on it.
+;; Very fast to get from via peer-channels function - which is the main case, as dissoc/assoc
+;; only occurs when peers join/leave
 (defprotocol PeerManager
   (clone [this])
   (assoc [this k v])
@@ -24,15 +28,18 @@
   (peer-channels [this k]
     (.get m (int k)))
   (clone [this]
-    (VPeerManager.
-      (let [iterator (.iterator (.entrySet m))
-            new-hm ^Int2ObjectHashMap (Int2ObjectHashMap.)]
-        (while (.hasNext iterator)
-          (let [kv ^Int2ObjectHashMap$EntryIterator (.next iterator)]
-            (.put new-hm
-                  ^java.lang.Integer (.getKey kv)
-                  ^PeerChannels (.getValue kv))))
-        new-hm))))
+    ;; Unsure why a lock is needed, however concurrency bugs have shown up
+    ;; Look into this later. Clone is a very infrequent operation
+    (locking this
+      (VPeerManager.
+        (let [iterator (.iterator (.entrySet (.m this)))
+              new-hm ^Int2ObjectHashMap (Int2ObjectHashMap.)]
+          (while (.hasNext iterator)
+            (let [kv ^Int2ObjectHashMap$EntryIterator (.next iterator)
+                  k ^java.lang.Integer (.getKey kv)
+                  v ^PeerChannels (.getValue kv)]
+              (.put new-hm k v)))
+          new-hm)))))

 (defn vpeer-manager []
   (VPeerManager. (Int2ObjectHashMap.)))


add exmaple

add exmaple

--- src/clj/ceres/curator.clj
+++ src/clj/ceres/curator.clj
@@ -356,6 +356,7 @@
               [:tweet]
               #(into {} [
                          [:text (-> % :text)]
+                         [:id (-> % :id_str)]
                          [:user (-> % :user :screen_name)]
                          [:reply (-> % :in_reply_to_status_id_str)]
                          [:delay (let [post-delay (if (t/after? (-> % :created_at) post-time)
@@ -381,6 +382,13 @@
          max-path)
        (zip/next loc)))))

+
+(defn example-graph []
+  (let [tree (compute-impact-graph (mc/find-map-by-id (:db @mongo-state) "origins" (ObjectId. "53de1541657a439ad20d6859")))]
+    (-> [(simplify-graph tree) (tree-height tree)]
+        clojure.pprint/pprint)))
+
+
 (comment

   ;; TODO update on server
@@ -412,39 +420,22 @@
   (def example-graph (compute-impact-graph (mc/find-map-by-id (:db @mongo-state) "origins" (ObjectId. "53da170d657a10b9f098be86"))))

-  (->> (simplify-graph (-> articles rand-nth compute-impact-graph))
+  (-> (let [tree (-> articles rand-nth compute-impact-graph)]
+        [(simplify-graph tree)
+         (tree-height tree)])
        clojure.pprint/pprint)

   (count articles)

+  (-> (mc/find-map-by-id (:db @mongo-state) "origins" (ObjectId. "53de1541657a439ad20d6859"))
+      compute-impact-graph
+      simplify-graph
+      clojure.pprint/pprint)

   (let [trees (pmap compute-impact-graph articles)]
     (->> (pmap tree-height trees)
          frequencies
          clojure.pprint/pprint))

-  (->> (get-news-frequencies)
-       time)
-
-
-  (->> (pmap #(vector % (mc/count (:db @mongo-state) "origins" {:source %})) (:news-accounts @mongo-state))
-       vec
-       time)
-
-  (def html-regexp #"<(.| )*?>")
-
-  (def the-html (:html (last (mc/find-maps (:db @mongo-state) "articles"))))
-
-  (->> (clojure.string/split the-html #"\n")
-       (map count)
-       (clojure.core/sort >))
-
-  (-> (get-articles-from-date 8 1)
-      count
-      time)
-
-
-  (-> (spit "/home/konny/data/articles-8-1.edn" (export-articles 8 1))
-      time)

 )


Mark clj-json.core/*coercions* as ^:dynamic

--- src/clj/clj_json/core.clj
+++ src/clj/clj_json/core.clj
@@ -9,7 +9,7 @@
   (doto (JsonFactory.)
     (.configure JsonParser$Feature/ALLOW_UNQUOTED_CONTROL_CHARS true)))

-(def *coercions* nil)
+(def ^{:dynamic true} *coercions* nil)

 (defn generate-string
   "Returns a JSON-encoding String for the given Clojure object."


special case `'cljs.core/unquote` in `cljs.analyzer/confirm-var-exists`

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -323,10 +323,11 @@
                      (first (string/split sufstr #"\."))
                      suffix))]
       (when (and (not (implicit-import? env prefix suffix))
-              (not (and (not (get-in @env/*compiler* [::namespaces prefix]))
-                     (or (get (:requires (:ns env)) prefix)
-                       (get (:imports (:ns env)) prefix))))
-              (not (get-in @env/*compiler* [::namespaces prefix :defs suffix])))
+                 (not (and (not (get-in @env/*compiler* [::namespaces prefix]))
+                           (or (get (:requires (:ns env)) prefix)
+                           (get (:imports (:ns env)) prefix))))
+                 (not (and (= prefix 'cljs.core) (= suffix 'unquote)))
+                 (not (get-in @env/*compiler* [::namespaces prefix :defs suffix])))
         (missing-fn env prefix suffix)))))

 (defn confirm-var-exists-throw []


comment out temp function

comment out temp function

--- src/clj/movement/util.clj
+++ src/clj/movement/util.clj
@@ -91,7 +91,7 @@
                 [?u :user/email ?e]]
               db))

-(d/q '[:find [(pull ?u [:user/email]) ...]
+#_(d/q '[:find [(pull ?u [:user/email]) ...]
        :where
        [?u :user/email ?e]]
      db)


Remove redundant catch clause

Remove redundant catch clause

--- src/clj/reply/signals.clj
+++ src/clj/reply/signals.clj
@@ -4,13 +4,11 @@
   (if (try (Class/forName "sun.misc.Signal")
           (catch Throwable e))
     `(try
-      (sun.misc.Signal/handle
-        (sun.misc.Signal. ~signal)
-        (proxy [sun.misc.SignalHandler] []
-          (handle [signal#] (~f signal#))))
-      (catch Throwable e#)
-      (catch IllegalArgumentException e#
-        ; unrecognized signal - CONT on Windows, for instance
-        ))
+       (sun.misc.Signal/handle
+         (sun.misc.Signal. ~signal)
+         (proxy [sun.misc.SignalHandler] []
+           (handle [signal#] (~f signal#))))
+       ; unrecognized signal - CONT on Windows, for instance
+       (catch Throwable e#))
     `(println "Unable to set signal handlers.")))


Fix ipv6 back to optional

Fix ipv6 back to optional

--- src/clj/runbld/schema.clj
+++ src/clj/runbld/schema.clj
@@ -64,7 +64,7 @@
    :cpus-physical          s/Num
    :hostname               s/Str
    :ipv4                   s/Str
-   :ipv6                   s/Str
+   (s/optional-key :ipv6)  s/Str
    :kernel-name            s/Str
    :kernel-release         s/Str
    :kernel-version         s/Str


JACKAL-7: Rendering performance improved by rendering one column at a time, instead of all at once. It's actaully not rendering faster, but it is appearing on the screen right away, so you can watch it load. Committed by Ben Weintraub.

--- src/cljs/jackal/core.cljs
+++ src/cljs/jackal/core.cljs
@@ -2,7 +2,8 @@
   (:require [clojure.browser.repl :as repl]
             [jackal.math.numerics :as numerics]
             [dommy.core :as dommy :refer-macros [sel1]]
-            [quil.core :as q :include-macros true]))
+            [quil.core :as q :include-macros true]
+            [quil.middleware :as m]))

 (enable-console-print!)
@@ -37,13 +38,20 @@
      (dommy/set-attr! canvas-element :id "fractal-canvas" :width 1200 :height 750))))

 (defn setup []
-  (q/frame-rate 0.1) ;; frame rate set to 1 frame per 10 seconds
+  (q/frame-rate 200) ;; frame rate set to 1 frame per 10 seconds
   (q/background 255)
   (q/no-stroke)
-  (q/color-mode :hsb))
+  (q/color-mode :hsb)
+  -2)

-(defn draw []
-  (doseq [x (range -2 2 range-step-size)
+(defn update-state
+  [x]
+  (let [new-x (+ x 0.01)]
+    (if (> new-x 2) -2 new-x)))
+
+(defn draw
+  [old-x]
+  (doseq [x (range old-x (+ old-x 0.05) range-step-size)
           y (range -2 2 range-step-size)]
     (let [iterations (numerics/mandelbrot-set-iterations x y max-iterations)
           scaled-x (scale-pixel-coordinate x)
@@ -61,7 +69,9 @@
   :title "The Mandelbrot Set"
   :settings #(q/smooth 20) ;; Turn on anti-aliasing
   :setup setup
+  :update update-state
   :draw draw
-  :size [1200 750])
+  :size [1200 750]
+  :middleware [m/fun-mode])

 (println "hello world.")


Build board from AppState

Build board from AppState

Rather than handcode the components into the code then the app state is
looped through to build the components onto the board.

--- src/cljs/kanban/core.cljs
+++ src/cljs/kanban/core.cljs
@@ -3,38 +3,45 @@

 (enable-console-print!)

-(defonce app-state (reagent/atom {:text "Hello Chestnut!"}))
+(def app-state
+  (reagent/atom
+   {:columns
+    [{:title "Todos"
+      :cards [{:title "Learn about Reagent"}
+              {:title "Tell my friends about Lambda Island"}]}
+     {:title "Doing"
+      :cards [{:title "Following the Reagent tutorial"}
+              {:title "Using Evil mode badly"}]}]}))

-(defn greeting []
-  [:h1 (:text @app-state)])
+;; (defn greeting []
+;;   [:h1 (:text @app-state)])

-(defn Card []
+(defn Card [card]
   [:div.card
-   "a card"])
+   (:title card)])

 (defn NewCard []
   [:div.new-card
    "+ add new card"])

-(defn Column []
+(defn Column [{:keys [title cards]}]
   [:div.column
-   [:h2 "a column"]
-   [Card]
-   [Card]
-   [Card]
+   [:h2 title]
+   (for [c cards]
+     [Card c])
    [NewCard]])

 (defn NewColumn []
   [:div.new-column
    "+ add new column"])

-(defn Board []
+(defn Board [state]
   [:div.board
-   [Column]
-   [Column]
+   (for [c (:columns @state)]
+     [Column c])
    [NewColumn]])

-(reagent/render [Board] (js/document.getElementById "app"))
+(reagent/render [Board app-state] (js/document.getElementById "app"))

 ;; Original render line
 ;; (reagent/render [greeting] (js/document.getElementById "app"))


Move calculations in view into reactions

--- src/cljs/kulive/view.cljs
+++ src/cljs/kulive/view.cljs
@@ -1,13 +1,15 @@
 (ns kulive.view
   (:require [clojure.string :as str]
             [re-frame.core :as re-frame]
-            [kulive.timetable :refer [timetable-component]]))
+            [kulive.timetable :refer [timetable-component]])
+  (:require-macros [reagent.ratom :refer [reaction]]))

 (defn search-component
   []
   (let [course-count (re-frame/subscribe [:count-courses-in-search])
-        displayed-courses (re-frame/subscribe [:courses-to-display])]
+        displayed-courses (re-frame/subscribe [:courses-to-display])
+        display-count (reaction (count @displayed-courses))]
     (fn []
       [:form {:style {:margin-bottom "0rem"}}
        [:label (str "강의 검색 (" @course-count ")")]
@@ -23,7 +25,7 @@
                                     (.preventDefault %))
                                 nil)
                 :placeholder "ex) \"국제관 화(5) major required\""}]
-       (if (= 1 (count @displayed-courses))
+       (if (= 1 @display-count)
          [:button.button-primary
           {:style {:margin-left "1rem" :margin-bottom "1rem"}
            :on-click #(do (re-frame/dispatch [:course-added])
@@ -32,10 +34,11 @@

 (defn course-row-component [course]
   "Row with course info"
-  (let [courses-to-display (re-frame/subscribe [:courses-to-display])]
+  (let [courses-to-display (re-frame/subscribe [:courses-to-display])
+        display-count (reaction (count @courses-to-display))]
     (fn []
       [:tr {:style {:cursor "pointer"
-                    :background (if (= 1 (count @courses-to-display))
+                    :background (if (= 1 @display-count)
                                   "#f4faff")}}
        [:td (apply str (rest (get-in (val course) [:kr :name])))]
        [:td (get-in (val course) [:kr :number])]


Known namespaces filters out nils now

Known namespaces filters out nils now

--- src/cljs/replumb/ast.cljs
+++ src/cljs/replumb/ast.cljs
@@ -6,7 +6,7 @@
   "Given a compiler state, return the seq of namespace symbols currently
   present in the AST."
   [state]
-  (keys (:cljs.analyzer/namespaces state)))
+  (remove nil? (keys (:cljs.analyzer/namespaces state))))

 (defn ns-publics
   "Given compiler state and namespace symbol return all the public vars


Moar.

Moar.

--- src/clojurecraft/core.clj
+++ src/clojurecraft/core.clj
@@ -314,6 +314,10 @@
   (-write-byte conn blocktype)
   (-write-byte conn blockmetadata))

+(defn write-packet-explosion [conn {x :x y :y z :z unknownradius :unknownradius recordcount :recordcount records :records}]
+  ; TODO: Implement this.
+  nil)
+

 ; Writing Wrappers -----------------------------------------------------------------
 (defn flushc [conn]
@@ -344,6 +348,7 @@
     :entitymetadata       (write-packet-entitymetadata conn payload)
     :multiblockchange     (write-packet-multiblockchange conn payload)
     :blockchange          (write-packet-blockchange conn payload)
+    :explosion            (write-packet-explosion conn payload)

     )
   (flushc conn))
@@ -674,6 +679,17 @@
     :z (-read-int conn)
     :instrumenttype (-read-byte conn)
     :pitch (-read-byte conn)))
+
+(defn read-packet-explosion [conn]
+  (let [prerecords (assoc {}
+                          :x (-read-int conn)
+                          :y (-read-short conn)
+                          :z (-read-int conn)
+                          :unknownradius (-read-byte conn)
+                          :recordcount (-read-byte conn))]
+    (assoc prerecords
+           :records (-read-bytearray conn
+                                     (* 3 (:recordcount prerecords))))))

 ; Reading Wrappers -----------------------------------------------------------------
@@ -722,6 +738,7 @@
         :multiblockchange          (read-packet-multiblockchange conn)
         :blockchange               (read-packet-blockchange conn)
         :playnoteblock             (read-packet-playnoteblock conn)
+        :explosion                 (read-packet-explosion conn)

         :else (str "UNKNOWN PACKET TYPE: " packet-id)
         ))


pages

pages

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -190,9 +190,9 @@
         next-node (second children)
         next-clicks (events->chan next-node "tap")

-                                        ;pages (create-pages root-node simulation)
-
-                                        ;current-index (atom 0)
+        pages (.. children (slice 2 (count children)))
+        _ (println "count= "(count children))
+
         dot-container-node (last children)
         dot-nodes (.. dot-container-node getChildren)
         resize (clj->js {:onSizeChange (fn [^Float32Array size]


highlight dot

highlight dot

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -89,7 +89,7 @@
             :position      [0 -50 0]
             :align         [0.5 1 0]
             :mount-point   [0.5 1 0]}
-     (for [i (range 5)]
+     (for [i (range 13)]
        [:node {:size-mode     [ABSOLUTE ABSOLUTE]
                :absolute-size [5 5]
                :components    [[:DOMElement {:borderRadius "5px"
@@ -189,7 +189,20 @@
                                               old-page-physics (node-to-physics old-page-node)

                                               new-page-node (nth pages new-index)
-                                              new-page-physics (node-to-physics new-page-node)]
+                                              new-page-physics (node-to-physics new-page-node)
+                                              get-dom-element (fn [node]
+                                                                (first (filter (fn [component]
+                                                                                (= "DOMElement" (.. component -constructor -name)))
+                                                                               (.. node getComponents))))
+
+                                              old-dot-node (nth dot-nodes old-index)
+                                              old-dot-dom  (get-dom-element old-dot-node)
+
+                                              new-dot-node (nth dot-nodes new-index)
+                                              new-dot-dom  (get-dom-element new-dot-node)]
+                                          (.. old-dot-dom (setProperty "backgroundColor" "transparent"))
+                                          (.. new-dot-dom (setProperty "backgroundColor" "white"))
+
                                           (if (< old-index new-index)
                                             (do
                                               (.. (:anchor old-page-physics) (set -1 0 0))


Fix pointer to knn options in docs.

Fix pointer to knn options in docs.

--- project/analyze-data/src/analyze_data/predict.clj
+++ project/analyze-data/src/analyze_data/predict.clj
@@ -10,7 +10,7 @@
   model: previously trained model
   z: feature vector
   options: specific to the model-type
-    :knn see analyze-data.knn.core/knn
+    :knn see analyze-data.knn.core/predict
     :naive-bayes see analyze-data.naive-bayes.predict/predict

   Return the predicted label."