check for circular dependencies (oops)

check for circular dependencies (oops)

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -461,18 +461,31 @@
                 :resources rcs})))
     (first rcs)))

-(defn- get-deps-for-src* [state name]
+(defn- get-deps-for-src* [{:keys [deps-stack] :as state} name]
   {:pre [(compiler-state? state)]}
   (when-not (string? name)
     (throw (ex-info (format "trying to get deps for \"%s\"" (pr-str name)) {})))

-  (if (contains? (:deps-visited state) name)
+  (cond
+    ;; don't run in circles
+    (some #(= name %) deps-stack)
+    (let [path (->> (conj deps-stack name)
+                    (drop-while #(not= name %))
+                    (str/join " -> "))]
+      (throw (ex-info (format "circular dependency: %s" path) {:name name :stack deps-stack})))
+
+    ;; don't revisit
+    (contains? (:deps-visited state) name)
     state
+
+    :else
     (let [requires (get-in state [:sources name :requires])]
       (when-not requires
         (throw (ex-info (format "cannot find required deps for \"%s\"" name) {:name name})))

-      (let [state (conj-in state [:deps-visited] name)
+      (let [state (-> state
+                      (conj-in [:deps-visited] name)
+                      (conj-in [:deps-stack] name))
             state (->> requires
                        (map (fn [require-sym]
                               (let [src-name (get-in state [:provide->source require-sym])]
@@ -485,7 +498,8 @@
                                 src-name
                                 )))
                        (into #{})
-                       (reduce get-deps-for-src* state))]
+                       (reduce get-deps-for-src* state))
+            state (update state :deps-stack (fn [stack] (into [] (butlast stack))))]
         (conj-in state [:deps-ordered] name)
         ))))

@@ -496,7 +510,8 @@
   {:pre [(compiler-state? state)
          (string? src-name)]}
   (-> state
-      (assoc :deps-ordered []
+      (assoc :deps-stack []
+             :deps-ordered []
              :deps-visited #{})
       (get-deps-for-src* src-name)
       :deps-ordered))


update list-fn to get correctly typed selection value

--- src/cljs/clj_money/forms.cljs
+++ src/cljs/clj_money/forms.cljs
@@ -73,7 +73,12 @@
                               (get-in (first @options)  [1 :key])))
         elem-attr {:on-focus (fn [_]
                                (reset! options (list-fn doc)))
-                   :on-change #(save! id (value-of %))
+                   :on-change (fn [selection]
+                                (let [option (->> @options
+                                                  (filter #(= (value-of selection)
+                                                             (-> % second str)))
+                                                  first)]
+                                  (save! id (second option))))
                    :name id
                    :default-value (default-selection @options @selection)}]
     (render-element attr


Moving inputs to components

Moving inputs to components

--- src/cljs/ohds/components.cljs
+++ src/cljs/ohds/components.cljs
@@ -1,4 +1,18 @@
 (ns ohds.components)
+
+(defn atom-input [value id]
+  [:input {:type "text"
+           :value @value
+           :id id
+           :class "form-control"
+           :on-change #(reset! value (-> % .-target .-value))}])
+
+(defn atom-input-password [value id]
+  [:input {:type "password"
+           :value @value
+           :id id
+           :class "form-control"
+           :on-change #(reset! value (-> % .-target .-value))}])

 (defn hamburger []
   [:button {:type "button"


Go back to DirCacheIterator

Go back to DirCacheIterator

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -16,11 +16,11 @@
             TreeSelectionModel]
            [org.eclipse.jgit.api Git]
            [org.eclipse.jgit.diff DiffEntry DiffFormatter]
+           [org.eclipse.jgit.dircache DirCacheIterator]
            [org.eclipse.jgit.internal.storage.file FileRepository]
            [org.eclipse.jgit.lib PersonIdent Repository]
            [org.eclipse.jgit.revwalk RevCommit]
-           [org.eclipse.jgit.treewalk CanonicalTreeParser EmptyTreeIterator
-            FileTreeIterator]))
+           [org.eclipse.jgit.treewalk EmptyTreeIterator FileTreeIterator]))

 (def ^:const git-name "*Git*")
 (def ^:const max-commits 50)
@@ -75,8 +75,7 @@
      (FileTreeIterator. repo)]
     ; uncommitted changes
     :else
-    [(doto (CanonicalTreeParser.)
-       (.reset (.newObjectReader repo) (.resolve repo "HEAD^{tree}")))
+    [(-> repo .readDirCache DirCacheIterator.)
      (FileTreeIterator. repo)]))

 (defn ident->str


Use CanonicalTreeParser to see uncommitted changes

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -15,7 +15,7 @@
            [javax.swing.tree DefaultMutableTreeNode DefaultTreeModel
             TreeSelectionModel]
            [org.eclipse.jgit.api Git]
-           [org.eclipse.jgit.diff DiffEntry DiffEntry$ChangeType DiffFormatter]
+           [org.eclipse.jgit.diff DiffEntry DiffFormatter]
            [org.eclipse.jgit.dircache DirCacheIterator]
            [org.eclipse.jgit.internal.storage.file FileRepository]
            [org.eclipse.jgit.lib PersonIdent ProgressMonitor Repository]
@@ -81,7 +81,10 @@
        (.reset (.newObjectReader repo) (.getTree commit)))]
     ; uncommitted changes
     :else
-    [(-> repo .readDirCache DirCacheIterator.)
+    [(if-let [head (.resolve repo "HEAD^{tree}")]
+       (doto (CanonicalTreeParser.)
+         (.reset (.newObjectReader repo) head))
+       (-> repo .readDirCache DirCacheIterator.))
      (FileTreeIterator. repo)]))

 (defn ident->str
@@ -111,11 +114,7 @@
           df (doto (DiffFormatter. out)
                (.setRepository repo))
           [old-tree new-tree] (diff-trees repo commit)]
-      (for [^DiffEntry diff (.scan df old-tree new-tree)
-            ; exclude add diffs from uncommitted changes
-            :when (or (some? commit)
-                      (not= DiffEntry$ChangeType/ADD
-                            (.getChangeType diff)))]
+      (for [diff (.scan df old-tree new-tree)]
         (->> (format-diff! out df diff)
              string/split-lines
              (map escape-html)


reflection warnings fixed

reflection warnings fixed

--- src/clojure2d/math/vector.clj
+++ src/clojure2d/math/vector.clj
@@ -270,9 +270,9 @@
   (mx [_] (max x y z w))
   (mn [_] (min x y z w))
   (emx [_ v]
-    (let [^Vec3 v v] (max (.x v) x) (max (.y v) y) (max (.z v) z) (max (.w v) w)))
+    (let [^Vec4 v v] (max (.x v) x) (max (.y v) y) (max (.z v) z) (max (.w v) w)))
   (emn [_ v]
-    (let [^Vec3 v v] (min (.x v) x) (min (.y v) y) (min (.z v) z) (min (.w v) w)))
+    (let [^Vec4 v v] (min (.x v) x) (min (.y v) y) (min (.z v) z) (min (.w v) w)))
   (sum [_] (+ x y z w))
   (interpolate [_ v2 t f]
     (let [^Vec4 v2 v2] (Vec4. (f x (.x v2) t)


Reverted ULTRA padding to (), until we've tested 'ultra-padding further.

--- src/clojush/pushgp/pushgp.clj
+++ src/clojush/pushgp/pushgp.clj
@@ -10,7 +10,7 @@
 ;; pushgp

 (def push-argmap
-  (atom (sorted-map
+  (atom sorted-map
           ;;----------------------------------------
           ;; Clojush system arguments
           ;;----------------------------------------
@@ -60,7 +60,7 @@
           :ultra-alignment-deviation 1 ;; When using ULTRA, the standard deviation of how far alternation may jump between indices when switching between parents
           :ultra-mutation-rate 0.1 ;; The probability of each token being mutated during ULTRA
           :use-ultra-no-paren-mutation false ; If true, ULTRA will use no-paren mutation, which means that parentheses won't be added or deleted during mutation.
-          :ultra-pads-with-empties false ;; If true then ULTRA pads the smaller parent with () and then removes them; if false then this is instead done using the symbol 'ultra-padding.
+          :ultra-pads-with-empties true ;; If true then ULTRA pads the smaller parent with () and then removes them; if false then this is instead done using the symbol 'ultra-padding.
           :gaussian-mutation-per-number-mutation-probability 0.5 ;; The probability that any given float literal will be affected by a pass of gaussian-mutate
           :gaussian-mutation-standard-deviation 0.1 ;; The standard deviation of a gaussian-mutated float
           :boolean-gsxover-new-code-max-points 20 ;; The maximum size of the random code fragment used in boolean-gsxover
@@ -121,7 +121,7 @@
           ;;----------------------------------------
           :parent-reversion-probability 0.0 ;; The probability of a child being reverted to its parent if the parent has better fitness or equal fitness and is smaller
           :use-bushy-code false ;; When true, random code and code changed by ULTRA mutation, will be "bushy", as in close to a binary tree
-          )))
+          ))

 (defn load-push-argmap
   [argmap]


CMR-676: Added health check functio for oracle.

--- src/cmr/oracle/connection.clj
+++ src/cmr/oracle/connection.clj
@@ -20,18 +20,26 @@
    :ons-config ons-config})

-(defn test-db-connection!
-  "Tests the database connection. Throws an exception if unable to execute some sql."
+(defn health
+  "Returns the health status of the database by executing some sql."
   [oracle-store]
   (try
-    (when-not (= [{:a 1M}]
-                 (j/query oracle-store "select 1 a from dual"))
-      (throw (Exception. "Could not select data from database.")))
+    (if (= [{:a 1M}]
+           (j/query oracle-store "select 1 a from dual"))
+      {:ok? true}
+      {:ok? false :problem "Could not select data from database."})
     (catch Exception e
       (info "Database conn info" (pr-str (-> oracle-store
                                              :spec
                                              (assoc :password "*****"))))
-      (throw e))))
+      {:ok? false :problem (.getMessage e)})))
+
+(defn test-db-connection!
+  "Tests the database connection. Throws an exception if the database is unhealthy."
+  [oracle-store]
+  (let [db-health (health oracle-store)]
+    (when-not (:ok? db-health)
+      (throw (Exception. (:problem db-health))))))

 (defn pool
   [spec]


change env shape

change env shape

--- src/tailrecursion/boot.clj
+++ src/tailrecursion/boot.clj
@@ -21,17 +21,19 @@

 (def env
   (atom {:boot {:dependencies {}
-                :directories #{}}}))
+                :directories #{}
+                :repositories #{}}}))

 (def ^:dynamic *default-repositories*
-  {"maven" "http://repo1.maven.org/maven2/"
-   "clojars" "http://clojars.org/repo"})
+  #{"http://repo1.maven.org/maven2/"
+    "http://clojars.org/repo/"})

 (defn install [{:keys [coordinates repositories]}]
-  (let [deps (pom/add-dependencies
+  (let [repos (into *default-repositories* repositories)
+        deps (pom/add-dependencies
               :coordinates (mapv (partial exclude ['org.clojure/clojure]) coordinates)
-              :repositories (merge *default-repositories* repositories))]
-    (swap! env update-in [:boot :dependencies] merge deps)))
+              :repositories (apply hash-map (mapcat (partial repeat 2) repos)))]
+    (swap! env merge-with into {:boot {:dependencies deps :repositories repos}})))

 (defn add [dirs]
   (when (seq dirs)


Increment version number

Increment version number

--- build.boot
+++ build.boot
@@ -28,7 +28,7 @@
 (task-options!
   sift {:include #{#"\.jar$"}}
   pom {:project 'nightcode
-       :version "2.5.1-SNAPSHOT"
+       :version "2.5.0"
        :description "An IDE for Clojure"
        :url "https://github.com/oakes/Nightcode"
        :license {"Public Domain" "http://unlicense.org/UNLICENSE"}}


create qa db refresh task

create qa db refresh task

--- build.boot
+++ build.boot
@@ -131,6 +131,14 @@
   (-> (build-connection-string)
       refresh-db!))

+(deftask refresh-qa-ddb
+  "Resets the dev dynamo db"
+  []
+  (System/setProperty "APP_ENV" "qa-ddb")
+
+  (-> (build-connection-string)
+      refresh-db!))
+
 (deftask refresh-db
   "resets the database"
   []


minor deps update

minor deps update

--- build.boot
+++ build.boot
@@ -7,7 +7,7 @@
                  [hashobject/boot-s3 "0.1.0-SNAPSHOT"]
                  [clj-time "0.9.0"]
                  [pandeiro/boot-http "0.6.2"]
-                 [jeluard/boot-notify "0.1.2"]
+                 [jeluard/boot-notify "0.2.0"]
                  ;[deraen/boot-livereload "0.1.0-SNAPSHOT"]
                  [pandeiro/boot-http "0.6.3-SNAPSHOT"]])


Updated plan-schema to 0.3.1

Updated plan-schema to 0.3.1

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

--- build.boot
+++ build.boot
@@ -31,7 +31,7 @@
                     [com.fzakaria/slf4j-timbre    "0.3.4"]
                     [org.clojure/tools.logging    "0.3.1"]
                     [com.novemberain/langohr      "3.7.0"]
-                    [dollabs/plan-schema          "0.2.18"]
+                    [dollabs/plan-schema          "0.3.1"]
                     ;; web server
                     [org.clojure/data.json        "0.2.6"]
                     [ring/ring-core               "1.5.0"]


switch ns to migae, remove obsolete gae/ear task, use https

--- build.boot
+++ build.boot
@@ -1,4 +1,4 @@
-(def +project+ 'org.mobileink/migae.datastore)
+(def +project+ 'migae/datastore)
 (def +version+ "0.4.0-SNAPSHOT")

 (set-env!
@@ -9,8 +9,8 @@
  :resource-paths #{"src/clj"}
  :source-paths #{"src/clj-compile"}
  :repositories {"clojars" "https://clojars.org/repo"
-                "central" "http://repo1.maven.org/maven2/"
-                "maven-central" "http://mvnrepository.com"}
+                "central" "https://repo1.maven.org/maven2/"
+                "maven-central" "https://mvnrepository.com"}
  :dependencies   '[[org.clojure/clojure "1.8.0" :scope "runtime"]

                    ;; the java sdk is not used by app code, it's just there for the devserver
@@ -81,7 +81,6 @@
                          :war "target/bulkops"}]})

 (task-options!
- gae/ear modules
  gae/run modules
  pom  {:project     +project+
        :version     +version+


Bump node to 9.8.0 (#371)

Bump node to 9.8.0 (#371)

--- build.boot
+++ build.boot
@@ -1,6 +1,6 @@
 (def +clojurescript-version+ (or (System/getenv "CANARY_CLOJURESCRIPT_VERSION")
                                  "1.9.946"))
-(def +node-version+ "9.2.0")
+(def +node-version+ "9.8.0")

 (set-env!
  :source-paths #{"src/cljs/snapshot"}


added TODO hints to video page

added TODO hints to video page

--- src/distillery/view/video.clj
+++ src/distillery/view/video.clj
@@ -38,7 +38,9 @@
                      [(list-item (str "Länge: " (transcript/format-time (:duration video))))
                       (list-item (str "Erkannte Phrasen: " (:phrase-count video)))
                       (list-item (str "Erkannte Worte: " (:word-count video)))
-                      (list-item (format "Mittlere Erkennungssicherheit: %1.1f%%" (* 100 (:confidence video))))])]))
+                      (list-item (format "Mittlere Erkennungssicherheit: %1.1f%%" (* 100 (:confidence video))))])
+              (TODO "Hitlist")
+              (TODO "Word distribution matrix (frequency vs. confidence)")]))

 (defn- render-transcript
   "Creates the HTML for the transcript with all phrases."


Changes :hps in a live scenario mapping to be \{uuid playerMap\}

--- src/hphelper/live/control.clj
+++ src/hphelper/live/control.clj
@@ -20,15 +20,15 @@

 (defn- player-add-password-token
   "Adds a uuid key under :password to a player map, returns the map"
-  [pMap]
-  (assoc pMap :password (uni/uuid)))
+  [[_ pMap]]
+  (let [pass (uni/uuid)]
+    [pass (assoc pMap :password pass)]))

 (defn- player-add-all-password-tokens
   "Adds a uuid password to all players in a scenMap, returns the map"
   [sMap]
   (update-in sMap [:hps] (fn [pl] (apply merge {}
-                                         (map (fn [[k pMap]]
-                                                [k (player-add-password-token pMap)])
+                                         (map player-add-password-token
                                               pl)))))

 (defn new-game


Make internal method private

Make internal method private

--- src/io/aviso/rook/swagger.clj
+++ src/io/aviso/rook/swagger.clj
@@ -118,7 +118,7 @@
    :info        {:title   "<UNSPECIFIED>"
                  :version "<UNSPECIFIED>"}})

-(defn keyword->path?
+(defn- keyword->path?
   [v]
   (if (keyword? v)
     (str \{ (name v) \})
@@ -216,7 +216,7 @@

   (convert-schema [schema swagger-options swagger-object]
     "Given a particular implementation of Prismatic Schema, do a conversion to a Swagger/JSON schema.
-    Return a tuple of the (possibly updated swagger-object) and the converted schema."))
+    Return a tuple of the (possibly updated) swagger-object and the converted schema."))

 (extend-protocol SchemaConversion


Code melodies as (big) integers.

Code melodies as (big) integers.

--- src/kolmogorov_music/song.clj
+++ src/kolmogorov_music/song.clj
@@ -45,25 +45,44 @@
 (defn synchronise [m]
   (zipmap (keys m) (repeat (apply max (vals m)))) )

-(defn encode
+(defn decode
   ([state [a b c d & digits]]
    (if (zero? (* a b))
-     (encode (synchronise state) digits)
+     (decode (synchronise state) digits)
      (let [part (most-behind state)
            duration (/ a b)
            pitch (+ c d)
            time (part state)]
        (cons (construct time duration pitch part)
              (lazy-seq (->> digits
-                            (encode (update-in state [part] (partial + duration))))))))))
+                            (decode (update-in state [part] (partial + duration))))))))))
+
+(defn tens [n]
+  (apply * (repeat n 10)))
+
+(defn code [[{:keys [duration pitch] :as note} & notes]]
+  (if (nil? note)
+    0
+    (let [one (+ (* (tens 3) (if (ratio? duration) (numerator duration) duration))
+                 (* (tens 2) (if (ratio? duration) (denominator duration) 1))
+                 (* (tens 1) (quot pitch 2))
+                 (* (tens 0) (- pitch (quot pitch 2))))]
+      (+ (* (bigint one) (tens (* 4 (count notes)))) (code notes)))))
+
+(def row
+  (->> (phrase [3/3 3/3 2/3 1/3 3/3]
+               [7 7 7 8 9])
+ ;      (with (phrase [1 1 2] [0 4 0]))
+       code))

 (def track
   (->>
     (champernowne/word 10
-                       7207120772071207720712077207120772031203720312037203120312551255125412541253125312521232
+                      ; 7207120772071207720712077207120772031203720312037203120312551255125412541253125312521232
+                       row
                        )
-    ; (encode {:dux 0 :comes 0 :bass 0})
-    (encode {:dux 0})
+    ; (decode {:dux 0 :comes 0 :bass 0})
+    (decode {:dux 0})
     (wherever :pitch, :pitch (comp temperament/equal scale/A scale/minor scale/lower))
     (where :time (bpm 120))
     (where :duration (bpm 120))))


Add backwards-compatibility with Leiningen 1.x.

--- src/leiningen/ring/server.clj
+++ src/leiningen/ring/server.clj
@@ -1,5 +1,4 @@
-(ns leiningen.ring.server
-  (:use leiningen.core.eval))
+(ns leiningen.ring.server)

 (defn load-namespaces
   "Create require forms for each of the supplied symbols. This exists because
@@ -10,6 +9,20 @@
         `'~(if-let [ns (namespace s)]
              (symbol ns)
              s))))
+
+(defn eval-in-project
+  "Support eval-in-project in both Leiningen 1.x and 2.x."
+  [project form init]
+  (let [[eip two?] (or (try (require 'leiningen.core.eval)
+                            [(resolve 'leiningen.core.eval/eval-in-project)
+                             true]
+                            (catch java.io.FileNotFoundException _))
+                       (try (require 'leiningen.compile)
+                            [(resolve 'leiningen.compile/eval-in-project)]
+                            (catch java.io.FileNotFoundException _)))]
+    (if two?
+      (eip project form init)
+      (eip project form nil nil init))))

 (defn server-task
   "Shared logic for server and server-headless tasks."


add a test for intro links

add a test for intro links

--- pedestal-app/test/semtag_web/integration_test.clj
+++ pedestal-app/test/semtag_web/integration_test.clj
@@ -91,6 +91,15 @@
   (click "Home")
   (url-ends-with "#/"))

+(deftest introduction-links-work
+  (visit "")
+  (click "Learn more about semtag.")
+  (is (.contains (taxi/text "#introduction") "Semtag is a site"))
+
+  ;; newly rendered static link works
+  (click "the types page")
+  (is (.contains (taxi/text "#page_title") "Type Statistics")))
+
 (deftest regular-search-works
   (visit "")
   (is (seq (taxi/elements "#tags option")) "renders a datalist to autocomplete input")


ENV variables can provide host and port

ENV variables can provide host and port

--- src/stream_crawler/core.clj
+++ src/stream_crawler/core.clj
@@ -22,29 +22,22 @@
   (:import
    (twitter.callbacks.protocols AsyncStreamingCallback)))

-(defn create-tweet-entities [twitter-tweet]
-  ; the entirety of this method should be wrapped in a database transaction
-  (log/info (str "created tweet! (id: " (:id twitter-tweet) ")"))
-  (insert stream-tweets
-    (values (twitter-tweet-to-stream-tweet twitter-tweet))))
+(defn -main []
+  (def db-creds {:db (env :db-name)
+                 :user (env :db-user)
+                 :password (env :db-pass)
+                 :host (env :db-url)
+                 :port (env :db-port)})
+  (def twitter-creds
+    (make-oauth-creds (env :twitter-consumer-key)
+                      (env :twitter-consumer-secret)
+                      (env :user-access-token)
+                      (env :user-access-token-secret)))

-(defn commit-tweet-queue-to-database [queues]
-  "Takes a map of queues and creates the tweet database objects for each tweet
-  in the queue"
-  (let [tweet-queue queues]
-    (doseq [tweet (:tweet tweet-queue)] (create-tweet-entities tweet))))
+  (log/info "using db creds: " db-creds)
+  (log/info "using twitter creds: " twitter-creds)

-(defn do-on-queues-changed [k, stream, os, nst]
-  (let [buffered-tweets (:tweet (k nst))]
-    (if (> (count buffered-tweets) 0)
-      ; at least one tweet is in the queue
-      (do (log/info "emptying queue and attempting to commit tweet")
-          (twitter-client/empty-queues stream commit-tweet-queue-to-database)))))
-
-(defn -main []
-  (defdb db (postgres {:db (env :db-name)
-                       :user (env :db-user)
-                       :password (env :db-pass)}))
+  (defdb db (postgres db-creds))

   (defentity stream-tweets
     (table :twitter_stream_dump))
@@ -52,21 +45,36 @@
   (defentity keyword-objects
     (table :keywords))

-  (let [
-    serialized-keywords
-      (str/join "," (map :keyword
-        (select keyword-objects
-          (fields :keyword))))
-    stream
-      (twitter-client/create-twitter-stream twitter.api.streaming/statuses-filter
-        :oauth-creds twitter-creds
-        :params {:track serialized-keywords})
+  (def serialized-keywords
+    (str/join "," (map :keyword
+      (select keyword-objects
+        (fields :keyword)))))

-    twitter-creds (make-oauth-creds (env :twitter-consumer-key)
-                                    (env :twitter-consumer-secret)
-                                    (env :user-access-token)
-                                    (env :user-access-token-secret))]
+  (def stream
+    (twitter-client/create-twitter-stream twitter.api.streaming/statuses-filter
+      :oauth-creds twitter-creds
+      :params {:track serialized-keywords}))

-    (log/info (str "Starting stream client at " t/now))
-    (twitter-client/start-twitter-stream stream)
-    (add-watch stream :queues do-on-queues-changed)))
+  (defn create-tweet-entities [twitter-tweet]
+    ; the entirety of this method should be wrapped in a database transaction
+    (log/info (str "created tweet! (id: " (:id twitter-tweet) ")"))
+    (insert stream-tweets
+      (values (twitter-tweet-to-stream-tweet twitter-tweet))))
+
+  (defn commit-tweet-queue-to-database [queues]
+    "Takes a map of queues and creates the tweet database objects for each tweet
+    in the queue"
+    (let [tweet-queue queues]
+      (doseq [tweet (:tweet tweet-queue)] (create-tweet-entities tweet))))
+
+  (defn do-on-queues-changed [k, stream, os, nst]
+    (let [buffered-tweets (:tweet (k nst))]
+      (if (> (count buffered-tweets) 0)
+        ; at least one tweet is in the queue
+        (do (log/info "emptying queue and attempting to commit tweet")
+            (twitter-client/empty-queues stream commit-tweet-queue-to-database)))))
+
+
+  (log/info (str "Starting stream client at " t/now))
+  (twitter-client/start-twitter-stream stream)
+  (add-watch stream :queues do-on-queues-changed))


break out ErrorViewer, CauseViewer, StackTraceViewer into separate components to avoid js errors

--- src/cljs/org/broadinstitute/firecloud_ui/common/components.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/components.cljs
@@ -200,63 +200,62 @@
         [:div {:style {:fontSize "90%"}} (entity "documentation")])])})

-(declare CauseViewer)
+(react/defc StackTraceViewer
+  {:render
+   (fn [{:keys [props state]}]
+       (if (:expanded? @state)
+         [:div {:style {:overflowX "auto"}}
+          [:div {} "Stack Trace:"]
+          (map
+            (fn [line]
+                (let [[class method file num]
+                      (map line ["className" "methodName" "fileName" "lineNumber"])]
+                     [:div {:style {:marginLeft "1em" :whiteSpace "nowrap"}}
+                      (str "at " class "." method " (" file ":" num ")")]))
+            (:lines props))
+          (style/create-link #(swap! state assoc :expanded? false) "Hide Stack Trace")]
+         (style/create-link #(swap! state assoc :expanded? true) "Show Stack Trace")))})
+
+(react/defc CauseViewer
+  {:render
+   (fn [{:keys [props state]}]
+       (if (:expanded? @state)
+         (let [[source causes stack-trace message]
+               (map props ["source" "causes" "stackTrace" "message"])]
+              [:div {:style {:marginLeft "1em"}}
+               [:div {} "Message: " message]
+               (when source [:div {} "Source: " source])
+               (when (seq causes)
+                     [:div {}
+                      [:div {} (str "Cause" (when (> (count causes) 1) "s") ":")]
+                      (map (fn [cause] [CauseViewer cause]) causes)])
+               (when (seq stack-trace)
+                     [StackTraceViewer {:lines stack-trace}])
+               (style/create-link #(swap! state assoc :expanded? false) "Hide Cause")])
+         (style/create-link #(swap! state assoc :expanded? true) "Show Cause")))})
+
 (react/defc ErrorViewer
-  (let [StackTraceViewer
-        (react/create-class
-          {:render
-           (fn [{:keys [props state]}]
-             (if (:expanded? @state)
-               [:div {:style {:overflowX "auto"}}
-                [:div {} "Stack Trace:"]
-                (map
-                  (fn [line]
-                    (let [[class method file num]
-                          (map line ["className" "methodName" "fileName" "lineNumber"])]
-                      [:div {:style {:marginLeft "1em" :whiteSpace "nowrap"}}
-                       (str "at " class "." method " (" file ":" num ")")]))
-                  (:lines props))
-                (style/create-link #(swap! state assoc :expanded? false) "Hide Stack Trace")]
-               (style/create-link #(swap! state assoc :expanded? true) "Show Stack Trace")))})
-        CauseViewer
-        (react/create-class
-          {:render
-           (fn [{:keys [props state]}]
-             (if (:expanded? @state)
-               (let [[source causes stack-trace message]
-                     (map props ["source" "causes" "stackTrace" "message"])]
-                 [:div {:style {:marginLeft "1em"}}
-                  [:div {} "Message: " message]
-                  (when source [:div {} "Source: " source])
-                  (when-not (empty? causes)
-                    [:div {}
-                     [:div {} (str "Cause" (when (> (count causes) 1) "s") ":")]
-                     (map (fn [cause] [CauseViewer cause]) causes)])
-                  (when-not (empty? stack-trace)
-                    [StackTraceViewer {:lines stack-trace}])
-                  (style/create-link #(swap! state assoc :expanded? false) "Hide Cause")])
-               (style/create-link #(swap! state assoc :expanded? true) "Show Cause")))})]
-    {:render
-     (fn [{:keys [props]}]
-       (when-let [error (:error props)]
-         (let [[source status-code causes stack-trace message]
-               (map error ["source" "statusCode" "causes" "stackTrace" "message"])]
-           (if-let [expected-msg (get-in props [:expect status-code])]
-             [:div {}
-              [:span {:style {:paddingRight "1ex"}}
-               (icons/font-icon {:style {:color (:exception-red style/colors)}}
-                 :status-warning-triangle)]
-              (str "Error: " expected-msg)]
-             [:div {:style {:textAlign "initial"}}
+  {:render
+   (fn [{:keys [props]}]
+     (when-let [error (:error props)]
+       (let [[source status-code causes stack-trace message]
+             (map error ["source" "statusCode" "causes" "stackTrace" "message"])]
+         (if-let [expected-msg (get-in props [:expect status-code])]
+           [:div {}
+            [:span {:style {:paddingRight "1ex"}}
+             (icons/font-icon {:style {:color (:exception-red style/colors)}}
+               :status-warning-triangle)]
+            (str "Error: " expected-msg)]
+           [:div {:style {:textAlign "initial"}}
+            [:div {}
+             [:span {:style {:paddingRight "1ex"}}
+              (icons/font-icon {:style {:color (:exception-red style/colors)}}
+                :status-warning-triangle)]
+             (str "Error " status-code ": " message)]
+            (when source [:div {} "Source: " source])
+            (when (seq causes)
               [:div {}
-               [:span {:style {:paddingRight "1ex"}}
-                (icons/font-icon {:style {:color (:exception-red style/colors)}}
-                  :status-warning-triangle)]
-               (str "Error " status-code ": " message)]
-              (when source [:div {} "Source: " source])
-              (when-not (empty? causes)
-                [:div {}
-                 [:div {} (str "Cause" (when (> (count causes) 1) "s") ":")]
-                 (map (fn [cause] [CauseViewer cause]) causes)])
-              (when-not (empty? stack-trace)
-                [StackTraceViewer {:lines stack-trace}])]))))}))
+               [:div {} (str "Cause" (when (> (count causes) 1) "s") ":")]
+               (map (fn [cause] [CauseViewer cause]) causes)])
+            (when (seq stack-trace)
+              [StackTraceViewer {:lines stack-trace}])]))))})


Change a description

Change a description

--- src/whisper2cyanite/cli.clj
+++ src/whisper2cyanite/cli.clj
@@ -87,13 +87,13 @@
   (->> ["Whisper to Cyanite data migration tool"
         ""
         "Usage: "
-        "  whisper2cyanite [options] migrate <directory | whisper file | filelist file> <tenant> <cassandra-host,...> <elasticsearch-url>"
-        "  whisper2cyanite [options] validate <directory | whisper file | filelist file> <tenant> <cassandra-host,...> <elasticsearch-url>"
-        "  whisper2cyanite [options] calc-size <directory | whisper file | filelist file> <tenant>"
+        "  whisper2cyanite [options] migrate <directory | whisper_file | filelist_file> <tenant> <cassandra_host,...> <elasticsearch_url>"
+        "  whisper2cyanite [options] validate <directory | whisper_file | filelist_file> <tenant> <cassandra_host,...> <elasticsearch_url>"
+        "  whisper2cyanite [options] calc-size <directory | whisper_file | filelist_file> <tenant>"
         "  whisper2cyanite list-files <directory>"
         "  whisper2cyanite [options] list-paths <directory>"
-        "  whisper2cyanite info <file>"
-        "  whisper2cyanite [options] fetch <file> <rollup>"
+        "  whisper2cyanite info <whisper_file>"
+        "  whisper2cyanite [options] fetch <whisper_file> <rollup>"
         "  whisper2cyanite help"
         ""
         "Options:"


adjust to new vm domain configuration

adjust to new vm domain configuration

--- main/src/dda/pallet/dda_managed_ide/domain.clj
+++ main/src/dda/pallet/dda_managed_ide/domain.clj
@@ -79,9 +79,12 @@
       {:user user}
       (when (contains? ide-config :bookmarks)
         {:bookmarks bookmarks})
-      {:type (cond
-               (= vm-type :remote) :remote
-               (= vm-type :desktop) :desktop-office)})))
+      (when = vm-type :remote
+        {:target-type :remote-aws
+         :usage-type :desktop-office})
+      (when = vm-type :desktop-office
+        {:target-type :virtualbox
+         :usage-type :desktop-office}))))

 (s/defn ^:always-validate
   infra-configuration :- InfraResult


simplify code

simplify code

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -235,12 +235,10 @@
   (if-let [z-drive (:z-drive event)]
     (-> event
       (assoc :z
-        (if (or (:slice event)
-                (not (zero? (get-in event [:channel :z-offset]))))
-					(+ (or (get-in event [:channel :z-offset]) 0)
-					   (or (get @z-corrections z-drive)
-						     (:slice event)
-						     (get-z-stage-position)))))
+				(+ (or (get-in event [:channel :z-offset]) 0)
+				   (or (get @z-corrections z-drive)
+				     (:slice event)
+				     (get-z-stage-position z-drive))))
       (assoc-in [:postion :axes z-drive] nil))
     event))

@@ -280,7 +278,7 @@
        (def acq-sequence acq-seq)
        (execute (mapcat #(make-event-fns % out-queue) acq-seq))
        (. mmc setAutoShutter init-auto-shutter))))
-
+
 (defn convert-settings [^SequenceSettings settings]
   (-> settings
     (data-object-to-map)


respect abort during image timeout

respect abort during image timeout

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -78,8 +78,8 @@

 (def pixel-type-depths {"GRAY8" 1 "GRAY16" 2 "RGB32" 4 "RGB64" 8})

-(defn throw-exception [msg]
-  (throw (Exception. msg)))
+(defn throw-data-exception [data]
+  (throw-exception (pr-str data)))

 ;; time

@@ -379,11 +379,14 @@
         (if (< timeout-ms (- (System/currentTimeMillis) start-time))
           (throw-exception (str (- (System/currentTimeMillis) start-time)
                                 " Timed out waiting for image\nto arrive from camera."))
-          (do (when (core isBufferOverflowed)
+          (do
+            (when (core isBufferOverflowed)
                 (println "Circular buffer overflowed")
                 (throw-exception "Circular buffer overflowed."))
-              (Thread/sleep 1)
-              (recur)))))))
+            (when (@state :stop)
+              (throw-exception "Aborted!"))
+            (Thread/sleep 1)
+            (recur)))))))

 (defn pop-burst-image
   [timeout-ms]


Fix to robot-actions

Fix to robot-actions

--- ros/angelic_planning/src/ros/robot_actions.clj
+++ ros/angelic_planning/src/ros/robot_actions.clj
@@ -259,9 +259,13 @@
 	      (.spinOnce nh)
 	      (reset! a false)
 	      (println "Waiting for restart signal.")
-	      (while (not @a) (.spinOnce nh)) (reset! a false)
-	      (Thread/sleep 2000) (.spinOnce nh) (reset! a false)
-	      (recur i))
+	      (let [t (.secs (.now nh))]
+		(while (and (not @a) (not (> (.secs (.now nh)) (+ t 20))))
+		  (.spinOnce nh))
+		(reset! a false)
+		(Thread/sleep 2000) (.spinOnce nh) (reset! a false)
+		(when (< (.secs (.now nh)) (+ 22 t))
+		  (recur i))))
 	         @f (recur (if (isa? (:class (nth actions i)) ::GripperAction) (dec i) i))
 		 :else (recur (inc i)))))))


bumped up Clojure version

bumped up Clojure version

--- frameworks/Clojure/luminus/hello/project.clj
+++ frameworks/Clojure/luminus/hello/project.clj
@@ -3,7 +3,7 @@
   :description "Luminus framework benchmarks"
   :url "https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Clojure/luminus"

-  :dependencies [[org.clojure/clojure "1.7.0"]
+  :dependencies [[org.clojure/clojure "1.8.0"]
                  [selmer "1.0.0"]
                  [markdown-clj "0.9.85"]
                  [environ "1.0.1"]


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

--- re-frame-simple/project.clj
+++ re-frame-simple/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view/re-frame-simple "0.1.3"
+(defproject re-view/re-frame-simple "0.1.4-SNAPSHOT"

   :description "re-view syntax for re-frame"


Make sure field-ids is non-empty / fix API 500 :wrench:

--- src/metabase/api/table.clj
+++ src/metabase/api/table.clj
@@ -84,13 +84,14 @@
   (let-404 [table (Table id)]
     (read-check table)
     (let [field-ids (db/select-ids Field, :table_id id, :visibility_type [:not= "retired"])]
-      (for [origin-field (db/select Field, :fk_target_field_id [:in field-ids])]
-        ;; it's silly to be hydrating some of these tables/dbs
-        {:relationship   :Mt1
-         :origin_id      (:id origin-field)
-         :origin         (hydrate origin-field [:table :db])
-         :destination_id (:fk_target_field_id origin-field)
-         :destination    (hydrate (Field (:fk_target_field_id origin-field)) :table)}))))
+      (when (seq field-ids)
+        (for [origin-field (db/select Field, :fk_target_field_id [:in field-ids])]
+          ;; it's silly to be hydrating some of these tables/dbs
+          {:relationship   :Mt1
+           :origin_id      (:id origin-field)
+           :origin         (hydrate origin-field [:table :db])
+           :destination_id (:fk_target_field_id origin-field)
+           :destination    (hydrate (Field (:fk_target_field_id origin-field)) :table)})))))

 (defendpoint POST "/:id/sync"
   "Re-sync the metadata for this `Table`."


Add benchmarking scripts for sequence readers

--- bench/cljam/io/sequence_bench.clj
+++ bench/cljam/io/sequence_bench.clj
@@ -11,3 +11,31 @@
     tcommon/medium-fa-file {:mask? true}
     tcommon/medium-twobit-file {}
     tcommon/medium-twobit-file {:mask? true}))
+
+(defbench read-sequence-once-test
+  (are [f opts]
+      (let [region {:chr "chr7",
+                    :start 10000,
+                    :end 45000}]
+        (c/quick-bench
+         (with-open [rdr (cseq/reader f)]
+           (cseq/read-sequence rdr region opts))))
+    tcommon/medium-fa-file {}
+    tcommon/medium-fa-file {:mask? true}
+    tcommon/medium-twobit-file {}
+    tcommon/medium-twobit-file {:mask? true}))
+
+(defbench read-sequence-test
+  (are [f opts]
+      (let [region {:chr "chr7",
+                    :start 10000,
+                    :end 45000}]
+        (with-open [rdr (cseq/reader f)]
+          ;; warm up
+          (cseq/read-sequence rdr region opts)
+          (c/quick-bench
+           (cseq/read-sequence rdr region opts))))
+    tcommon/medium-fa-file {}
+    tcommon/medium-fa-file {:mask? true}
+    tcommon/medium-twobit-file {}
+    tcommon/medium-twobit-file {:mask? true}))


use :fn-invoke-direct by default

use :fn-invoke-direct by default

I thought I did this ages ago ... should check compiled code
more often I guess ...

--- src/main/shadow/build/api.clj
+++ src/main/shadow/build/api.clj
@@ -61,6 +61,7 @@
 (def default-compiler-options
   {:optimizations :none
    :static-fns true
+   :fn-invoke-direct true
    :elide-asserts false
    :closure-configurators []
    :infer-externs true


Don't specify the repo, it looks ugly.

Don't specify the repo, it looks ugly.

--- src/circle/backend/build/inference/rails.clj
+++ src/circle/backend/build/inference/rails.clj
@@ -205,7 +205,7 @@
       (->>
        [(when (and (dir-contains-ruby-files? repo)
                    (rvm? repo))
-          (rvm rvmrc trust ~repo))
+          (rvm rvmrc trust))
         (when use-bundler?
           (blacklist))
         (when use-bundler?


working on AMI

working on AMI

--- src/clj/clojurewerkz/statistiker/metrics.clj
+++ src/clj/clojurewerkz/statistiker/metrics.clj
@@ -5,13 +5,13 @@
 ;TODO move this to a util NS? Or find a better implementation
 (defn factorial
   [x]
-  (println x)
+  {:pre [(>= x 0)]}
     (if (zero? x)
       1
       (loop [n x f 1]
         (if (= n 1)
             f
-            (recur (dec n) (* f n))))))
+            (recur (dec n) (* f n)))))))

 ; The Mutual Information is a measure of the similarity between two labels of the same data.
 ; Where P(i) is the probability of a random sample occurring in cluster U_i and P'(j) is the probability of a random sample
@@ -65,7 +65,6 @@
         norm_n (into {} (map (fn[[k v]] [k (/ v N)]) n))
         cells (keys norm_n)
         combinations (apply concat (map (fn[[i j]] ((partial triples N a b) i j)) cells))]
-
         (reduce + (map (partial inside-fn N a b) combinations))))


link topics at home

link topics at home

--- src/cljs/daveconservatoire/site/ui_dave.cljs
+++ src/cljs/daveconservatoire/site/ui_dave.cljs
@@ -181,9 +181,9 @@

   Object
   (render [this]
-    (let [{:keys [topic/title]} (om/props this)]
+    (let [{:keys [topic/title url/slug]} (om/props this)]
       (dom/li #js {:className "span4", :style #js {"marginBottom" 5}}
-        (dom/a #js {:className "btn btn-large btn-block dc-btn-yellow", :href "/topi"}
+        (link {:className "btn btn-large btn-block dc-btn-yellow" ::r/handler ::r/topic ::r/params {::r/slug slug}}
           (dom/h3 nil
             title))))))


Fix code stylish

Fix code stylish

--- src/cljs/salava/social/ui/badge_message.cljs
+++ src/cljs/salava/social/ui/badge_message.cljs
@@ -11,19 +11,17 @@
             [salava.core.i18n :refer [t]]
             [salava.core.helper :refer [dump]]
             [salava.social.ui.follow :as f]
-            [salava.core.time :refer [date-from-unix-time]]
-
-            ))
+            [salava.core.time :refer [date-from-unix-time]]))

 (defn init-data [state]
   (ajax/GET
    (path-for (str "/obpv1/social/messages/" (:badge_content_id @state) "/" (:page_count @state)))
    {:handler (fn [data]
-               (swap! state assoc :messages (into (:messages @state) (:messages data))
-                                 :message ""
-                                 :page_count (inc (:page_count @state))
-                                 :messages_left (:messages_left data)))})
-  )
+               (swap! state assoc
+                      :messages (into (:messages @state) (:messages data))
+                      :message ""
+                      :page_count (inc (:page_count @state))
+                      :messages_left (:messages_left data)))}))

 (defn save-message [state]
@@ -39,28 +37,25 @@
                    (if (= "success" (:connected? data))
                      (do
                        (f/init-data badge_content_id)
-                       (swap! state assoc :start-following true)
-                       )
+                       (swap! state assoc :start-following true))
                      (swap! state assoc :start-following false))
-                   (swap! state assoc :messages []
-                                      :page_count 0)
+                   (swap! state assoc
+                          :messages []
+                          :page_count 0)
                    (init-data state)))
       :error-handler (fn [{:keys [status status-text]}]
-                       )})))
+                       (dump (str status " " status-text)))})))

 (defn delete-message [id state]
-(ajax/POST
-     (path-for (str "/obpv1/social/delete_message/" id))
-     {:response-format :json
-      :keywords? true
-      :handler (fn [data]
-                 (do
-                   (let [filtered-messages (filter #(not (= id (:id %))) (:messages @state))]
-                     (swap! state assoc :messages filtered-messages))
-                   ))
-      :error-handler (fn [{:keys [status status-text]}]
-                       )})
-)
+  (ajax/POST
+   (path-for (str "/obpv1/social/delete_message/" id))
+   {:response-format :json
+    :keywords? true
+    :handler (fn [data]
+               (let [filtered-messages (filter #(not (= id (:id %))) (:messages @state))]
+                 (swap! state assoc :messages filtered-messages)))
+    :error-handler (fn [{:keys [status status-text]}]
+                    (dump (str status " " status-text)))}))

 (defn delete-message-button [id state]
   (let [delete-clicked (atom nil)]
@@ -71,10 +66,8 @@
                  :aria-label "OK"
                  :on-click   #(do
                                 (reset! delete-clicked (if (= true @delete-clicked) nil true))
-                                (.preventDefault %))
-                 }
-        [:span {:aria-hidden "true"
-
+                                (.preventDefault %))}
+        [:span {:aria-hidden "true"
                 :dangerouslySetInnerHTML {:__html "×"}}]]
        (if @delete-clicked
          [:div
@@ -82,13 +75,11 @@
            (t :badge/Confirmdelete)]
           [:button {:type  "button"
                     :class "btn btn-primary"
-                    :on-click #(reset! delete-clicked nil)
-                    }
+                    :on-click #(reset! delete-clicked nil)}
            (t :badge/Cancel)]
           [:button {:type  "button"
                     :class "btn btn-warning"
-                    :on-click     #(delete-message id state)
-                    }
+                    :on-click     #(delete-message id state)}
            (t :badge/Delete)]])])))

 (defn blank-reduce [a-seq]
@@ -108,21 +99,19 @@

 (defn message-list-item [{:keys [message first_name last_name ctime id profile_picture user_id]} state]
   [:div {:class "media message-item" :key id}
-
    [:div.msgcontent
-   [:span {:class "pull-left"}
-    [:img {:class "message-profile-img" :src (profile-picture profile_picture)}]]
-   [:div {:class "media-body"}
-    [:h4 {:class "media-heading"}
+    [:span {:class "pull-left"}
+     [:img {:class "message-profile-img" :src (profile-picture profile_picture)}]]
+    [:div {:class "media-body"}
+     [:h4 {:class "media-heading"}
       [:a {:href (path-for (str "/user/profile/" user_id)) :target "_blank"} (str first_name " "last_name)]
-      [:span.date (date-from-unix-time (* 1000 ctime) "minutes")]
-     ]
-    (into [:div] (for [ item (clojure.string/split-lines message)]
-                   (into [:p.msg] (if (or (re-find #"www." item) (re-find #"https?://" item) (re-find #"http?://" item))
-                                      (search-and-replace-www item)
-                                      item))))]]
-    (if (or (=  user_id (:user_id @state)) (= "admin" (:user_role @state)))
-        [delete-message-button id state])])
+      [:span.date (date-from-unix-time (* 1000 ctime) "minutes")]]
+     (into [:div] (for [ item (clojure.string/split-lines message)]
+                    (into [:p.msg] (if (or (re-find #"www." item) (re-find #"https?://" item) (re-find #"http?://" item))
+                                     (search-and-replace-www item)
+                                     item))))]]
+   (if (or (=  user_id (:user_id @state)) (= "admin" (:user_role @state)))
+     [delete-message-button id state])])

 (defn message-list-load-more [state]
   (if (pos? (:messages_left @state))
@@ -133,7 +122,6 @@
                   :on-click #(do
                                (init-data state)
                                (.preventDefault %))}
-
               (str (t :social/Loadmore) " (" (:messages_left @state) " " (t :social/Messagesleft) ")")]]]]))

@@ -148,8 +136,7 @@
                                     (doall
                                      (for [item messages]
                                        (message-list-item item state)))
-                                    (message-list-load-more state)
-                                    ])
+                                    (message-list-load-more state)])
                  ;:component-did-mount #(scroll-bottom)
                  ;:component-did-update #(scroll-bottom)
                  }))
@@ -178,29 +165,31 @@
                     (init-data state)
                     (.preventDefault %))} "Refresh"])

+(defn start-following-alert [state]
+  (let [{:keys [badge_content_id]} @state]
+    [:div {:class (str "alert ""alert-success")}
+     [:div.deletemessage
+      [:button {:type       "button"
+                :class      "close"
+                :aria-label "OK"
+                :on-click   #(do
+                               (swap! state assoc :start-following false)
+                               (.preventDefault %))}
+       [:span {:aria-hidden "true"
+               :dangerouslySetInnerHTML {:__html "×"}}]]]
+     (str (t :social/Youstartedfollowbadge) "! ")
+     [:a {:href "#"
+          :on-click #(do
+                       (f/unfollow-ajax-post badge_content_id)
+                       (swap! state assoc :start-following false))}
+      (t :social/Cancelfollowingbadge)]]))
+
 (defn content [state]
-  (let [{:keys [messages badge_content_id start-following]} @state]
+  (let [{:keys [messages start-following]} @state]
     [:div
      (message-textarea state)
-                                        ;(refresh-button state)
      (if start-following
-       [:div {:class (str "alert ""alert-success")}
-        [:div.deletemessage
-         [:button {:type       "button"
-                   :class      "close"
-                   :aria-label "OK"
-                   :on-click   #(do
-                                  (swap! state assoc :start-following false)
-                                  (.preventDefault %))
-                   }
-          [:span {:aria-hidden "true"
-                  :dangerouslySetInnerHTML {:__html "×"}}]]
-       ]
-        (str (t :social/Youstartedfollowbadge) "! ")
-        [:a {:href "#" :on-click #(do
-                                    (f/unfollow-ajax-post badge_content_id)
-                                    (swap! state assoc :start-following false))} (t :social/Cancelfollowingbadge)]]
-       )
+       (start-following-alert state))
      [message-list messages state]]))

@@ -216,5 +205,4 @@
                      :start-following false})]
     (init-data state)
     (fn []
-      (content state)
-      )))
+      (content state))))


Updating collection data helper for changes in UMM spatial.

--- src/cmr/system_int_test/data2/collection.clj
+++ src/cmr/system_int_test/data2/collection.clj
@@ -118,8 +118,12 @@
    (c/->RelatedURL type nil url (d/unique-str "description"))))

 (defn spatial
-  [gsr]
-  (c/->SpatialCoverage gsr))
+  ([gsr]
+   (spatial gsr nil))
+  ([gsr sr & shapes]
+   (c/map->SpatialCoverage {:granule-spatial-representation gsr
+                            :spatial-representation sr
+                            :geometries (seq shapes)})))

 (defn collection
   "Creates a collection"


Replace 'cost_per_kwh' with 'cost_per_kWh'

--- src/clj/kixi/hecuba/data/measurements/calculations.clj
+++ src/clj/kixi/hecuba/data/measurements/calculations.clj
@@ -294,7 +294,7 @@
   (fn [tariff _ _]
     (condp #(%1 %2) tariff
       :off_peak_periods :on-off-peak
-      :cost_per_kwh     :simple
+      :cost_per_kWh     :simple
       :none)))

 (defn day->on-off-periods
@@ -342,7 +342,7 @@
     off          (* off-peak-cost off)))

 (defmethod apply-tariff :on-off-peak [tariff measurements operation]
-  (let [{:keys [cost_per_kwh off_peak_periods
+  (let [{:keys [cost_per_kWh off_peak_periods
                 cost_per_on_peak_kwh cost_per_off_peak_kwh]} tariff]
     (->> measurements
          measurements/parse-measurements
@@ -353,10 +353,10 @@
          (add-standing-charge-if-selected operation tariff))))

 (defmethod apply-tariff :simple [tariff measurements operation]
-  (let [{:keys [cost_per_kwh]} tariff
+  (let [{:keys [cost_per_kWh]} tariff
         total-consumption (reduce + (map :value (filter #(number? (:value %)) (measurements/parse-measurements measurements))))]
     (->> total-consumption
-         (* cost_per_kwh)
+         (* cost_per_kWh)
          (add-standing-charge-if-selected operation tariff))))

 (defmethod apply-tariff :none [_ _ _]


remove step buttons

remove step buttons

--- src/cljs/swarmpit/component/service/create_config.cljs
+++ src/cljs/swarmpit/component/service/create_config.cljs
@@ -23,16 +23,6 @@

 (def steps ["General settings" "Ports" "Networks" "Mounts" "Secrets" "Environment variables" "Deployment"])

-(defn- step-previous
-  [index]
-  (if (< 0 index)
-    (reset! step-index (dec index))))
-
-(defn- step-next
-  [index]
-  (if (> (count steps) index)
-    (reset! step-index (inc index))))
-
 (def step-style
   {:backgroundColor "transparent"})

@@ -41,24 +31,6 @@

 (def stepper-style
   {:height "60px"})
-
-(def form-previous-button-style
-  {:margin "10px 10px 10px 20px"})
-
-(defn- form-previous-button [index]
-  (comp/raised-button
-    {:label      "Previous"
-     :key        "fpb"
-     :style      form-previous-button-style
-     :disabled   (= 0 index)
-     :onTouchTap (fn [] (step-previous index))}))
-
-(defn- form-next-button [index]
-  (comp/raised-button
-    {:label      "Next"
-     :key        "fnb"
-     :disabled   (= (- (count steps) 1) index)
-     :onTouchTap (fn [] (step-next index))}))

 (defn- step-item [index form]
   (comp/step
@@ -73,9 +45,7 @@
     (comp/step-content
       {:key   (str "step-context-" index)
        :style step-content-style}
-      form
-      (form-previous-button index)
-      (form-next-button index))))
+      form)))

 (defn- create-service-info-msg
   [id]


Have the main loop display some life

Have the main loop display some life

--- src/petulant_life/main.clj
+++ src/petulant_life/main.clj
@@ -7,7 +7,8 @@

   (:require [petulant-life.rendering :as r]
             [petulant-life.config :as c]
-            [petulant-life.shader :as s]))
+            [petulant-life.shader :as s]
+            [petulant-life.life   :as l]))

 ;; Initializing the OpenGL window.
 (defn create []
@@ -39,19 +40,17 @@
          life-board)))

 ;; Running the simulation / graphics.
-(defn run [shader]
-  (while (not (Display/isCloseRequested))
-    (do (GL11/glClear GL11/GL_COLOR_BUFFER_BIT)
-        (r/draw-rectangles [[0 0 1 1]      ;; For testing no shader-based scaling.
-                            [10 10 50 50]] ;; For testing    shader-based scaling.
-                           shader
-                           [1 0 0 1])
+(defn run [shader stepper]
+  (loop [board #{[2 0] [2 1] [2 2] [1 2] [0 1]}]
+   (when-not (Display/isCloseRequested)
+     (GL11/glClear GL11/GL_COLOR_BUFFER_BIT)
+     (r/draw-rectangles (life->screen 50 10 board)
+                        shader
+                        [0 1 0 1])

-        (r/draw-rectangles (life->screen 50 10 [[0 0] [1 0] [1 1]])
-                           shader
-                           [0 1 0 1])
-
-        (Display/update))))
+     (Display/update)
+     (Thread/sleep 300)
+     (recur (stepper board)))))

 (defmacro with-cleanup [close-fn & body]
   `(try
@@ -63,4 +62,5 @@
 (defn -main [& args]
   (with-cleanup destroy
     (create)
-    (run (s/load-shader-program "resources/gol"))))
+    (run (s/load-shader-program "resources/gol")
+      l/torus-step)))