I want to see the whales loading

I want to see the whales loading

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -681,106 +681,6 @@

 ;; TODO - factory comes from core

-;;----------------------------------------
-;; TODO
-;; simplify splitting - Sparse splitting should use Object keys, not only int
-;; transform needs to suppport synthetic attributes
-
-;; create some whales...
-(time
- (doall
-  (let [batcher (Batcher. 999 1000 (list whales))
-	#^Creator creator (.getCreator whale-metadata)
-	max-length-x-100 (* max-length 100)
-	max-weight-x-100 (* max-weight 100)]
-    (pmap
-     (fn [id]
-	 (insert
-	  whales ;; batcher
-	  (.create
-	   creator
-	   (into-array
-	    Object
-	    [id
-	     0
-	     (Date. (rand-int 10)
-		    (rand-int 12)
-		    (+ (rand-int 28) 1))
-	     (rnd types)
-	     (/ (rand-int max-length-x-100) 100)
-	     (/ (rand-int max-weight-x-100) 100)]))))
-     (range num-whales)))))
-
-(println "LOADED: " num-whales)
-
-
-;; need some form of pluggable sorting algorithm
-
-;; operations are:
-;;  transform
-;;  index-with-version
-;;  filter
-;;  split (related to filter)
-;;  reduce(sum, count, ?as-percentage-within-range?[, min. max. avg, mean, median, mode, etc)
-;;  collect/union
-;;  rotate/pivot
-;;  [intersect]
-;;  [complement]
-
-;; a group-by is a tree-structure where each level represents a
-;; grouping by a further column. Difference subtrees should be
-;; parallelisable.
-
-;; initially group-by can be implemented as split/reduce/union - later, for efficiencies sake this may need to become a single operation - particularly if we want to express collapse-by-index-and-version as a group-by(key)
-
-
-;; versioned-index is actually an efficient split (by pk), reduce (all
-;; versions into latest), union all latest versions back into another
-;; set...
-
-;; rotate/pivot
-
-;; can only pivot when pivoted dimension consists of a closed set of
-;; values - e.g. a projection, since if the set were open, the
-;; insertion of new members would herald the restructuring of all
-;; members of pivoted dataset - possible but nasty...
-
-;; we could ensure this by prefiltering/pretransforming, but nicest
-;; way is by a single split with clever statelss strategy-fn.
-
-;; so pivot fn must supply such a closed list of values to be used as
-;; attribute metadata for output model....
-
-;; how about the application of fns vertically as well as horizontally
-;; during transforms.
-
-
-
-;;--------------------------------------------------------------------------------
-;; THOUGHTS:
-
-;; union fn needs access-to/to-coordinate metadata in subsequent layer of models
-;; when a union is used, the class-related md etc used in these models should be shared
-
-;; when sum fn is used must interrogate src-model md for details of chosed attribute
-
-;; do I need type - e.g. Operation and Query<Operation> with a
-;; lifecycle, with e.g. plan() and execute() phases ?
-;; plan would allow the arrangement of metadata
-;; execute would run the models... - maybe creating more and connecting them...
-;; a metamodel could be optionally injected at the top of the query...
-
-;; would our syntax be expressive enough ?
-
-;; do we have to go the whole sql hog and have e.g.
-
-;;(select/query :from <src-model> :where <filter> :groupby <split/union>)
-
-
-;; testsuite should insert whales into db and model then run analagous
-;; queries on both and compare result sets...
-;; then run more data into both and compare result of db query and existing model state
-
 ;;--------------------------------------------------------------------------------

 (defn mgroup [chain split-specs reduction-monad & reduction-args]
@@ -820,4 +720,105 @@

 (execute (mgroup my-whales [[:type false]
 			    [:time false (fn [time] (list (or (.lower years time) time)))]]
-		 mcount))+		 mcount))
+
+;;----------------------------------------
+;; TODO
+;; simplify splitting - Sparse splitting should use Object keys, not only int
+;; transform needs to suppport synthetic attributes
+
+;; create some whales...
+(time
+ (doall
+  (let [batcher (Batcher. 999 1000 (list whales))
+	#^Creator creator (.getCreator whale-metadata)
+	max-length-x-100 (* max-length 100)
+	max-weight-x-100 (* max-weight 100)]
+    (pmap
+     (fn [id]
+	 (insert
+	  whales ;; batcher
+	  (.create
+	   creator
+	   (into-array
+	    Object
+	    [id
+	     0
+	     (Date. (rand-int 10)
+		    (rand-int 12)
+		    (+ (rand-int 28) 1))
+	     (rnd types)
+	     (/ (rand-int max-length-x-100) 100)
+	     (/ (rand-int max-weight-x-100) 100)]))))
+     (range num-whales)))))
+
+(println "LOADED: " num-whales)
+
+
+;; need some form of pluggable sorting algorithm
+
+;; operations are:
+;;  transform
+;;  index-with-version
+;;  filter
+;;  split (related to filter)
+;;  reduce(sum, count, ?as-percentage-within-range?[, min. max. avg, mean, median, mode, etc)
+;;  collect/union
+;;  rotate/pivot
+;;  [intersect]
+;;  [complement]
+
+;; a group-by is a tree-structure where each level represents a
+;; grouping by a further column. Difference subtrees should be
+;; parallelisable.
+
+;; initially group-by can be implemented as split/reduce/union - later, for efficiencies sake this may need to become a single operation - particularly if we want to express collapse-by-index-and-version as a group-by(key)
+
+
+;; versioned-index is actually an efficient split (by pk), reduce (all
+;; versions into latest), union all latest versions back into another
+;; set...
+
+;; rotate/pivot
+
+;; can only pivot when pivoted dimension consists of a closed set of
+;; values - e.g. a projection, since if the set were open, the
+;; insertion of new members would herald the restructuring of all
+;; members of pivoted dataset - possible but nasty...
+
+;; we could ensure this by prefiltering/pretransforming, but nicest
+;; way is by a single split with clever statelss strategy-fn.
+
+;; so pivot fn must supply such a closed list of values to be used as
+;; attribute metadata for output model....
+
+;; how about the application of fns vertically as well as horizontally
+;; during transforms.
+
+
+
+;;--------------------------------------------------------------------------------
+;; THOUGHTS:
+
+;; union fn needs access-to/to-coordinate metadata in subsequent layer of models
+;; when a union is used, the class-related md etc used in these models should be shared
+
+;; when sum fn is used must interrogate src-model md for details of chosed attribute
+
+;; do I need type - e.g. Operation and Query<Operation> with a
+;; lifecycle, with e.g. plan() and execute() phases ?
+;; plan would allow the arrangement of metadata
+;; execute would run the models... - maybe creating more and connecting them...
+;; a metamodel could be optionally injected at the top of the query...
+
+;; would our syntax be expressive enough ?
+
+;; do we have to go the whole sql hog and have e.g.
+
+;;(select/query :from <src-model> :where <filter> :groupby <split/union>)
+
+
+;; testsuite should insert whales into db and model then run analagous
+;; queries on both and compare result sets...
+;; then run more data into both and compare result of db query and existing model state
+


Fix external media driver for maven aeron release

--- src/onyx/messaging/aeron_media_driver.clj
+++ src/onyx/messaging/aeron_media_driver.clj
@@ -1,14 +1,13 @@
 (ns onyx.messaging.aeron-media-driver
   (:require [clojure.core.async :refer [chan <!!]])
-  #_(:import [uk.co.real_logic.aeron Aeron FragmentAssemblyAdapter]
-           [uk.co.real_logic.aeron Aeron$Context]
+  (:import [uk.co.real_logic.aeron Aeron$Context]
            [uk.co.real_logic.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))

-#_(defn -main [& args]
+(defn -main [& args]
   (let [ctx (doto (MediaDriver$Context.)
-              (.threadingMode ThreadingMode/SHARED)
+              ;(.threadingMode ThreadingMode/SHARED)
               ;(.threadingMode ThreadingMode/DEDICATED)
-              (.dirsDeleteOnExit true))
+              #_(.dirsDeleteOnExit true))
         media-driver (MediaDriver/launch ctx)]
     (println "Launched the Media Driver. Blocking forever...")
     (<!! (chan))))


(maint) Don't refer queue metadata fns in DLO.

Rather than :refer-ing the queue metadata functions, alias the queue
namespace as `q` and invoke the queue metedata functions using the
namespace alias.

--- src/puppetlabs/puppetdb/command/dlo.clj
+++ src/puppetlabs/puppetdb/command/dlo.clj
@@ -6,8 +6,7 @@
    [puppetlabs.i18n.core :refer [trs]]
    [puppetlabs.kitchensink.core :refer [timestamp]]
    [puppetlabs.puppetdb.nio :refer [copts copt-atomic copt-replace oopts]]
-   [puppetlabs.puppetdb.queue :as queue
-    :refer [cmdref->entry metadata-str parse-cmd-filename]]
+   [puppetlabs.puppetdb.queue :as q]
    [puppetlabs.stockpile.queue :as stock])
   (:import
    [java.nio.file AtomicMoveNotSupportedException
@@ -48,7 +47,7 @@
               ;; entry-cmd-err-filename below.
               (let [name (-> p .getFileName str)]
                 (if-let [cmd (:command (and (.endsWith name ".json")
-                                            (parse-cmd-filename name)))]
+                                            (q/parse-cmd-filename name)))]
                   (update-metrics (ensure-cmd-metrics metrics registry cmd)
                                   cmd
                                   (Files/size p))
@@ -140,7 +139,7 @@
   [cmdref stockpile dlo]
   (let [{:keys [path registry metrics]} dlo
         {:keys [command received attempts]} cmdref
-        entry (cmdref->entry cmdref)
+        entry (q/cmdref->entry cmdref)
         cmd-dest (.resolve path (entry-cmd-data-filename entry))]
     ;; We're going to assume that our moves will be atomic, and if
     ;; they're not, that we don't care about the possibility of
@@ -173,7 +172,7 @@
   ;; indicator that the unknown message may be complete.
   (let [{:keys [path registry metrics]} dlo
         digest (digest/sha1 [bytes])
-        metadata (metadata-str received "unknown" 0 digest)
+        metadata (q/metadata-str received "unknown" 0 digest)
         cmd-dest (.resolve path (str id \- metadata))]
     (Files/write cmd-dest bytes (oopts []))
     (let [info-dest (store-failed-command-info id metadata "unknown"


Make find-morph-path work with om-sync

Make find-morph-path work with om-sync

--- src-cljs/cljs_workspace/om_morph.cljs
+++ src-cljs/cljs_workspace/om_morph.cljs
@@ -69,7 +69,7 @@

 ; morph component + rendering functions

-(defmulti shape (fn [app owner] (get-in app  [:shape :ShapeClass])))
+(defmulti shape (fn [app owner] (get-in app [:shape :ShapeClass])))
 (defmulti morph (fn [app owner] (get-in app [:morph :MorphClass])))

 ; utilities
@@ -82,7 +82,10 @@
 ; property accessors

 (defn find-morph-path
-  ([morph-model id] (find-morph-path morph-model id []))
+  ([morph-model id]
+    (if (contains? morph-model :coll) ; this is a hack to work with om-sync applied
+      (into [:coll] (find-morph-path (morph-model :coll) id []))
+      (into [] (find-morph-path morph-model id []))))
   ([morph-model id path]
     (when-let [submorph (get-in morph-model path)]
       (if (== id (submorph :id))
@@ -93,7 +96,7 @@
           nil)))))

 (defn get-prop-path [model id attrPath]
-  (into [] (concat (find-morph-path @model id) attrPath)))
+    (into [] (concat (find-morph-path @model id) attrPath)))

 (defn set-position [model id pos]
   (let [prop-path (get-prop-path model id [:morph :Position])]


trim right-click learning msg so less clunky

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -183,7 +183,7 @@
                                             :left (+ (get-in app [:mouse :x]) (if aside-opened? (- 16 256) 16) )}}
                    (if (= :touch (get-in app [:mouse :type]))
                      "Tap and hold to select tool"
-                     "Right-click to select tool")])]
+                     "Try right-click")])]
                [:div.app-overlay
                 [:figure.overlay-info {:on-click #(cast! :overlay-info-toggled)
                                        :class (when-not overlay-info-open? "hidden")}


Make minilog more readable

Make minilog more readable

--- src/robinson/ui/components/robinson.clj
+++ src/robinson/ui/components/robinson.clj
@@ -1396,16 +1396,22 @@
               (zc/csx [:text {} [
                         [Highlight {} ["/"]]
                         [:text {} ["-"]]
-                        [:text {:style {:color up-arrow-color}} [up-arrow-char]]]])
+                        [:text {:style {:color up-arrow-color
+                                        :background-color (zcolor/with-alpha (rcolor/color->rgb :black) 242)}}
+                               [up-arrow-char]]]])
               (zc/csx [:text {} ["   "]]))
             (if msg-below?
               (zc/csx [:text {} [
                         [Highlight {} ["*"]]
                         [:text {} ["-"]]
-                        [:text {:style {:color down-arrow-color}} [down-arrow-char]]]])
+                        [:text {:style {:color down-arrow-color
+                                        :background-color (zcolor/with-alpha (rcolor/color->rgb :black) 242)}}
+                               [down-arrow-char]]]])
               (zc/csx [:text {} ["   "]]))
             (if (get message :text)
-              (zc/csx [:text {:style {:color (rcolor/color->rgb (get message :color))}} [(str (get message :text))]])
+              (zc/csx [:text {:style {:color (rcolor/color->rgb (get message :color))
+                                      :background-color (zcolor/with-alpha (rcolor/color->rgb :black) 242)}}
+                             [(str (get message :text))]])
               (zc/csx [:text {} [""]]))]]]])))

 (defn target-pos [game-state]


fixed unloaded-ns-from-ex for unloaded fn and add safe-exec to transit encoder

--- src/datasplash/core.clj
+++ src/datasplash/core.clj
@@ -28,13 +28,15 @@
 (defn unloaded-ns-from-ex
   [e]
   (let [{:keys [class message trace-elems]} (st/parse-exception e)]
-    (when (re-find #"clojure\.lang\.Var\$Unbound" message)
-      (->> trace-elems
-           (filter #(:clojure %))
-           (map :ns)
-           (remove nil?)
-           (distinct)
-           (map symbol)))))
+    (when (re-find #"clojure\.lang\.Var\$Unbound|call unbound fn" message)
+      (let [[_ missing-ns] (re-find #"call unbound fn: #'([^/]+)/" message)]
+        (->> trace-elems
+             (filter #(:clojure %))
+             (map :ns)
+             (concat (list missing-ns))
+             (remove nil?)
+             (distinct)
+             (map symbol))))))

 (defmacro safe-exec
   [& body]
@@ -52,8 +54,9 @@
                (require missing#)
                (swap! required-ns conj missing#)
                ~@body)
-             (throw (ex-info (format "Dynamic reloading of namespace %s seems not to work" (name missing#))
-                             {:last-namespace missing#}
+             (throw (ex-info "Dynamic reloading of namespace seems not to work"
+                             {:ns-from-exception nss#
+                              :ns-load-attempted already-required#}
                              e#))))
          (throw e#)))))

@@ -103,13 +106,13 @@
   []
   (proxy [CustomCoder] []
     (encode [obj ^OutputStream out ^Coder$Context context]
-      (require '[cognitect.transit :as transit])
-      (let [wrt (transit/writer out :msgpack)]
-        (transit/write wrt obj)))
+      (safe-exec
+       (let [wrt (transit/writer out :msgpack)]
+         (transit/write wrt obj))))
     (decode [^InputStream in ^Coder$Context context]
-      (require '[cognitect.transit :as transit])
-      (let [rdr (transit/reader in :msgpack)]
-        (transit/read rdr)))
+      (safe-exec
+       (let [rdr (transit/reader in :msgpack)]
+         (transit/read rdr))))
     (verifyDeterministic [] nil)
     (consistentWithEquals [] true)))


Add crucial note

Add crucial note

--- src/defragment/core.clj
+++ src/defragment/core.clj
@@ -145,6 +145,7 @@
   "Takes file path, show name, and date.
    Returns a string with the outgoing show filename and path, with ogg extension"
   [path name date]
+  ;; TODO: XXX if there already is an arhive there! don't overwrite it, use a new name!
   (format "%s/%s-%s.ogg"  path date name))


Handle infinite datastructures

Handle infinite datastructures

--- src/devtools/debug.cljs
+++ src/devtools/debug.cljs
@@ -12,6 +12,9 @@
 (def ^:dynamic *inited* false)
 (def ^:dynamic *indent* 0)
 (def ^:dynamic *console* nil)
+
+(def ^:dynamic *debug-print-length* 10)
+(def ^:dynamic *debug-print-level* 5)

 (defn indentation []
   (apply str (take *indent* (repeat indentation-spacer))))
@@ -30,13 +33,19 @@
     (logger/getLogger padded-name)))

 (defn log [logger message]
-  (.info logger (apply str (cons (indentation) (str message)))))
+  (binding [*print-length* *debug-print-length*
+            *print-level* *debug-print-level*]
+    (.info logger (apply str (cons (indentation) (str message))))))

 (defn log-exception [message]
-  (.shout (logger "ex!") (apply str (cons (indentation) (str message)))))
+  (binding [*print-length* *debug-print-length*
+            *print-level* *debug-print-level*]
+    (.shout (logger "ex!") (apply str (cons (indentation) (str message))))))

 (defn log-info [message]
-  (.info (logger "info") (apply str (cons (indentation) (str message)))))
+  (binding [*print-length* *debug-print-length*
+            *print-level* *debug-print-level*]
+    (.info (logger "info") (apply str (cons (indentation) (str message))))))

 (defn init-logger! []
   (set! *console* (goog.debug.FancyWindow. "devtools"))


Finished functions to aggregate lines.

Finished functions to aggregate lines.

--- src/clj/forma/trends.clj
+++ src/clj/forma/trends.clj
@@ -5,7 +5,8 @@
 ;; vector be calling vec on it.)

 (ns forma.trends
-  (:use cascalog.api))
+  (:use cascalog.api
+        [clojure.contrib.math :only (ceil)]))

 ;; ### Time Series Generation
 ;;
@@ -103,9 +104,66 @@
 ;; will be either float or int arrays.

 ;; ## Walking the Matrix
+
+;; Great for testing what buffers will do; this returns a string
+;; representation of the input.
+
+(defbufferop tuples->string
+  [tuples]
+  [(apply str (map str tuples))])
+
+;; ## Let's figure out how to get the chunks reconstituted.
+
+(def num-lines 20)
+(def num-samples 20)
+
+(def points
+  (memory-source-tap
+   (for [h (range 3)
+         s (range num-samples)
+         l (range num-lines) :let [val {:key s}]]
+     [h 1 s l val])))
+
+;; TODO: Check on cascalog group -- is this the best way? Hammering a
+;; vector in place?
+(defbufferop [rebuild-lines [width]]
+  [tuples]
+  [(vector ((apply comp (for [tup tuples]
+                          (fn [v] (apply assoc (vec v) tup))))
+            (repeat width 0)))])
+
+;; TODO: document the line-length, num-groups business. Right now, if
+;; I'm not mistaken, we need num-groups to divide evenly into
+;; line-length.
 ;;
+;; TODO: Work out solution where group-length can unevenly divide.
+
+(defn group-lines
+  "Function to generate an aggregating predicate macro that stitches
+  lines back together. Lines are grouped into `num-groups` total
+  blocks. Currently, we require that `num-groups` divide evenly into
+  `line-length`."
+  [line-length num-groups]
+  {:pre [(= 0 (mod line-length num-groups))]}
+  (let [group-length (ceil (/ line-length num-groups))]
+    (<- [?line ?sample ?val :> ?line-group ?full-line]
+        (:sort ?line ?sample)
+        (mod ?sample group-length :> ?subidx)
+        (quot ?sample group-length :> ?line-group)
+        (rebuild-lines [group-length] ?subidx ?val :> ?full-line))))
+
+(defn run-line-aggretator
+  "Takes a samples and line generator, and stitches lines back
+  together. "
+  []
+  (let [agg-lines (group-lines 20 1)]
+    (?<- (stdout)
+         [?tile-h ?tile-v ?line ?line-group ?full-line]
+         (points ?tile-h ?tile-v ?sample ?line ?val)
+         (agg-lines ?line ?sample ?val :> ?line-group ?full-line))))
+
+
 ;; TODO: -- documentation on why we do this. Nearest neighbor analysis links.
-
 (defn walk-matrix
   "Walks along the rows and columns of a matrix at the given window
   size, returning all (window x window) snapshots."


Allow direct input in input-field for round score

--- src/cljs/darts/core.cljs
+++ src/cljs/darts/core.cljs
@@ -113,8 +113,8 @@
     (str "Player " (+ 1 @current-player) " turn")
     [:br]
     [:input {:type :text
-             :disabled true
-             :value @score}]
+             :value @score
+             :on-change (fn [e] (do (reset! score (str (-> e .-target .-value)))))}]
     [:br]
     [numpad]
     (println @game)]])
@@ -138,6 +138,7 @@
       [:select {:id "player1"
                 :value @player1
                 :on-change #(reset! player1 (.-value (js/document.getElementById "player1")))}
+
        (doall
         (concat [^{:key "1-nil"}[:option ""]]
                 (map (fn [{:keys [name]}]


This needs to be invoke_ArityVariadic. Typing List and HashMap

--- src/cljs/go/compiler.clj
+++ src/cljs/go/compiler.clj
@@ -383,14 +383,14 @@
                (comma-sep keys)
                "},[]interface{}{"
                (comma-sep vals)
-               "}).(CljsCorePersistentHashMap)")))))
+               "}).(*CljsCorePersistentHashMap)")))))

 (defmethod emit* :list
   [{:keys [items env]}]
   (emit-wrap env
     (if (empty? items)
       (emits "CljsCoreList_EMPTY")
-      (emits "List(" (comma-sep items) ")"))))
+      (emits "List.X_invoke_ArityVariadic(" (comma-sep items) ").(*CljsCoreList)"))))

 (defmethod emit* :vector
   [{:keys [items env]}]


Put back require of goog.string.format

Put back require of goog.string.format

Removed by mistake in previous commit.

--- src/cljs/klang/core.cljs
+++ src/cljs/klang/core.cljs
@@ -19,6 +19,7 @@
     [goog.events :as gevents]
     [goog.object :as gobj]
     [goog.string :as gstring]
+    [goog.string.format]
     [goog.style :as gstyle])
   (:import
     goog.ui.KeyboardShortcutHandler))


removed obsolete confirmation routes

removed obsolete confirmation routes

--- src/freecoin/routes.clj
+++ src/freecoin/routes.clj
@@ -106,10 +106,6 @@

   (GET  "/signin" [request] (wallet/get-create  request))
   (POST "/signin" [request] (wallet/post-create request))
-  (GET  "/wallets/:confirmation"  [confirmation :as request]
-        (wallet/get-create-confirm request confirmation))
-  (POST "/wallets/:confirmation" [confirmation :as request]
-        (wallet/post-create-confirm request confirmation))

   ;; Search function
   (GET "/participants" [request] (wallet/participants-form request))


Reimplementation of scheduler

Reimplementation of scheduler

Removed scheduled-future and replaced with a check to the status of
the scheduler on callback. This fixes #10.

--- src/tick/schedule.clj
+++ src/tick/schedule.clj
@@ -9,27 +9,37 @@
     (let [dly (.until (.instant clock) (:tick/date next-time) ChronoUnit/MILLIS)]
       (.schedule executor ^Callable callback dly TimeUnit/MILLISECONDS))))

-(defn callback [state timeline {:keys [clock trigger executor promise] :as opts}]
-  (let [[due next-timeline] (split-with #(not (.isAfter (.toInstant (:tick/date %)) (.instant clock))) timeline)]
+(defn callback [state {:keys [clock trigger executor promise] :as opts}]
+  ;; The time is now. We have been called for a reason. That reason
+  ;; might be that we have to run a task.
+  (let [{:keys [timeline due status] :as result}
+        (swap! state
+               (fn [st]
+                 (if-not (= :running (:status st))
+                   ;; If we are stopped, paused or done, then we do nothing. We don't
+                   ;; schedule another task. We just exit.
+                   (dissoc st :due)

-    (if-not (empty? next-timeline)
-      ;; Schedule next
-      (do
-        (swap! state assoc
-               :timeline next-timeline
-               :scheduled-future (schedule-next (first next-timeline)
-                                                {:clock clock
-                                                 :executor executor
-                                                 :callback #(callback state next-timeline opts)}))
-        (dorun (map trigger due)))
+                   (let [[due next-timeline] (split-with #(not (.isAfter (.toInstant (:tick/date %)) (.instant clock))) (:timeline st))]

-      ;; Set status to :done
-      (do (swap! state (fn [s] (-> s
-                                   (assoc :status :done)
-                                   (dissoc :timeline :scheduled-future))))
-          (dorun (map trigger due))
-          (deliver promise :done)))))
+                     (cond-> st
+                       (not (empty? next-timeline)) (assoc :timeline next-timeline)
+                       (empty? next-timeline) (-> (assoc :status :done)
+                                                  (dissoc :timeline))
+                       due (assoc :due due))))))]

+    (when due
+      (when (and (= status :running) timeline)
+        (schedule-next (first timeline)
+                       {:clock clock
+                        :executor executor
+                        :callback #(callback state opts)}))
+
+      (doseq [job due]
+        (.submit executor #(trigger job))))
+
+    (when (= status :done)
+      (deliver promise :done))))

 (defprotocol ITicker
   "A ticker travels across a timeline, usually triggering some action for each time on the timeline."
@@ -43,23 +53,22 @@
 (defrecord SchedulingTicker [trigger timeline executor state promise]
   ITicker
   (start [_ clock]
-    (swap! state assoc
-           :status :running
-           :timeline timeline
-           :scheduled-future (schedule-next
-                              (first timeline)
-                              {:clock clock
-                               :executor executor
-                               :callback #(callback state timeline {:clock clock :trigger trigger :executor executor :promise promise})})
-           :clock clock
-           :executor executor)
+    (let [{:keys [timeline]} (swap! state assoc
+                                    :status :running
+                                    :timeline timeline
+                                    :clock clock
+                                    :executor executor)]
+      (schedule-next
+       (first timeline)
+       {:clock clock
+        :executor executor
+        :callback #(callback state {:clock clock :trigger trigger :executor executor :promise promise})}))
+
     promise)

   (pause [_]
     (let [st @state]
-      (when-let [fut (:scheduled-future st)]
-        (.cancel fut false))
-      (swap! state (fn [st] (-> st (assoc :status :paused) (dissoc :scheduled-future))))
+      (swap! state (fn [st] (-> st (assoc :status :paused))))
       :ok))

   (resume [_]
@@ -68,19 +77,18 @@
         (let [timeline (:timeline st)
               executor (:executor st)
               clock (:clock st)]
-          (swap! state (fn [st] (-> st (assoc :status :running
-                                              :scheduled-future (schedule-next
-                                                                 (first timeline)
-                                                                 {:clock clock
-                                                                  :executor executor
-                                                                  :callback #(callback state timeline {:clock clock :trigger trigger :executor executor :promise promise})}))))))
-
+          (let [{:keys [timeline]}
+                (swap! state (fn [st] (-> st (assoc :status :running
+                                                    ))))]
+            (schedule-next
+             (first timeline)
+             {:clock clock
+              :executor executor
+              :callback #(callback state {:clock clock :trigger trigger :executor executor :promise promise})})))
         :ok)))

   (stop [_]
-    (when-let [fut (:scheduled-future @state)]
-      (.cancel fut false))
-    (swap! state (fn [s] (-> s (assoc :status :stopped) (dissoc :scheduled-future))))
+    (swap! state (fn [s] (-> s (assoc :status :stopped))))
     :ok)

   (remaining [_]


cleanup

cleanup

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -85,27 +85,22 @@
    at each supplied path in comp-paths, the bolts for that path."
   [bolt model comp-paths bolts-at-paths depth max-depth & [top-bolt truncate? take-n]]
   (when (not (= :fail bolt))
-    (do
-      (if (not (empty? comp-paths))
-        (log/trace (str "add-comps: " ((:morph-ps model) bolt) ": comp-paths:" (string/join "," comp-paths))))
-      (lazy-seq
-       (let [top-bolt (or top-bolt bolt)
-             truncate? (if (= truncate? false)
-                         false
-                         true)]
-         (if (empty? comp-paths)
-           (do
-             (log/trace (str "add-comps done with this bolt: " ((:morph-ps model) bolt)))
-             [bolt]) ;; done: we've added all the comps to the bolt, so just return the bolt as a singleton vector.
-           ;; else, more comp-paths to go.
-           (flatten
-            (mapfn #(add-comps % model
-                               (rest comp-paths)
-                               (rest bolts-at-paths)
-                               depth max-depth top-bolt truncate? take-n)
-                   (add-bolts-to-path
-                    (first comp-paths) (first bolts-at-paths)
-                    bolt top-bolt model depth max-depth truncate? take-n)))))))))
+    (lazy-seq
+     (let [top-bolt (or top-bolt bolt)
+           truncate? (if (= truncate? false)
+                       false
+                       true)]
+       (if (empty? comp-paths)
+         [bolt] ;; done: we've added all the comps to the bolt, so just return the bolt as a singleton vector.
+         ;; else, more comp-paths to go.
+         (flatten
+          (mapfn #(add-comps % model
+                             (rest comp-paths)
+                             (rest bolts-at-paths)
+                             depth max-depth top-bolt truncate? take-n)
+                 (add-bolts-to-path
+                  (first comp-paths) (first bolts-at-paths)
+                  bolt top-bolt model depth max-depth truncate? take-n))))))))

 (defn add-bolt-at [top-bolt bolt path bolt-at model depth max-depth truncate? & [take-n]]
   (mapfn #(do-defaults % model)


remove any-possible-complement?

remove any-possible-complement?

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -98,7 +98,8 @@
   [language-model spec depth total-depth
                        & {:keys [max-total-depth]
                           :or {max-total-depth max-total-depth}}]
-  (log/debug (str "lightning-bolt with depth:" depth " and spec:" (strip-refs spec)))
+  (log/info (str "lightning-bolt with depth: (" total-depth "/" max-total-depth ") and spec-info:"
+                 (spec-info spec)))
   (let [grammar (:grammar language-model)
         depth (if depth depth 0)
         ;; this is the relative depth; that is, the depth from the top of the current lightning bolt.
@@ -150,45 +151,10 @@
                            (filter #(= true
                                        (get-in % [:head :phrasal] true))
                                    parents)))]
-      (filter
-       (fn [bolt]
-         (any-possible-complement?
-          bolt [:comp] language-model total-depth
-          :max-total-depth max-total-depth))
-       (if (lexemes-before-phrases total-depth max-total-depth)
-         (lazy-cat lexical phrasal)
-         (lazy-cat phrasal lexical))))))
-
-;; TODO: was copied from (defn add-complement-to-bolt) and then modified:
-;; refactor both above and below so that commonalities are shared.
-(defn any-possible-complement? [bolt path language-model total-depth
-                                & {:keys [max-total-depth]
-                                   :or {max-total-depth max-total-depth}}]
-  (let [lexicon (or (:lexicon (:generate language-model))
-                    (:lexicon language-model))
-        spec (get-in bolt path)
-        immediate-parent (get-in bolt (butlast path))
-        complement-candidate-lexemes
-        (if (and
-             (not (= true (get-in bolt (concat path [:phrasal]))))
-             (:index-fn language-model))
-          ((:index-fn language-model) spec))
-        bolt-child-synsem (strip-refs (get-in bolt (concat path [:synsem]) :top))
-        lexical-complements (filter (fn [lexeme]
-                                      (not-fail? (unify (strip-refs (get-in lexeme [:synsem] :top))
-                                                        bolt-child-synsem)))
-                                    complement-candidate-lexemes)]
-    (or (not (empty? lexical-complements))
-        (not (empty?
-              (filter #(not-fail? %)
-                      (mapfn (fn [complement]
-                               (unify (strip-refs (get-in bolt [:synsem]))
-                                      (assoc-in {} (concat path [:synsem])
-                                                complement)))
-                             (if (and (> max-total-depth total-depth)
-                                      (= true (get-in spec [:phrasal] true)))
-                               (generate-all spec language-model (+ (count path) total-depth)
-                                             :max-total-depth max-total-depth)))))))))
+      (if (lexemes-before-phrases total-depth max-total-depth)
+        (lazy-cat lexical phrasal)
+        (lazy-cat phrasal lexical)))))
+
 (defn add-all-comps
   "At each point in each bolt in the list of list of bolts,
   _bolt-groups_, add all possible complements at all open nodes in the


+(defn candidate-parents [rules spec])

+(defn candidate-parents [rules spec])

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -128,6 +128,11 @@
                      "'" (morph (first expressions)) "'"))
       (log/debug (str "generate-all: no expressions could be generated for spec:" (strip-refs expressions))))
     expressions))
+
+(defn candidate-parents [rules spec]
+  "find subset of _rules_ for which each member unifies successfully with _spec_"
+  (filter #(not (fail? (unifyc % spec)))
+          rules))

 (defn lightning-bolt [grammar lexicon spec depth index morph total-depth]
   "Returns a lazy-sequence of all possible trees given a spec, where


don't truncate if unified is fail

don't truncate if unified is fail

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -220,7 +220,8 @@
                            (unify! (copy bolt)
                                    (assoc-in {} path
                                              (copy complement)))]
-                       (if truncate-children
+                       (if (and (not-fail? unified)
+                                truncate-children)
                          (truncate unified [path] language-model)
                          unified)))
                    (let [phrasal-complements (if (and (> max-total-depth total-depth)


~(defn parent-with-head): more simplification

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -120,17 +120,16 @@

 (defn parent-with-head
   "Return every possible tree of depth 1 from the given spec."
-  [spec depth]
+  [spec depth
   ;; get all rules that match input _spec_:
-  (if (nil? spec) (throw (Exception. (str "nope: spec was nil.")))
-      (->> grammar
-           (map #(unify % spec))
-           (filter #(not (= :fail %)))
-
-           ;; try to add heads to each matching rule:
-           (parent-with-head-1 spec depth)
-           (filter #(not (= % :fail)))
-           (map #(u/assoc-in! % [::started?] true)))))
+   (->> grammar
+        (map #(unify % spec))
+        (filter #(not (= :fail %)))
+
+        ;; try to add heads to each matching rule:
+        (parent-with-head-1 spec depth)
+        (filter #(not (= % :fail)))
+        (map #(u/assoc-in! % [::started?] true)))])

 (defn parent-with-head-1 [spec depth parent-rules]
   (if (not (empty? parent-rules))


Allow sample-size-threshold to be set by Beehive

--- src/beehive/service.clj
+++ src/beehive/service.clj
@@ -125,14 +125,27 @@
            failure-threshold
            failure-percentage-threshold
            backoff-time-millis
-           health-refresh-millis]}]
-  (DefaultCircuitBreaker.
-    ^BreakerConfig (.build (cond-> (BreakerConfigBuilder.)
-                             trailing-period-millis (.trailingPeriodMillis trailing-period-millis)
-                             failure-threshold  (.failureThreshold failure-threshold)
-                             failure-percentage-threshold (.failurePercentageThreshold failure-percentage-threshold)
-                             backoff-time-millis (.backOffTimeMillis backoff-time-millis)
-                             health-refresh-millis (.healthRefreshMillis health-refresh-millis)))))
+           health-refresh-millis
+           sample-size-threshold]}]
+  (let [config (cond-> (BreakerConfigBuilder.)
+                       trailing-period-millis
+                       (.trailingPeriodMillis trailing-period-millis)
+
+                       failure-threshold
+                       (.failureThreshold failure-threshold)
+
+                       failure-percentage-threshold
+                       (.failurePercentageThreshold failure-percentage-threshold)
+
+                       backoff-time-millis
+                       (.backOffTimeMillis backoff-time-millis)
+
+                       health-refresh-millis
+                       (.healthRefreshMillis health-refresh-millis)
+
+                       sample-size-threshold
+                       (.sampleSizeThreshold sample-size-threshold))]
+    (DefaultCircuitBreaker. ^BreakerConfig (.build config))))

 (defn service
   [name


Updated docstring.

Updated docstring.

--- src/grafter/tabular.clj
+++ src/grafter/tabular.clj
@@ -135,7 +135,12 @@
                                      ;; leave item-numbers as is (i.e. stay on current item after fast forwarding the data)
                                      item-numbers)))

-(defn rows [dataset row-numbers & {:as opts}]
+(defn rows
+  "Takes a dataset and a seq of row-numbers and returns a dataset
+  consisting of just the supplied rows.  If a row number is not found
+  the function will assume it has consumed all the rows and return
+  normally."
+  [dataset row-numbers & {:as opts}]
   (let [rows (indexed (inc/to-list dataset))
         filtered-rows (select-indexed rows row-numbers)]
     (make-dataset (column-names dataset)


fix formatting

fix formatting

--- src/bract/core/kdef.clj
+++ src/bract/core/kdef.clj
@@ -30,8 +30,8 @@
                                                                                :sysprop "app.verbose"}]
   ctx-context-file  [:bract.core/context-file (some-fn string?
                                                 nil?)  "Context file name"       {:default nil
-                                                                    :envvar  "APP_CONTEXT"
-                                                                    :sysprop "app.context"}]
+                                                                                :envvar  "APP_CONTEXT"
+                                                                                :sysprop "app.context"}]
   ctx-config-files  [:bract.core/config-files  vector? "Config file names"       {:parser  kputil/any->vec
                                                                                :default []
                                                                                :envvar  "APP_CONFIG"


OM-676

--- src/cellophane/next.clj
+++ src/cellophane/next.clj
@@ -587,6 +587,22 @@

 (declare get-indexer)

+(defn- get-indexed-query
+  "Get a component's static query from the indexer. For recursive queries, recurses
+   up the data path. Falls back to `get-class-or-instance-query` if nothing is
+   found in the indexer."
+  [component class-path-query-data data-path]
+  (let [qs (filter #(= data-path (-> % zip/root (focus->path data-path)))
+             class-path-query-data)
+        qs (if (empty? qs) class-path-query-data qs)]
+    (if-not (empty? qs)
+      (let [q (first qs)
+            node (zip/node q)]
+        (if-not (util/recursion? node)
+          node
+          (recur component class-path-query-data (pop data-path))))
+      (get-class-or-instance-query component))))
+
 (defn get-query
   "Return a IQuery/IParams instance bound query. Works for component classes
    and component instances. See also om.next/full-query."
@@ -598,13 +614,8 @@
         (let [cp (class-path x)
               r (get-reconciler x)
               data-path (into [] (remove number?) (path x))
-              class-path-query-data (get (:class-path->query @(get-indexer r)) cp)
-              qs (filter #(= data-path (-> % zip/root (focus->path data-path)))
-                   class-path-query-data)
-              qs (if (empty? qs) class-path-query-data qs)]
-          (if-not (empty? qs)
-            (zip/node (first qs))
-            (get-class-or-instance-query x))))
+              class-path-query-data (get (:class-path->query @(get-indexer r)) cp)]
+          (get-indexed-query x class-path-query-data data-path)))
       (get-class-or-instance-query x))))

 (defn tag [x class]
@@ -939,7 +950,8 @@
                                           (focus-query rootq path)
                                           path)
                           cp-query      (cond-> focused-query
-                                          (not= (zip/node focused-query) query)
+                                          (and (not= (zip/node focused-query) query)
+                                               (not recursive?))
                                           (zip/replace query))]
                       (swap! class-path->query update-in [classpath]
                         (fnil conj #{}) cp-query)))


Use bytes= instead of array-eq

Use bytes= instead of array-eq

--- test/caesium/crypto/secretbox_test.clj
+++ test/caesium/crypto/secretbox_test.clj
@@ -20,8 +20,8 @@
 (deftest secretbox-kat-test
   (are [nonce ctext] (let [encrypted (s/encrypt secret-key nonce ptext)
                            decrypted (s/decrypt secret-key nonce ctext)]
-                       (and (u/array-eq encrypted ctext)
-                            (u/array-eq decrypted ptext)))
+                       (and (bb/bytes= encrypted ctext)
+                            (bb/bytes= decrypted ptext)))
     n0 (v/hex-resource "vectors/secretbox/ciphertext0")
     n1 (v/hex-resource "vectors/secretbox/ciphertext1"))
   (are [nonce ciphertext]
@@ -32,7 +32,7 @@

 (deftest int->nonce-test
   (testing "Turning numbers into nonces works"
-    (are [n expected] (u/array-eq expected (s/int->nonce n))
+    (are [n expected] (bb/bytes= expected (s/int->nonce n))
       0 (byte-array 24)
       0M (byte-array 24)
       1000000000000 (byte-array (into (vec (repeat 19 0))


dependency upgrades: [org.clojure/clojure "1.7.0-alpha6"]  [compojure "1.3.3"] [com.taoensso/carmine "2.9.2"]

--- Clojure-Websockets/MainApp/project.clj
+++ Clojure-Websockets/MainApp/project.clj
@@ -2,11 +2,10 @@
   :description "Main part of the BirdWatch system (without TwitterClient)"
   :url "https://github.com/matthiasn/Birdwatch"
   :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.7.0-alpha5"]
+  :dependencies [[org.clojure/clojure "1.7.0-alpha6"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [clojurewerkz/elastisch "2.2.0-beta2"]
                  [org.clojure/tools.logging "0.3.1"]
-                 [com.matthiasnehlsen/inspect "0.1.12"]
                  [matthiasn/systems-toolbox "0.1.23-SNAPSHOT"]
                  [org.clojure/tools.namespace "0.2.10"]
                  [ch.qos.logback/logback-classic "1.1.2"]
@@ -17,7 +16,7 @@
                  [http-kit "2.1.19"]
                  [hiccup "1.0.5"]
                  [garden "1.2.5"]
-                 [compojure "1.3.2"]
+                 [compojure "1.3.3"]
                  [ring "1.3.2"]
                  [ring/ring-defaults "0.1.4"]
                  [clj-time "0.9.0"]
@@ -28,7 +27,7 @@
                  [reagent "0.5.0"]
                  [clj-pid "0.1.1"]
                  [com.stuartsierra/component "0.2.3"]
-                 [com.taoensso/carmine "2.9.0"]
+                 [com.taoensso/carmine "2.9.2"]
                  [metrics-clojure "2.4.0"]]

   :source-paths ["src/clj/"]


remove unused library

remove unused library

--- Clojure-Websockets/MainApp/project.clj
+++ Clojure-Websockets/MainApp/project.clj
@@ -4,7 +4,6 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0-alpha3"]
-                 [twitter-api "0.7.6" :exclusions [org.clojure/clojure org.clojure/data.json]]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [clojurewerkz/elastisch "2.1.0-beta9" :exclusions [com.fasterxml.jackson.core/jackson-core]]
                  [org.clojure/tools.logging "0.3.0"]


better idiom

better idiom

--- pigpen-cascading/src/main/clojure/pigpen/cascading.clj
+++ pigpen-cascading/src/main/clojure/pigpen/cascading.clj
@@ -108,7 +108,7 @@
                         (Insert. (cfields ["group_all"]) (into-array [1]))
                         (cfields ["group_all" "value"]))]
                 (map (:pipes flowdef) ancestors))
-        is-inner (= #{:required} (into #{} join-types))
+        is-inner (every? #{:required} join-types)
         pipes (map (fn [p k] (if is-inner
                                (Each. p (cfields k) (FilterNull.))
                                p))


Revert "oh i can't do this because defn wants symbol and I'm giving it a lexical that resolves as a symbol ah and this would've faqing solve the isAssumptionFailed issue and also not using eval"

This reverts commit 85219208007fff6e7a11fb579d7125c73a6dc597.

--- src/util/funxions.clj
+++ src/util/funxions.clj
@@ -89,35 +89,33 @@
    passedDefBlock; a map
    & codeblocks ;multiple forms as code
    ]
-  `(let [
-         ;readyforeval_fname# (list 'backtick/template ~fname)
-         ;evaluated_fname# (eval readyforeval_fname#)
-         evaluated_fname# (backtick/template ~fname);the fname after ~ are evaluated
-         ;fn_name
-         _# (q/assumedTrue [
-                           (symbol? evaluated_fname#)
-                           "fname must be a symbol, you passed `"
-                           ~fname
-                           "` which resolved to `"
-                           evaluated_fname#
-                           "` of type `"
-                           (type evaluated_fname#)
-                           "` . Maybe you want to use ~ to cause a resolve."]
-             )
-
-         ;lstBackTicked_passedDefBlock# (list 'backtick/template ~passedDefBlock)
-         ;evaDefBlock# (eval lstBackTicked_passedDefBlock#)
-         evaDefBlock# (backtick/template ~passedDefBlock);the defblock after ~ are evaluated
-         ;_ (q/assumedTrue (symbol? fname))
-         _# (q/assumedTrue [(map? evaDefBlock#) "the defBlock must be a map"])
-
-         aliases# (second (find evaDefBlock# :aliases)) ;can be nil
-         ]
-     ;(q/when-debug (clojure.pprint/pprint (list ":aliases=" aliases#)))
-     ;(q/when-debug (clojure.pprint/pprint (list "evaDefBlock=" evaDefBlock#)))
-     (q/when-debug (q/show-lexical-env))
-     ; evaDefBlock == `'~evaDefBlock# = `~*fxn_defBlock_symbol*
-     (defn evaluated_fname#
+  (let [
+        readyforeval_fname (list 'backtick/template fname)
+        evaluated_fname (eval readyforeval_fname) ;the fname after ~ are evaluated
+        ;fn_name
+        _ (q/assumedTrue [
+                          (symbol? evaluated_fname)
+                          "fname must be a symbol, you passed `"
+                          fname
+                          "` which resolved to `"
+                          evaluated_fname
+                          "` of type `"
+                          (type evaluated_fname)
+                          "` . Maybe you want to use ~ to cause a resolve."]
+            )
+
+        lstBackTicked_passedDefBlock (list 'backtick/template passedDefBlock)
+        evaDefBlock (eval lstBackTicked_passedDefBlock) ;the defblock after ~ are evaluated
+        ;e (eval evaDefBlock)
+        ;_ (q/assumedTrue (symbol? fname))
+        _ (q/assumedTrue [(map? evaDefBlock) "the defBlock must be a map"])
+        aliases (second (find evaDefBlock :aliases)) ;can be nil
+        ]
+    ;(q/when-debug (clojure.pprint/pprint (list ":aliases=" aliases)))
+    ;(q/when-debug (clojure.pprint/pprint (list "evaDefBlock=" evaDefBlock)))
+    (q/when-debug (q/show-lexical-env))
+    ; evaDefBlock == `'~evaDefBlock = `~*fxn_defBlock_symbol*
+    `(defn ~evaluated_fname
 "
 this function takes only one parameter: a map with the parameters;
 or no parameters at all.
@@ -137,13 +135,14 @@
                                 "pass 0 or 1 params and this must be a map with all the params,
 for function `" '~fname "` you passed `" allParamsInAMap# "`"])]}
        (let [
-             ~*fxn_defBlock_symbol* evaDefBlock#
+             ~*fxn_defBlock_symbol* '~evaDefBlock
              ~*fxn_defBlockRaw_symbol* '~passedDefBlock
-             ~*fxn_defBlock_Aliases* aliases#
+             ~*fxn_defBlock_Aliases* '~aliases
              ;~'fxn_evalled ~e
              ]
          ;(clojure.pprint/pprint (list ~'*fxn_defBlockRaw_symbol* ~*fxn_defBlockRaw_symbol*))
          ;(clojure.pprint/pprint (list ~'*fxn_defBlock_symbol* ~*fxn_defBlock_symbol*));symbol and its value
+         ;(clojure.pprint/pprint  '~aliases)
          ;(clojure.pprint/pprint (list ~'*fxn_defBlock_Aliases* ~*fxn_defBlock_Aliases*))
          ~@codeblocks
          #_(= (~(:c x) ~(:d x))


can get result from an inserted row now

can get result from an inserted row now

This is where an insert uses an autogenerated ID, and you need access to
the ID after inserting the row. In Postgres this is denoted by the
returning statement

--- src/webapp/framework/server/db_helper.clj
+++ src/webapp/framework/server/db_helper.clj
@@ -63,7 +63,7 @@
          ;(println "SQL from client: " sql-in)
          ;
            (cond
-             (.startsWith lower "select") (do (comment println "SELECT") (into [] (map   (fn [r] (to-lower-case-keys r));
+             (or (.startsWith lower "select") (.contains lower "returning")) (do (comment println "SELECT") (into [] (map   (fn [r] (to-lower-case-keys r));
                                                                                (korma.core/exec-raw [sql-in params] :results))))
              :else (do (comment println "INSERT") (korma.core/exec-raw [sql-in params]) [])
              ; []


Remove debug printlns

Remove debug printlns

Need to clear the output to understand what is going on

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -279,7 +279,7 @@
         sql-to-create-update-trigger (str "CREATE TRIGGER trigger_afterUpdate AFTER UPDATE ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterUpdate();")
         sql-to-create-delete-trigger (str "CREATE TRIGGER trigger_afterDelete AFTER DELETE ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterDelete();")
         ]
-        (println "Coils trigger table exists: " coils-trigger-exists)
+        ;(println "Coils trigger table exists: " coils-trigger-exists)

         (if (not coils-trigger-exists )
@@ -480,7 +480,7 @@
 "
           ]

-        (println "Coils trigger function exists: " coils-trigger-fn-exists)
+        ;(println "Coils trigger function exists: " coils-trigger-fn-exists)
         (if (not coils-trigger-fn-exists )
             (korma.core/exec-raw   [sql-to-create-trigger-fn []]   [])
             nil
@@ -525,7 +525,7 @@
 "
           ]

-        (println "Coils trigger function exists: " coils-trigger-fn-exists)
+        ;(println "Coils trigger function exists: " coils-trigger-fn-exists)
         (if (not coils-trigger-fn-exists )
             (korma.core/exec-raw   [sql-to-create-trigger-fn []]   [])
             nil
@@ -570,7 +570,7 @@
 "
           ]

-        (println "Coils trigger function exists: " coils-trigger-fn-exists)
+        ;(println "Coils trigger function exists: " coils-trigger-fn-exists)
         (if (not coils-trigger-fn-exists )
             (korma.core/exec-raw   [sql-to-create-trigger-fn []]   [])
             nil
@@ -596,7 +596,7 @@

 (defn do-real [& {:keys [:table-name]}]
-  (println "table name: " table-name)
+  ;(println "table name: " table-name)

   ( make-log-table-insert-trigger-function)
@@ -694,9 +694,9 @@
         query-time         (quot (System/currentTimeMillis) 1000)
         ]
     (do
-      (println (str "    " ))
-      (println (str "    update-query-in-cache" ))
-      (println (str "    " query))
+      ;(println (str "    " ))
+      ;(println (str "    update-query-in-cache" ))
+      ;(println (str "    " query))

       (if (not existing-query)
         (swap! server-side-cached-queries assoc  query (atom {:clients  (atom #{})})))
@@ -712,16 +712,16 @@
         (swap! the-query assoc  :count         record-count)
         (swap! the-query assoc  :timestamp     query-time)

-        (println (str "    clients: " @clients-atom))
+        ;(println (str "    clients: " @clients-atom))
         (doall (for [client @clients-atom]
                  (do
-                   (println (str "    Client: " client))
+                   ;(println (str "    Client: " client))
                    (let [the-client       (get @server-side-realtime-clients  client)
                          response-atom    (:update-request @the-client)
                          ]
                      (if (not response-atom) (swap! the-query assoc  :update-request (atom {})))
                      (swap! (:update-request @the-client) assoc-in [:queries query] {:timestamp query-time})
-                     (println (str "    responses: " (if response-atom @response-atom)))
+                     ;(println (str "    responses: " (if response-atom @response-atom)))

                      ;                   (swap! (:update-request @the-query) assoc  1 2)
                      ))))
@@ -763,10 +763,10 @@
       (if (not this-query)
         (swap! client-queries   assoc  query {}))

-      (println "")
-      (println "  add-client-to-query")
-      (println (str "    " @server-side-realtime-clients))
-      (println "")
+      ;(println "")
+      ;(println "  add-client-to-query")
+      ;(println (str "    " @server-side-realtime-clients))
+      ;(println "")

       )))

@@ -788,42 +788,42 @@
 ; ----------------------------------------------------------------
 (defn process-log-entry [ realtime-log-entry ]
   (do
-    (println (str "**** Processing realtime record change: "))
-    (println (str "      "  "realtime-log-entry"))
-    (println (str "      "  realtime-log-entry))
-    (println (str "      "))
-    (println (str "      "  "@server-side-cached-queries"))
-    (println (str "      "  @server-side-cached-queries))
-    (println (str "      "))
-    (println (str "Count: " (-> @server-side-cached-queries keys count str)))
+    ;(println (str "**** Processing realtime record change: "))
+    ;(println (str "      "  "realtime-log-entry"))
+    ;(println (str "      "  realtime-log-entry))
+    ;(println (str "      "))
+    ;(println (str "      "  "@server-side-cached-queries"))
+    ;(println (str "      "  @server-side-cached-queries))
+    ;(println (str "      "))
+    ;(println (str "Count: " (-> @server-side-cached-queries keys count str)))

     (let [queries (keys @server-side-cached-queries)]
       (doall (for [query queries]
                (do
                  (if (= (get query :db-table) (get realtime-log-entry :record_table_name))
                    (do
-                     (println (str "    "))
-                     (println (str "    " "Query"))
-                     (println (str "    " query))
-                     (println (str "    "))
-
-                     (println (str "    " "Before"))
-                     (println (str "    " @(get @server-side-cached-queries query)))
-                     (println (str "    "))
-                     (println (str "    " @(:clients @(get @server-side-cached-queries query))))
+                     ;(println (str "    "))
+                     ;(println (str "    " "Query"))
+                     ;(println (str "    " query))
+                     ;(println (str "    "))
+
+                     ;(println (str "    " "Before"))
+                     ;(println (str "    " @(get @server-side-cached-queries query)))
+                     ;(println (str "    "))
+                     ;(println (str "    " @(:clients @(get @server-side-cached-queries query))))

                      (update-query-in-cache  query)

-                     (println (str "    "))
-                     (println (str "    " "After"))
-                     (println (str "    " @(get @server-side-cached-queries query)))
-                     (println (str "    "))
-                     (println (str "    " @(:clients @(get @server-side-cached-queries query))))
-                     (println (str "    "))
-
-                     (println (str "clients:"))
-                     (println (str "    " (keys @server-side-realtime-clients)))
-                     (println (str "    "))
+                     ;(println (str "    "))
+                     ;(println (str "    " "After"))
+                     ;(println (str "    " @(get @server-side-cached-queries query)))
+                     ;(println (str "    "))
+                     ;(println (str "    " @(:clients @(get @server-side-cached-queries query))))
+                     ;(println (str "    "))
+
+                     ;(println (str "clients:"))
+                     ;(println (str "    " (keys @server-side-realtime-clients)))
+                     ;(println (str "    "))
                      ))))))))

@@ -879,11 +879,11 @@
                                      data-session-id
                                      ]}]

-  (println "************************************************************************************")
-  (println " debug stuff")
-  (println " ")
-  (println "!get-query-results-v2*   REALTIME = " realtime)
-  (println (str "!get-query-results-v2: "
+  ;(println "************************************************************************************")
+  ;(println " debug stuff")
+  ;(println " ")
+  ;(println "!get-query-results-v2*   REALTIME = " realtime)
+  (comment println (str "!get-query-results-v2: "
                 db-table
                 where " "
                 start  " "
@@ -893,8 +893,8 @@
                 data-session-id " "
                 realtime " "
                 ))
-  (println "************************************************************************************")
-  (println "     data-session-id: " data-session-id)
+  ;(println "************************************************************************************")
+  ;(println "     data-session-id: " data-session-id)

@@ -926,11 +926,11 @@

      (do-real   :table-name db-table)

-     (println "-------------------------------")
+     ;(println "-------------------------------")
      ;(println "SERVER @server-side-cached-queries     " @server-side-cached-queries)
      ;(println query-key)
-     (println @(get @server-side-cached-queries  query-key))
-     (println "-------------------------------")
+     ;(println @(get @server-side-cached-queries  query-key))
+     ;(println "-------------------------------")

      (let [result   @(get @server-side-cached-queries  query-key)]
        {
@@ -1085,11 +1085,11 @@
   (let [client-data-atom    (if server-side-realtime-clients  (get @server-side-realtime-clients  client-data-session-id))
         response-atom       (if client-data-atom  client-data-atom )
         ]
-    (println (str "      " ))
-    (println "SERVER: check-for-server-updates for client: " client-data-session-id)
+    ;(println (str "      " ))
+    ;(println "SERVER: check-for-server-updates for client: " client-data-session-id)
     ;(println (str "      " (keys @server-side-realtime-clients)))
-    (println (str "      " (if client-data-atom  @client-data-atom)))
-    (println (str "      response: " (if response-atom  @(get @response-atom :update-request )  )))
+    ;(println (str "      " (if client-data-atom  @client-data-atom)))
+    ;(println (str "      response: " (if response-atom  @(get @response-atom :update-request )  )))
     (if response-atom  @(get @response-atom :update-request )  {})))


AW & FM | 3 | future facted test that shuldn't be running yet

--- test/stonecutter/test/view/profile.clj
+++ test/stonecutter/test/view/profile.clj
@@ -28,7 +28,7 @@
       (let [page (-> (th/create-request) profile)]
         page => (th/has-attr? [:.clj--change-password__link] :href (r/path :show-change-password-form))))

-(fact "change profile details link should go to correct endpoint"
+(future-fact "change profile details link should go to correct endpoint"
       (let [page (-> (th/create-request) profile)]
         page => (th/has-attr? [:.clj--change-profile-details__link] :href (r/path :show-change-profile-forms))))


Split into strings on letters instead of chars

--- src/yetibot/core/commands/collections.clj
+++ src/yetibot/core/commands/collections.clj
@@ -202,7 +202,7 @@
   "letters <string> # turn <string> into a sequence of individual letters"
   {:yb/cat #{:util}}
   [{args :args}]
-  (seq args))
+  (map str (seq args)))

 (cmd-hook ["letters" #"^letters$"]
           _ letters)


Made code a little more succinct.

Made code a little more succinct.

--- test/blutwurst/tuple_formatter_test.clj
+++ test/blutwurst/tuple_formatter_test.clj
@@ -17,7 +17,8 @@
 (deftest sql-formatter-test
    (testing "Basic SQL generation with integer-only values."
      (let [spec {:format :sql}
-           rows '({:table {:name "Example" :schema "foo" :columns ({:name "A" :type "INTEGER"} {:name "B" :type "INTEGER"})}
+           table {:name "Example" :schema "foo" :columns '({:name "A" :type "INTEGER"} {:name "B" :type "INTEGER"})}
+           rows `({:table ~table
                    :tuples ({:A 1 :B 2})})]
              (is (= '({:table {:name "Example" :schema "foo" :columns ({:name "A" :type "INTEGER"} {:name "B" :type "INTEGER"})}
                       :tuples ["INSERT INTO \"foo\".\"Example\" (\"A\",\"B\") VALUES (1,2);\n"]})
@@ -26,7 +27,8 @@

    (testing "SQL generation quotes and escapes string values."
      (let [spec {:format :sql}
-           rows '({:table {:name "Example" :schema "foo" :columns ({:name "A" :type "INTEGER"} {:name "B" :type "VARCHAR"})}
+           table {:name "Example" :schema "foo" :columns '({:name "A" :type "INTEGER"} {:name "B" :type "VARCHAR"})}
+           rows `({:table ~table
                    :tuples ({:A 1 :B  "Then O'Kelly came in with the \t hatchett."})})]
              (is (= '({:table {:name "Example" :schema "foo" :columns ({:name "A" :type "INTEGER"} {:name "B" :type "VARCHAR"})}
                       :tuples ["INSERT INTO \"foo\".\"Example\" (\"A\",\"B\") VALUES (1,'Then O''Kelly came in with the \t hatchett.');\n"]})


Move trial-division test into helper function in nth-prime

--- exercises/nth-prime/src/example.clj
+++ exercises/nth-prime/src/example.clj
@@ -10,11 +10,16 @@
   [number divisor]
   (zero? (mod number divisor)))

+(defn- prime-by-trial-division?
+  "Simple trial division prime check."
+  [number]
+  (empty? (for [n (range 3 (inc (sqrt number)) 2) :when (divides? number n)] n)))
+
 (defn prime? [number]
   (cond
     (= 2 number) true
     (even? number) false
-    :else (empty? (for [n (range 3 (inc (sqrt number)) 2) :when (divides? number n)] n))))
+    :else (prime-by-trial-division? number)))

 (defn next-prime [start]
   (loop [n (inc start)]


Add back midje cascalog deps.

Add back midje cascalog deps.

--- test/clj/forma/hadoop/jobs/cdm_test.clj
+++ test/clj/forma/hadoop/jobs/cdm_test.clj
@@ -2,7 +2,9 @@
   "This namespace defines Midge tests for the forma.hadoop.jobs.cdm
 namespace."
   (:use [midje sweet]
-        forma.hadoop.jobs.cdm))
+        forma.hadoop.jobs.cdm
+        cascalog.api
+        midje.cascalog))

 ;; TODO: Fix this. See: https://github.com/reddmetrics/forma-clj/issues/160
 ;; (tabular


Add get-tyrant-application-config action

--- src/maestro/actions.clj
+++ src/maestro/actions.clj
@@ -16,6 +16,7 @@
    :maestro.messages.data/ensure-tyrant-hash
    :maestro.messages.data/verify-tyrant-hash
    :maestro.messages.data/get-tyrant-application-properties
+   :maestro.messages.data/get-tyrant-application-config
    :maestro.messages.data/get-tyrant-deployment-params
    :maestro.messages.data/validate-deployment-params
    :maestro.messages.data/get-tyrant-launch-data


Fix reflection error

Fix reflection error

--- src/zprint/redef.cljc
+++ src/zprint/redef.cljc
@@ -32,8 +32,8 @@
        zlock-enable is true, because graalvm will compile with the
        following code, but will throw an exception since it is
        unable to find the unlock method."
-       [^ReentrantLock x & body]
-       `(let [lockee# ~x]
+       [x & body]
+       `(let [^ReentrantLock lockee# ~x]
           (try (if @zlock-enable (. lockee# (lock)))
                ~@body
                (if @zlock-enable (. lockee# (unlock)))


apply anti-forgery only to api endpoints to make okta post requests work (part 2)

--- src/clj/conference_rating/handler.clj
+++ src/clj/conference_rating/handler.clj
@@ -121,7 +121,6 @@
 (defn ring-settings [ssl-redirect-disabled]
   (-> secure-api-defaults
       (assoc-in [:security :ssl-redirect] (not ssl-redirect-disabled))
-      (assoc-in [:security :anti-forgery] (not (env :dev)))
       (assoc-in [:security :frame-options] :deny)
       (assoc :proxy true)))


Fix matching

Fix matching

--- src/clj/decktouch/mtg_card_master.clj
+++ src/clj/decktouch/mtg_card_master.clj
@@ -8,7 +8,7 @@
 (defn match
   "Returns true if query is a substring in string"
   [query string]
-  (some? (re-matches (re-pattern (str "(?i)" query ".*"))
+  (some? (re-matches (re-pattern (str "(?i)" ".*" query ".*"))
                     string)))

 (defn find-cards-matching-query-in-names [names query]


burst fix

burst fix

--- src/clj/neb/durability/serv/trunk.clj
+++ src/clj/neb/durability/serv/trunk.clj
@@ -53,7 +53,8 @@
   (let [^InputStream reader (io/input-stream file-path)
         seg-size (read-int-from-stream reader)
         thread-size (min (* 15 (count (ds/get-server-list @ds/node-server-group))) (cp/ncpus))
-        recover-seg-pool (cp/threadpool (min thread-size 50) :name "Recover-Seg")]
+        recover-seg-pool (cp/threadpool thread-size :name "Recover-Seg")
+        recover-seg-semaphore (Semaphore. (int thread-size))]
     (try
       (while (> (.available reader) 0)
         (let [seg-append-header (read-int-from-stream reader)
@@ -62,6 +63,7 @@
           (cp/future
             recover-seg-pool
             (try
+              (.acquire recover-seg-semaphore)
               (loop [pointer 0]
                 (when-not (>= pointer seg-append-header)
                   (let [{:keys [partition hash cell-length cell-type version]} (read-header-bytes seg-mem pointer)]
@@ -74,7 +76,8 @@
                       (do (assert (= cell-type 2))
                           (recur (+ pointer cell-length)))))))
               (finally
-                (dealloc seg-mem))))))
+                (dealloc seg-mem)
+                (.release recover-seg-semaphore))))))
       (catch Exception ex
         (clojure.stacktrace/print-cause-trace ex))
       (finally


Provide way for clients to specify if transparent pixels should be pasted into document

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -156,7 +156,7 @@
 ;; Pro: Learned a bit about clojure list comprehensions
 ;; Con: This file is turning into something like a little monster

-(defn assoc-map [img-vector indices-to-colors]
+(defn assoc-map [img-vector indices-to-colors paste-transparent-pixels]
   (loop [img img-vector
          keys-to-assoc (vec (keys indices-to-colors))]
     (if (empty? keys-to-assoc)
@@ -164,7 +164,9 @@
       (let [key-to-assoc (peek keys-to-assoc)
             keys-to-assoc (pop keys-to-assoc)
             color (indices-to-colors key-to-assoc)
-            img (if (not (= key-to-assoc :clipped))
+            img (if (and
+                      (not (= key-to-assoc :clipped))
+                      (or (not= color "#T") paste-transparent-pixels))
                   (assoc img key-to-assoc color)
                   img)]
         (recur img keys-to-assoc)))))
@@ -180,7 +182,7 @@
      :image-data image-data}))

-(defn paste-image [app owner doc-x doc-y sub-image]
+(defn paste-image [app owner doc-x doc-y sub-image paste-transparent-pixels]
   (let [main-image (canvas/get-current-pixels @app)
         main-image-width (get-in @app [:main-app :canvas-width])
         main-image-height (get-in @app [:main-app :canvas-height])
@@ -194,7 +196,7 @@
                            :clipped)])
         flat-indices (vec (flatten (vec indices)))
         indices-to-colors (zipmap flat-indices (:image-data sub-image))
-        new-image (assoc-map main-image indices-to-colors)]
+        new-image (assoc-map main-image indices-to-colors paste-transparent-pixels)]
     (canvas/set-current-pixels app (vec new-image))))

@@ -357,7 +359,7 @@
               blit-x (- doc-x offset-x)
               blit-y (- doc-y offset-y)]
           (clear-preview-canvas)
-          (set! (.-fillStyle preview-context) (get-in @app [:tools :paint-color]))
+          (set! (.-fillStyle preview-context) (get-in @app [:main-app :background-color]))
           (when (not selection-was-pasted)
             (.fillRect preview-context
                (* x1 zoom-factor)
@@ -423,8 +425,8 @@
               selection-was-pasted (om/get-state owner :selection-was-pasted)
               backfill (create-sub-image-for-rect (om/get-state owner :selection))]
         (when (not selection-was-pasted)
-          (paste-image app owner x1 y1 backfill))
-        (paste-image app owner paste-x paste-y (om/get-state owner :selection-image)))
+          (paste-image app owner x1 y1 backfill true))
+        (paste-image app owner paste-x paste-y (om/get-state owner :selection-image) false))
         (clear-selection-state owner)
         (om/transact! app
           [:main-app :undo-history]


menu hover/active redesign

menu hover/active redesign

--- src/cljs/swarmpit/component/menu.cljs
+++ src/cljs/swarmpit/component/menu.cljs
@@ -112,19 +112,20 @@

 (rum/defc drawer-item < rum/static [name icon handler domain selected?]
   (comp/list-item
-    (merge {:button    true
-            :component "a"
-            :href      (routes/path-for-frontend handler)
-            :dense     true
-            :className "Swarmpit-drawer-item"
-            :key       (str "drawer-item-" name)
-            :onClick   (fn []
-                         (state/update-value [:mobileOpened] false state/layout-cursor)
-                         (url/dispatch! (routes/path-for-frontend handler)))}
+    (merge {:button        true
+            :component     "a"
+            :href          (routes/path-for-frontend handler)
+            :dense         true
+            :disableRipple true
+            :className     "Swarmpit-drawer-item"
+            :key           (str "drawer-item-" name)
+            :onClick       (fn []
+                             (state/update-value [:mobileOpened] false state/layout-cursor)
+                             (url/dispatch! (routes/path-for-frontend handler)))}
            (when selected?
              {:className "Swarmpit-drawer-item-selected"})
            (when (= :index domain)
-             {:style {:marginTop "15px"}}))
+             {:style {:marginTop "1rem"}}))
     (comp/list-item-icon
       (merge {:color "primary"
               :key   (str "drawer-item-icon-" name)}


adding control to ui

adding control to ui

--- src/cljs/triangulator/components.cljs
+++ src/cljs/triangulator/components.cljs
@@ -49,13 +49,23 @@
         (dom/span nil
                   (str "[" x  " " y "] "))))))

-(defn item-detail [app owner]
+(defn item-detail [app owner opts]
   (reify
     om/IRender
     (render [_]
-      (apply dom/div #js {:className "item-detail"}
-             "vertices "
-             (om/build-all point-detail (:triangle app))))))
+      (let [points (:triangle app)
+            control-chan (:control-chan opts)
+            _ (prn points)]
+        (when points
+          (apply dom/div #js {:className "item-detail"}
+                 (dom/div #js {:className "button"
+                               :onClick #(do
+                                           (om/update! app :triangle nil)
+                                           (put! control-chan :triangle))}
+                          "new triangle")
+                 (dom/div #js {:onClick #(println "redraw triangle")} "redraw triangle")
+                 "vertices "
+                 (om/build-all point-detail points)))))))

 (defn item-props [props owner]
   (reify
@@ -77,12 +87,14 @@
       (let [_ (println "mounting item-controller")
             event-chan (:event-chan opts)
             control-chan (:control-chan opts)]
+        (go
+          ;; wait for item from control-chan
+          (let [item (<! control-chan)
+                _ (println "recieved from control-cah: " item)]

-        (go (loop [type :none state {:step 0}]
-
-              (let [[event port] (alts! [event-chan control-chan])]
-                (if (= port control-chan)
-                  (recur event {:step 0})
+            (loop [type item]
+              (loop [state {:step 0}]
+                (let [event (<! event-chan)]
                   (let [new-state (h/triangle-transitioner event state)]
                     (if (= (:step new-state) 3)
                       (let [{:keys [p1 p2 p3]} new-state]
@@ -90,7 +102,14 @@
                         (om/update! app :triangle [p1 p2 p3]))
                       (do
                         (om/set-state! owner new-state)
-                        (recur type new-state))))))))))
+                        (recur new-state))))))
+              ;; wait for item form control-chan, again
+              (let [_ (println "waiting for next item from control-chan")
+                    item (<! control-chan)
+                    _ (println "recieved from control-cah: " item)]
+                (recur item)))))
+        ;; start off with :triangle
+        (go (>! control-chan :triangle))))

     om/IRenderState
     (render-state [_ state]
@@ -136,8 +155,8 @@
         (dom/div #js {:className "definition"}
                  (dom/h3 nil (first (item d/definition-text)))
                  (dom/p nil (second (item d/definition-text)))
-                 (om/build item-detail app)
-                 (om/build item-props (get-in app [:prop-map (:item app)]))
+                 (om/build item-detail app {:opts opts})
+                 ;; (om/build item-props (get-in app [:prop-map (:item app)]))
                  )))))

 (om/root


Update driver.clj

Update driver.clj

--- src/metabase/driver.clj
+++ src/metabase/driver.clj
@@ -87,7 +87,7 @@

   (analyze-table ^java.util.Map [this, ^TableInstance table, ^java.util.Set new-field-ids]
     "*OPTIONAL*. Return a map containing information that provides optional analysis values for TABLE.
-     Output should match `analyze-table-schema`.")
+     Output should match the `AnalyzeTable` schema.")

   (can-connect? ^Boolean [this, ^Map details-map]
     "Check whether we can connect to a `Database` with DETAILS-MAP and perform a simple query. For example, a SQL database might
@@ -103,16 +103,16 @@
   (describe-database ^java.util.Map [this, ^DatabaseInstance database]
     "Return a map containing information that describes all of the schema settings in DATABASE, most notably a set of tables.
      It is expected that this function will be peformant and avoid draining meaningful resources of the database.
-     Results should match `describe-database-schema`.")
+     Results should match the `DescribeDatabase` schema.")

   (describe-table ^java.util.Map [this, ^TableInstance table]
     "Return a map containing information that describes the physical schema of TABLE.
      It is expected that this function will be peformant and avoid draining meaningful resources of the database.
-     Results should match `describe-table-schema`.")
+     Results should match the `DescribeTable` schema.")

   (describe-table-fks ^java.util.Set [this, ^TableInstance table]
     "*OPTIONAL*, BUT REQUIRED FOR DRIVERS THAT SUPPORT `:foreign-keys`*
-     Results should match `describe-table-fks-schema`.")
+     Results should match the `DescribeTableFKs` schema.")

   (details-fields ^clojure.lang.Sequential [this]
     "A vector of maps that contain information about connection properties that should


Define beta terms modal

Define beta terms modal

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -5,6 +5,7 @@
             [frontend.components.pieces.button :as button]
             [frontend.components.pieces.card :as card]
             [frontend.components.pieces.icon :as icon]
+            [frontend.components.pieces.modal :as modal]
             [frontend.components.pieces.table :as table]
             [frontend.components.project.common :as project]
             [frontend.components.svg :refer [svg]]
@@ -19,7 +20,7 @@
             [frontend.utils.github :as gh-utils]
             [frontend.utils.seq :refer [select-in]]
             [om.core :as om :include-macros true])
-  (:require-macros [frontend.utils :refer [defrender html]]))
+  (:require-macros [frontend.utils :refer [defrender html component element]]))

 (defn active-class-if-active [current-subpage subpage-link]
   (if (= current-subpage subpage-link)
@@ -199,6 +200,36 @@

 (defn set-beta-program-preference! [owner pref]
   (raise! owner [:preferences-updated {state/user-in-beta-key pref}]))
+
+(defrender beta-terms-modal [{:keys [close-fn show-modal?]} owner]
+  (component
+   (html
+    [:div
+     (when show-modal?
+       (modal/modal-dialog {:title "Join Beta Program"
+                            :body (element :body
+                                           (html
+                                            [:div
+                                             [:h1 "Beta Terms"]
+                                             [:p
+                                              "Our beta program is a way to engage with our most
+               thoughtful and dedicated users. We want to build the
+               best features with your help. To that end, in joining
+               the beta program you should be comfortable with these
+               expectations:"]
+                                             [:ul
+                                              [:li "You’ll find out about new features through e-mail and in-app messages"]
+                                              [:li "Please give us feedback about new features when we release them"]
+                                              [:li "Keep the private beta, private. Please no tweets, blogs, or other public
+                    posting, but we do encourage you to talk with your
+                    coworkers!"]]]))
+                            :actions [(button/button {:on-click close-fn} "Cancel")
+                                      (button/button
+                                       {:on-click #(do
+                                                     (set-beta-program-preference! owner true)
+                                                     ((om/get-shared owner :track-event) {:event-type :beta-accept-terms-clicked})
+                                                     (close-fn))}
+                                       "Accept")]}))])))

 (defn join-beta-program [app owner]
   (reify


Add proper modal for creating a new token

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -65,14 +65,34 @@

 (defn api-tokens [app owner]
   (reify
-    om/IRender
-    (render [_]
-      (let [tokens        (get-in app state/user-tokens-path)
-            create-token! #(raise! owner [:api-token-creation-attempted {:label %}])
+    om/IInitState
+    (init-state [_]
+      {:show-modal? false})
+    om/IRenderState
+    (render-state [_ {:keys [show-modal?]}]
+      (let [close-fn #(om/set-state! owner :show-modal? false)
+            tokens        (get-in app state/user-tokens-path)
+            create-token! #(raise! owner [:api-token-creation-attempted {:label %}] close-fn)
             new-user-token (get-in app state/new-user-token-path)]
         (html
          [:div.account-settings-subpage
           [:legend "Personal API Tokens"]
+          (when show-modal?
+            (modal/modal-dialog {:title "Add an API token"
+                                 :body (html
+                                         (form/form {}
+                                                    (om/build form/text-field {:label "Token name"
+                                                                               :value (str new-user-token)
+                                                                               :on-change #(utils/edit-input owner state/new-user-token-path %)})))
+                                 :close-fn close-fn
+                                 :actions [(button/button {:on-click close-fn} "Cancel")
+                                           (button/managed-button
+                                             {:failed-text  "Failed"
+                                              :success-text "Added"
+                                              :loading-text "Adding..."
+                                              :on-click #(create-token! new-user-token)
+                                              :kind :primary}
+                                             "Add API Token")]}))
           (card/titled {:title "API Tokens"
                         :action (button/button {:on-click #(om/set-state! owner :show-modal? true)
                                                 :kind :primary
@@ -84,7 +104,7 @@
                                    :success-text "Created"
                                    :kind :primary
                                    :size :medium
-                                   :on-click #(create-token! new-user-token)}
+                                   :on-click #(om/set-state! owner :show-modal? true)}
                                   "Create New Token")}
             (html
               [:div
@@ -93,11 +113,6 @@
                  "Tokens you have generated that can be used to access the CircleCI API."
                  [:br]
                  "Apps using these tokens can act as you and have full read- and write-permissions!"]
-
-                 ;; FIXME: Use modal pattern like SSH keys to add and remove tokens
-                 (om/build form/text-field {:label "Token name"
-                                            :value (str new-user-token)
-                                            :on-change #(utils/edit-input owner state/new-user-token-path %)})
                 [:div.api-item
                  (when (seq tokens)
                    (om/build table/table


Don't execute dimple.js code in IE8 or earlier.

IE8 and dimple.js don't get on at all. There *may* be some alternatives
for d3.

This means that older browsers currently don't have any charts.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -4,6 +4,7 @@
      [om.core :as om :include-macros true]
      [om.dom :as dom :include-macros true]
      [cljs.core.async :refer [<! >! chan put! sliding-buffer close! pipe map< filter< mult tap map>]]
+     [goog.userAgent :as agent]
      [ajax.core :refer (GET POST)]
      [clojure.string :as str]
      [kixi.hecuba.navigation :as nav]
@@ -657,13 +658,18 @@
                   (title-for devices)]]]
            (om/build sensors-table data {:opts {:histkey :sensors
                                                 :path    :readings}})
-           [:div {:id "chart-div"}
-            [:div {:id "date-picker"}
-             (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
-            (om/build chart-feedback-box (get-in data [:chart :message]))
-            (om/build chart-summary (:chart data))
-            [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
-             (om/build chart/chart-figure (:chart data))]]]])))))
+           (if (or (not agent/IE)
+                   (agent/isVersionOrHigher 9))
+             [:div {:id "chart-div"}
+              [:div {:id "date-picker"}
+               (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
+              (om/build chart-feedback-box (get-in data [:chart :message]))
+              (om/build chart-summary (:chart data))
+              [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
+               (om/build chart/chart-figure (:chart data))]]
+             [:div.col-md-12.text-center
+              [:p.lead {:style {:padding-top 30}}
+               "Charting in Internet Explorer version " agent/VERSION " coming soon."]])]])))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Main View


Remove trailing slash.

Remove trailing slash.

--- project/scrape-trs/src/scrape_trs/cascade_climbers/core.clj
+++ project/scrape-trs/src/scrape_trs/cascade_climbers/core.clj
@@ -5,7 +5,7 @@
              [extract-trip-report :refer [extract-trip-report]]])
   (:import scrape_trs.protocol.ScrapeTripReport))

-(def base-url "http://cascadeclimbers.com/")
+(def base-url "http://cascadeclimbers.com")

 (deftype CCScrapeTripReport []


typo and formatting

typo and formatting

--- src/node/game/core.cljs
+++ src/node/game/core.cljs
@@ -3,9 +3,9 @@

 (def game-states (atom {}))

-(defn say [state side args]
-  (let [user (or (:user args) (get-in @state [side :user]))]
-    (swap! state update-in [:log] #(conj % {:user user :text (:text args)}))))
+(defn say [state side {:keys [user text]}]
+  (let [author (or user (get-in @state [side :user]))]
+    (swap! state update-in [:log] #(conj % {:user author :text text}))))

 (defn system-msg [state side text]
   (let [username (get-in @state [side :user :username])]
@@ -62,8 +62,8 @@
         runner (some #(when (= (:side %) "Runner") %) players)
         corp-deck (create-deck (:deck corp))
         runner-deck (create-deck (:deck runner))
-        corp-identity (or (get-in corp [:deck :identity]) {:side "Runner"})
-        runner-identity (or (get-in runner [:deck :identity]) {:side "Corp"})
+        corp-identity (or (get-in corp [:deck :identity]) {:side "Corp"})
+        runner-identity (or (get-in runner [:deck :identity]) {:side "Runner"})
         state (atom {:gameid gameid
                      :log []
                      :corp {:user (:user corp)
@@ -123,7 +123,7 @@
   (when-let [init-fn (get-in game.cards/cards [(get-in @state [side :identity :title])])]
     ((do! init-fn) state side nil))
   (swap! state assoc-in [side :keep] true)
-  (system-msg state side  "takes a mulligan."))
+  (system-msg state side "takes a mulligan."))

 (defn keep-hand [state side args]
   (swap! state assoc-in [side :keep] true)


readded bullet list 'new-bullet'

readded bullet list 'new-bullet'

--- src/noteServer/html.clj
+++ src/noteServer/html.clj
@@ -2,6 +2,7 @@
   (:require [hiccup.core :refer :all]
             [hiccup.page :refer :all]
             [hiccup.def :refer [defhtml]]
+            [hiccup.form :refer :all]
             [noteServer.security :as security])
   )

@@ -22,22 +23,27 @@
                   [:div {:class (str type "-module") :data-id module-id :data-type type :role "module"}
                    (println type)
                    (case type
-                         "list"
-                         [:ul.checkbox-list {:data-note-id note-id :module-id module-id}
-                          (map (fn [li]
-                                 (let [d (:done li)
-                                       item-id (:id li)
-                                       text (:text li)]
-                                   [:li {:class (if d "checked" "")
-                                         :data-id item-id}
-                                    text]))
-                               data)]
-                         "image"
-                         [:img {:src (:image_src data) :title (:title_text data)}]
-                         "header"
-                         [:h1 (:text data)]
-                         "text"
-                         [:p (:text data)])]))
+                     "list"
+                     [:ul.checkbox-list {:data-note-id note-id :module-id module-id}
+                      (map (fn [li]
+                             (let [d (:done li)
+                                   item-id (:id li)
+                                   text (:text li)]
+                               [:li {:class (if d "checked" "")
+                                     :data-id item-id}
+                                text]))
+                           data)
+                      [:li.new-item
+                       [:form {:name "new-bullet"}
+                        (text-field {:class "seamless" :placeholder "New bullet"} "text")
+                        (submit-button {:class "seamless"} "→")
+                        (hidden-field {:data-module-id module-id :data-note-id note-id} "list-id")]]]
+                     "image"
+                     [:img {:src (:image_src data) :title (:title_text data)}]
+                     "header"
+                     [:h1 (:text data)]
+                     "text"
+                     [:p (:text data)])]))
               modules)

          [:span.module-divide]


Add digest sample.

Add digest sample.

--- src/oc/email/mailer.clj
+++ src/oc/email/mailer.clj
@@ -246,6 +246,9 @@
                                  :html (slurp inline-html-file)})))
   (send-email-from-file email-setup "./hiccup.html")

+  (def digest-request (clojure.walk/keywordize-keys (json/decode (slurp "./opt/samples/digests/apple.json"))))
+  (mailer/send-digest (assoc digest-request :email "change@me.com"))
+
   (def notification-request (clojure.walk/keywordize-keys (json/decode (slurp "./opt/samples/notifications/post-mention.json"))))
   (mailer/send-notification (assoc notification-request :to "change@me.com"))


Writes in a transaction.

Writes in a transaction.

--- src/onyx/plugin/sql.clj
+++ src/onyx/plugin/sql.clj
@@ -90,8 +90,10 @@

 (defmethod l-ext/write-batch [:output :sql]
   [{:keys [onyx.core/compressed onyx.core/task-map sql/pool] :as pipeline}]
-  (doseq [segment compressed]
-    (doseq [row (:rows segment)]
-      (jdbc/insert! pool (:sql/table task-map) row)))
+  (jdbc/with-db-transaction
+    [conn pool]
+    (doseq [segment compressed]
+      (doseq [row (:rows segment)]
+        (jdbc/insert! conn (:sql/table task-map) row))))
   {:onyx.core/written? true})


Don't reset score until '1' pressed

Don't reset score until '1' pressed

--- desktop/src-common/ds3/main_screen.clj
+++ desktop/src-common/ds3/main_screen.clj
@@ -103,8 +103,7 @@
                     (update! screen :wave-respawning? false :formation-expand? false :ticks 0 :can-attack? true :p1-rank rank :wave (+ wave 1))
                     (conj entities (enemy/create-enemies screen)))
       :post-game-over (do
-                        (update! screen :p1-level-score 0
-                                 :game-state :attract-mode)
+                        (update! screen :game-state :attract-mode)
                         entities)
       ;default pulls a function/args map and executes it - see mini enemies
       (let [to-do ((:id screen) screen)


:nail_care:

--- test/com/wsscode/pathom/parser_test.clj
+++ test/com/wsscode/pathom/parser_test.clj
@@ -4,7 +4,6 @@
             [com.wsscode.common.async-clj :refer [let-chan go-promise]]
             [com.wsscode.pathom.parser :as pp]
             [com.wsscode.pathom.core :as p]
-            [com.wsscode.pathom.connect :as pc]
             [com.wsscode.pathom.trace :as pt]))

 (deftest test-parser


heuristic fix

heuristic fix

--- src/connect5_ai/core.clj
+++ src/connect5_ai/core.clj
@@ -104,16 +104,14 @@
     (if (or
           (empty? left-part)
           (and prev-left-is-dead prev-right-is-dead))
-      (if (and (not= prev-left-streak-type prev-right-streak-type)
-               (not= prev-left-streak-type :wall)
-               (not= prev-right-streak-type :wall))
+      (if (not= prev-left-streak-type prev-right-streak-type)
         ; Types differents
         (let [opl (if (= :min prev-left-streak-type) + +)
               opr (if (= :min prev-right-streak-type) + +)]
           (+
             (opl
               (cond
-                (or (= :wall prev-left-streak-type) (= :empty prev-left-streak-type)) 0
+                (not= :max prev-left-streak-type) 0

                 (= 4 prev-left-direct-streak) Double/POSITIVE_INFINITY
                 (and
@@ -123,12 +121,12 @@
                   (= 0 prev-right-direct-streak)) 50000

                 (<= 4 (+ prev-left-streak-count prev-left-partial-streak-count)) (+ prev-left-direct-streak prev-left-streak-count)
-                :else 0))
+                :else 1))

             (opr
               (cond

-                (or (= :wall prev-right-streak-type) (= :empty prev-right-streak-type)) 0
+                (not= :wall prev-right-streak-type) 0
                 (= 4 prev-right-direct-streak) Double/POSITIVE_INFINITY
                 (and
                   (= 3 prev-right-direct-streak)
@@ -136,25 +134,19 @@
                   (< 0 prev-left-partial-streak-count)
                   (= 0 prev-left-direct-streak)) 50000

-                (<= 4 (+ prev-right-streak-count prev-right-partial-streak-count)) (+ prev-right-direct-streak prev-right-streak-count)
-                :else 0))
+                (<= 4 (+ prev-right-streak-count prev-right-partial-streak-count))
+                    (+ prev-right-direct-streak prev-right-streak-count)
+                :else 1))
             ))
-        ; Types identiques ou mur
+        ; Types identiques
         (let [op (if (or (= :min prev-left-streak-type) (= :min prev-right-streak-type)) + +)]
           (op (cond
-                (= :wall prev-left-streak-type prev-right-streak-type) 0 ;
-                (= 4 (+ prev-left-direct-streak prev-right-direct-streak)) (if (or
-                                                                                (= prev-left-streak-type :max)
-                                                                                (= prev-left-streak-type :min)
-                                                                                (= prev-right-streak-type :max)
-                                                                                (= prev-right-streak-type :min))
-                                                                             Double/POSITIVE_INFINITY
-                                                                             0) ;
+                (not= :max prev-left-streak-type) 0 ;
+                (= 4 (+ prev-left-direct-streak prev-right-direct-streak)) Double/POSITIVE_INFINITY
+
                 (and (= 3 (+ prev-left-direct-streak prev-right-direct-streak))
                      (>= prev-right-partial-streak-count 1)
-                     (>= prev-left-partial-streak-count 1)  ;
-                     )
-                50000
+                     (>= prev-left-partial-streak-count 1)) 50000
                 (<= 5 (+ prev-left-direct-streak prev-right-direct-streak)) 0

                 :else (+ prev-left-direct-streak
@@ -446,14 +438,9 @@

   (if (empty? (state true))
     {:best-move [(long (/ grid-width 2)) (long (/ grid-height 2))]}
-    (if (and (is-terminal-state? state)
-             (is-it-a-win? grid-width grid-height state))
-      (let [who-wins? (if (is-it-a-win? grid-width grid-height state)
-                        (not is-first-player)
-                        nil)]
+    (if (and (is-terminal-state? state))
         {:best-move  (state :last-move)
-         :best-value (state :heuristic-result)
-         :who-win?   who-wins?})
+         :best-value (state :heuristic-result)}

       (if (= max-depth 0)
         {:best-move  (state :last-move)
@@ -500,7 +487,7 @@
                                Double/NEGATIVE_INFINITY
                                Double/POSITIVE_INFINITY
                                got-time?
-                               (not is-first-player)
+                               is-first-player
                                deepness         ; Steps
                                grid-width grid-height)]
         (when (not (empty? (point :best-move)))


Add more values to the "Numbers with an equivalent value are equal using `==`" fact.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -256,7 +256,17 @@
 ;;;   Clojure opts to provide a third notion of equality, specifically to
 ;;;   address the need for type-insensitive equivalence tests.

-(fact (== 2 2N 2M 2.0M 2.0) => true) ; true even for inexact things
+(fact "Numbers with an equivalent value are equal using `==`"
+  (== (byte 2)
+      (short 2)
+      (Integer. 2)
+      2
+      2N
+      2M
+      2.0M
+      2.0
+      (Float. 2.0))
+  => true)

 ;;;; ___________________________________________________________________________
 ;;;; ---- Going from Longs to BigInts and vice versa, or not ----


Need an :as for base

Need an :as for base

--- test/kixi/integration/metadata_test.clj
+++ test/kixi/integration/metadata_test.clj
@@ -3,7 +3,7 @@
             [clojure.test :refer :all]
             [clj-http.client :as client]
             [clojure.java.io :as io]
-            [kixi.integration.base :refer :all :exclude [post-file wait-for-metadata-key]]
+            [kixi.integration.base :as base :refer :all :exclude [post-file wait-for-metadata-key]]
             [kixi.datastore.metadatastore :as ms]
             [kixi.datastore.web-server :as ws]
             [kixi.datastore.schemastore.conformers :as conformers]


remove bad comment

remove bad comment

--- test/metabase/api/meta/dataset_test.clj
+++ test/metabase/api/meta/dataset_test.clj
@@ -8,7 +8,7 @@
             [metabase.test-data :refer :all]))

 ;;; ## QUERY /api/meta/dataset
-;; Just a basic sanity check to make sure Query Processor endpoint is still working correctly.) (rexpect(match-$ (sel :latest QueryExecution)
+;; Just a basic sanity check to make sure Query Processor endpoint is still working correctly.
 (expect-eval-actual-first (match-$ (sel :one :fields [QueryExecution :id :uuid] (order :id :desc))
                             {:data {:rows [[1000]]
                                     :columns ["count"]