Add more common fns and abstract out some old ones.

--- src/dungeon_crusade/common.clj
+++ src/dungeon_crusade/common.clj
@@ -39,6 +39,33 @@
                             (cons (f x y) (if (empty? xs) [] (fill-missing pred f ys xs)))
                             (cons x (if (empty? xs) [] (fill-missing pred f vcoll xs)))))))

+(defn fn-in
+  "Applies a function to a value in a nested associative structure and an input value.
+   ks sequence of keys and v is the second arguement to f. The nested value will be
+   updated to (f o v) where o is the value that would be returned by (get-in m ks)."
+  [f m ks v]
+  (update-in m ks (fn [coll] (f coll v))))
+
+(defn concat-in
+  [m ks v]
+  (fn-in concat m ks v))
+
+(defn conj-in
+  [m ks v]
+  (fn-in conj m ks v))
+
+(defn map-in
+  [m ks f]
+  (fn-in (fn [coll _] (map f coll)) m ks nil))
+
+(defn filter-in
+  [m ks f]
+  (fn-in (fn [coll _] (filter f coll)) m ks nil))
+
+(defn remove-in
+  [m ks f]
+  (fn-in (fn [coll _] (remove f coll)) m ks nil))
+
 (defn with-xygrid
   "Inclue x y values alongside elements in a grid and preserve the structure
    of the grid.
@@ -137,11 +164,15 @@
                 _ (println "assoc-in place" args)]
                  (apply assoc-in place args))) place extras)))

+(defn current-place-id
+  "Retrieve the current place id."
+  [state]
+  (-> state :world :current-place))
+
 (defn current-place
   "Retrieve the current place."
   [state]
-  (let [current-place (-> state :world :current-place)]
-    (-> state :world :places current-place)))
+  (get-in state [:world :places (current-place-id state)]))

 (defn map-with-xy
   "Non-lazily call `(f cell x y)` for each cell in the grid."
@@ -204,6 +235,11 @@
   (let [place-id (-> state :world :current-place)]
     (filter #(= place-id (% :place)) (-> state :world :npcs))))

+(defn npcs-at-current-place
+  "Seq of npcs at the current place."
+  [state]
+  (filter-in state [:world :npcs] (fn [npc] (= (npc :place) (current-place-id state)))))
+
 (defn add-npc
   "Add an npc to the specified place and position."
   [state npc place-id x y]
@@ -222,3 +258,16 @@
                  (fn [inventory] (concat inventory items)))
       (assoc-in [:world :player :inventory] new-player-inventory))))

+(defn conj-in-cell-items
+  "Adds an item to [x y] in the current place. Simple, right?"
+  [state item x y]
+  (conj-in state [:world :places (-> state :world :current-place) y x :items] item))
+
+(defn conj-in-current-cell-items
+  "Adds an item to the player's cell's items."
+  [state item]
+  (let [x (-> state :world :player :pos :x)
+        y (-> state :world :player :pos :y)]
+    (conj-in-cell-items state item x y)))
+
+


Auto-advance initial nil dialog option

Auto-advance initial nil dialog option

--- src/dungeon_crusade/update.clj
+++ src/dungeon_crusade/update.clj
@@ -467,9 +467,18 @@
                                0))]
     (println "start-talking")
     (if-let [target-npc (npc-at-xy state target-x target-y)]
-      (-> state
-          (update-npc-at-xy target-x target-y #(assoc % :talking true))
-          (assoc-in [:world :current-state] :talking))
+      ;; store update the npc and world state with talking
+      (let [state (-> state
+                      (update-npc-at-xy target-x target-y #(assoc % :talking true))
+                      (assoc-in [:world :current-state] :talking))
+            fsm (get-in state [:dialog (target-npc :id)])
+            ;; get the dialog input options for the npc
+            valid-input (get-valid-input fsm)]
+        ;; if the first option is `nil` then advance the fsm one step.
+        ;; this auto step can be used to have the npc speak first when approached.
+        (if (= (first valid-input) nil)
+          (step-fsm state fsm nil)
+          state))
       (assoc-in state [:world :current-state] :normal))))

 (defn talk-left [state]


don't check new version on Linux to prevent network error

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

--- src/status_im/ui/components/desktop/events.cljs
+++ src/status_im/ui/components/desktop/events.cljs
@@ -1,5 +1,6 @@
 (ns status-im.ui.components.desktop.events
-  (:require [status-im.utils.handlers :as handlers]))
+  (:require [status-im.utils.handlers :as handlers]
+            [status-im.utils.platform :as platform]))

 (handlers/register-handler-fx
  :show-desktop-tab
@@ -8,7 +9,8 @@
            :dispatch [:navigate-to (if (and (= tab-name :home) (:current-chat-id db))
                                      :chat
                                      :home)]}
-          (when (= tab-name :profile)
+          (when (and platform/isMacOs?
+                     (= tab-name :profile))
             {:http-get
              {:url
               "https://raw.githubusercontent.com/status-im/status-im.github.io/develop/env.sh"


update prices for v1

update prices for v1

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/wallet/navigation.cljs
+++ src/status_im/ui/screens/wallet/navigation.cljs
@@ -1,11 +1,14 @@
 (ns status-im.ui.screens.wallet.navigation
   (:require [status-im.ui.screens.navigation :as navigation]
-            [status-im.ui.screens.wallet.signing-phrase.views :as signing-phrase]))
+            [status-im.ui.screens.wallet.signing-phrase.views :as signing-phrase]
+            [re-frame.core :as re-frame]))

 (defmethod navigation/preload-data! :wallet-stack
   [db [event]]
   (let [wallet-set-up-passed? (get-in db [:multiaccount :wallet-set-up-passed?])
         sign-phrase-showed?   (get db :wallet/sign-phrase-showed?)]
+    ;;TODO temporary simple fix for v1
+    (re-frame/dispatch [:wallet.ui/pull-to-refresh])
     (if (or (= event :navigate-back) wallet-set-up-passed? sign-phrase-showed?)
       db
       (assoc db :popover/popover {:view [signing-phrase/signing-phrase]}


Comment on make-kc.

Comment on make-kc.

--- src/cbfg/kvs.cljs
+++ src/cbfg/kvs.cljs
@@ -22,7 +22,7 @@
 ; TODO: Conventions on :status, :status-info, :partial, :result responses.
 ; TODO: Conventions on closing res-ch.

-(defn make-kc [] ; A kc is a keys / changes map.
+(defn make-kc [] ; A kc is a keys & changes map.
   {:keys (sorted-map)      ; key -> sq
    :changes (sorted-map)}) ; [sq key] -> {:key k, :sq s, :deleted true | :val v}


(TK-31) Increase proxy request buffer size

Double the size of the request buffer on an HTTP Client. This
will fix the proxy issue that occurs when making a request
with an extremely large cookie like the one seen in TK-31.

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
@@ -286,11 +286,13 @@
           (URI/create (.toString uri))))

       (newHttpClient []
-        (if custom-ssl-ctxt-factory
-          (HttpClient. custom-ssl-ctxt-factory)
-          (if-let [ssl-ctxt-factory (:ssl-context-factory @(:state webserver-context))]
-            (HttpClient. ssl-ctxt-factory)
-            (HttpClient.))))
+        (let [client (if custom-ssl-ctxt-factory
+                       (HttpClient. custom-ssl-ctxt-factory)
+                       (if-let [ssl-ctxt-factory (:ssl-context-factory @(:state webserver-context))]
+                         (HttpClient. ssl-ctxt-factory)
+                         (HttpClient.)))]
+          (.setRequestBufferSize client 8192)
+          client))

       (customizeProxyRequest [proxy-req req]
         (if-let [callback-fn (:callback-fn options)]


benchmark updates

benchmark updates

--- scripts/benchmarks.clj
+++ scripts/benchmarks.clj
@@ -84,6 +84,26 @@
     (manual-transform data inc)
     ))

+(let [data {:a 1 :b 2 :c 3 :d 4}]
+  (run-benchmark "transform values of a small map" 1000000
+    (into {} (for [[k v] data] [k (inc v)]))
+    (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
+    (reduce-kv (fn [m k v] (assoc m k (inc v))) (empty data) data)
+    (transform [ALL LAST] inc data)
+    (transform MAP-VALS inc data)
+    (zipmap (keys data) (map inc (vals data)))
+    ))
+
+(let [data (->> (for [i (range 1000)] [i i]) (into {}))]
+  (run-benchmark "transform values of large map" 1000
+    (into {} (for [[k v] data] [k (inc v)]))
+    (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
+    (reduce-kv (fn [m k v] (assoc m k (inc v))) (empty data) data)
+    (transform [ALL LAST] inc data)
+    (transform MAP-VALS inc data)
+    (zipmap (keys data) (map inc (vals data)))
+    ))
+
 (let [data [1 2 3 4 5]]
   (run-benchmark "map a function over a vector" 1000000
     (vec (map inc data))
@@ -111,36 +131,6 @@
     (setval END [1] v)
     (reduce conj v [1])
     (conj v 1)))
-
-(defn- update-pair [[k v]]
-  [k (inc v)])
-
-(defn manual-similar-reduce-kv [data]
-  (reduce-kv
-    (fn [m k v]
-      (let [[newk newv] (update-pair [k v])]
-        (assoc m newk newv)))
-    {}
-    data
-    ))
-
-(let [data {:a 1 :b 2 :c 3 :d 4}]
-  (run-benchmark "transform values of a map" 1000000
-    (into {} (for [[k v] data] [k (inc v)]))
-    (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
-    (manual-similar-reduce-kv data)
-    (transform [ALL LAST] inc data)
-    (transform MAP-VALS inc data)
-    ))
-
-(let [data (->> (for [i (range 1000)] [i i]) (into {}))]
-  (run-benchmark "transform values of large map" 1000
-    (into {} (for [[k v] data] [k (inc v)]))
-    (reduce-kv (fn [m k v] (assoc m k (inc v))) {} data)
-    (manual-similar-reduce-kv data)
-    (transform [ALL LAST] inc data)
-    (transform MAP-VALS inc data)
-    ))

 (declarepath TreeValues)


minor cleanup

minor cleanup

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/ui/util.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/ui/util.cljs
@@ -97,7 +97,7 @@
 (defn tweets-by-order
   "Finds top n tweets by specified order."
   [order state n skip]
-  (map (fn [[k v]] (get (:tweets-map state) k {:id_str (name k)}))
+  (map (fn [[k _]] (get (:tweets-map state) k {:id_str (name k)}))
        (->> (order state)
             (drop (* n skip) ,)
             (take n ,))))


CMR-1188: John Cromartie's fix for the defrecord/aot issue which is causing a Java error in build #3 in CMR-1188

--- search-app/project.clj
+++ search-app/project.clj
@@ -33,8 +33,11 @@
          :source-paths ["src" "dev" "test"]
          :injections [(require 'pjstadig.humane-test-output)
                       (pjstadig.humane-test-output/activate!)]}
-   :uberjar {:main cmr.search.runner
-             :aot :all}}
+   :uberjar {:aot :all}}
+  ;; Skip AOT to prevent double-compilation during uberjar phase,
+  ;; avoiding errors when loading code that uses protocol functions at
+  ;; load time.
+  :main ^:skip-aot cmr.search.runner

   :aliases {"generate-docs" ["exec" "-p" "./support/generate_docs.clj"]
             ;; Prints out documentation on configuration environment variables.


object -> objects

object -> objects

--- src/play_clj/core_graphics.clj
+++ src/play_clj/core_graphics.clj
@@ -245,7 +245,7 @@

 (defn ^:private map-object-init
   [k]
-  (u/gdx :maps :object (str (u/key->pascal k) "MapObject.")))
+  (u/gdx :maps :objects (str (u/key->pascal k) "MapObject.")))

 (defn map-object*
   []


Updated tests for the Reference naming change.

--- test/cmr/system_int_test/search_util.clj
+++ test/cmr/system_int_test/search_util.clj
@@ -17,8 +17,8 @@
         references (result "references")]
     (is (= 200 (:status response)))
     (map (fn [x]
-           (let [{:strs [entry-title concept-id revision-id]} x]
-             {:dataset-id entry-title
+           (let [{:strs [name concept-id revision-id]} x]
+             {:dataset-id name
               :concept-id concept-id
               :revision-id revision-id}))
          references)))


get columns table to work

get columns table to work

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -2,8 +2,9 @@
   (:import [javax.swing BorderFactory JButton JFrame JLabel
                         JList JPanel JScrollPane JSplitPane
                         JTable JTextField RowFilter SpringLayout SwingUtilities]
-           [javax.swing.table AbstractTableModel DefaultTableModel TableRowSorter]
-           [javax.swing.event DocumentListener]
+           [javax.swing.table AbstractTableModel DefaultTableModel
+                              TableColumn TableRowSorter]
+           [javax.swing.event DocumentListener TableModelListener]
            [java.io BufferedReader File FileReader]
            [java.util Vector]
            [java.awt Color Dimension Font Insets]
@@ -42,9 +43,9 @@
 (defn set-filter [table text]
   (let [sorter (.getRowSorter table)
         column-indices
-          (int-array (map #(.getModelIndex %)
-               (enumeration-seq (.. table getColumnModel getColumns))))]
-      (do (.setRowFilter sorter (RowFilter/regexFilter text column-indices)))))
+        (int-array (map #(.getModelIndex %)
+        (enumeration-seq (.. table getColumnModel getColumns))))]
+    (do (.setRowFilter sorter (RowFilter/regexFilter text column-indices)))))

 (defn connect-search [search-field table]
   (let [d (.getDocument search-field)
@@ -59,12 +60,18 @@
         (changedUpdate [_ _] (f))
         (removeUpdate [_ _] (f))))))

-(defn get-column-index [table text]
+(defn get-model-column-index [table text]
   (let [table-model (.getModel table)]
     (-> (vec
       (for [i (range (.getColumnCount table-model))]
         (.getColumnName table-model i)))
       (.indexOf text))))
+
+(defn open-selected-files [table]
+  (let [path-column (get-model-column-index table "Path")]
+    (doseq [i (.getSelectedRows table)]
+      (.openAcquisitionData gui
+        (.getValueAt table i path-column)))))

 (defn listen-to-open [table]
   (.addMouseListener table
@@ -73,19 +80,13 @@
         (when (= 2 (.getClickCount e)) ; double click
           (open-selected-files table))))))

-(defn open-selected-files [table]
-  (let [path-column (get-column-index table "Path")]
-    (doseq [i (.getSelectedRows table)]
-      (.openAcquisitionData gui
-        (.getValueAt table i path-column)))))
-
 (defn remove-locations []
   (let [location-table (get-in @settings-window [:locations :table])
         selected-rows (.getSelectedRows location-table)
         location-model (.getModel location-table)
         browser-table (:table @browser)
         browser-model (.getModel browser-table)
-        location-column (get-column-index browser-table "Location")]
+        location-column (get-model-column-index browser-table "Location")]
     (println browser-model "," location-model "," location-column)
     (doseq [location-row (reverse selected-rows)]
       (when-let [loc (.getValueAt location-model location-row 0)]
@@ -166,8 +167,35 @@
                      "Please add a location to scan for files")]
     (add-location (.getAbsolutePath loc))))

+(defn get-display-index [table index]
+  (let [column-model (.getColumnModel table)]
+    (first
+      (for [i (range (.getColumnCount column-model))
+        :when (= index (.getModelIndex (.getColumn column-model i)))]
+          i))))
+
+(defn update-column [tags-model col]
+  (when (:table @browser)
+    (let [on (.getValueAt tags-model col 0)
+          tag (.getValueAt tags-model col 1)
+          table (:table @browser)
+          column-model (.getColumnModel table)
+          model-index (get-model-column-index table tag)
+          display-index (get-display-index table model-index)]
+      (when (<= 0 model-index)
+        (when (and (not on) display-index)
+          (.removeColumn column-model (.getColumn column-model display-index)))
+        (when (and on (not display-index))
+          (println model-index)
+          (.addColumn column-model
+            (doto (TableColumn. model-index)
+              (.setHeaderValue tag))))))))
+
+(defn update-all-columns [tags-model]
+  (dorun (map #(update-column tags-model %) (range (.getRowCount tags-model)))))
+
 (defn create-column-table []
-  (let [table (proxy [JTable] [0 2]
+  (let [table (proxy [JTable] []
                 (isCellEditable [_ i] (get [true false] i)))
         model (proxy [DefaultTableModel] [0 2]
                 (getColumnClass [i]
@@ -177,10 +205,12 @@
       (.setRowSelectionAllowed false)
       (.setFocusable false)
       (.. getColumnModel (getColumn 0) (setMinWidth 20))
-      (.. getColumnModel (getColumn 0) (setMaxWidth 20))
-    ; (.. getColumnModel (getColumn 1) (setMaximumWidth 20))
-    ; (.setAutoResizeMode JTable/AUTO_RESIZE_LAST_COLUMN))
-    )
+      (.. getColumnModel (getColumn 0) (setMaxWidth 20)))
+      (.addTableModelListener model
+        (reify TableModelListener
+          (tableChanged [_ e]
+            (dorun (map #(update-column model %)
+              (range (.getFirstRow e) (inc (.getLastRow e))))))))
     (doseq [tag tags]
       (.addRow model (Vector. [false tag])))
     table))
@@ -264,8 +294,9 @@
   (load-mm)
   (reset! settings-window (create-settings-window))
   (reset! browser (create-browser))
-  (reset! headings default-headings)
-  (.setModel (:table @browser) (create-table-model default-headings))
+  (reset! headings tags)
+  (.setModel (:table @browser) (create-table-model tags))
+  (update-all-columns (.getModel (get-in @settings-window [:columns :table])))
   (add-location "/Users/arthur/qqqq")
   browser)


cleans up for

cleans up for

--- access-control-app/src/cmr/access_control/services/auth_util.clj
+++ access-control-app/src/cmr/access_control/services/auth_util.clj
@@ -74,12 +74,13 @@
                          (= action-description "delete") [:delete]
                          :else [permission])]
    (when (or legacy-guid concept-id)
-     (remove empty?
-       (for [permission permissions]
-         (filter #(or (= concept-id (-> % :single-instance-object-identity :target-guid))
-                      (= legacy-guid (-> % :single-instance-object-identity :target-guid)))
-                 (acl/get-permitting-acls context
-                                          :single-instance-object "GROUP_MANAGEMENT" permission)))))))
+     (for [permission permissions
+           :let [acls (acl/get-permitting-acls context :single-instance-object "GROUP_MANAGEMENT" permission)
+                 acls (filter #(or (= concept-id (-> % :single-instance-object-identity :target-guid))
+                                   (= legacy-guid (-> % :single-instance-object-identity :target-guid))) acls)]
+           :when (not-empty acls)]
+       acls))))
+
 (defn- describe-group
   [group]
   (let [{:keys [provider-id]} group]


collatz conjecture algorithm changed

collatz conjecture algorithm changed

--- exercises/collatz-conjecture/src/example.clj
+++ exercises/collatz-conjecture/src/example.clj
@@ -1,10 +1,13 @@
 (ns collatz-conjecture)
+
+(defn collatz-helper [n]
+  (cond (= 1 n)   1
+        (even? n) (/ n 2)
+        :else     (inc (* 3 n))))

 (defn collatz [n]
   (if (> n 0)
-    (loop [t 0 n n]
-      (cond (= 1 n)   t
-            (even? n) (recur (inc t) (/ n 2))
-            :else     (recur (inc t) (inc (* 3 n)))))
+    (count (take-while #(not= 1 %)
+                       (iterate collatz-helper n)))
     (throw (IllegalArgumentException.
              "Just defined for numbers greater than 0."))))


RS | #89 | Add translation test for add-question page - future-fact until masthead is translated

--- test/objective8/integration/front_end/index.clj
+++ test/objective8/integration/front_end/index.clj
@@ -119,3 +119,21 @@
                (prn body)
                status => 200
                (re-seq untranslated-string-regex body) => empty?)))
+
+(facts "about rendering add-question page"
+       (fact "there are no untranslated strings"
+             (against-background
+               (oauth/access-token anything anything anything) => {:user_id "TWITTER_ID"}
+               (http-api/find-user-by-twitter-id anything) => {:status ::http-api/success
+                                                               :result {:_id USER_ID
+                                                                        :username "username"}}
+               (http-api/get-objective OBJECTIVE_ID) => {:status ::http-api/success
+                                                        :result open-objective})
+             (let [user-session (helpers/test-context)
+                   {status :status body :body} (-> user-session
+                            (helpers/sign-in-as-existing-user)
+                            (p/request (utils/path-for :fe/create-objective-form))
+                            :response)]
+               (prn body)
+               status => 200
+               (re-seq untranslated-string-regex body) => empty?)))


Add optional KeyStoreScanner to jetty server

When a :keystore-scan-interval is provided, a KeyStoreScanner will be
added to monitor the keystore. When the keystore is updated, Jetty will
gracefully refresh its SSL session.

--- ring-jetty-adapter/src/ring/adapter/jetty.clj
+++ ring-jetty-adapter/src/ring/adapter/jetty.clj
@@ -15,7 +15,7 @@
            [org.eclipse.jetty.server.handler AbstractHandler]
            [org.eclipse.jetty.util BlockingArrayQueue]
            [org.eclipse.jetty.util.thread ThreadPool QueuedThreadPool]
-           [org.eclipse.jetty.util.ssl SslContextFactory$Server]
+           [org.eclipse.jetty.util.ssl SslContextFactory$Server KeyStoreScanner]
            [javax.servlet AsyncContext DispatcherType AsyncEvent AsyncListener]
            [javax.servlet.http HttpServletRequest HttpServletResponse]))

@@ -120,9 +120,11 @@
                         (.setSecureScheme "https")
                         (.setSecurePort ssl-port)
                         (.addCustomizer (SecureRequestCustomizer.))))
-        ssl-factory  (SslConnectionFactory.
-                      (ssl-context-factory options)
-                      "http/1.1")]
+        ssl-context  (ssl-context-factory options)
+        ssl-factory  (SslConnectionFactory. ssl-context "http/1.1")]
+    (when-let [scan-interval (options :keystore-scan-interval)]
+      (.addBean server (doto (KeyStoreScanner. ssl-context)
+                         (.setScanInterval scan-interval))))
     (doto (server-connector server ssl-factory http-factory)
       (.setPort ssl-port)
       (.setHost (options :host))
@@ -183,6 +185,8 @@
   :keystore             - the keystore to use for SSL connections
   :keystore-type        - the keystore type (default jks)
   :key-password         - the password to the keystore
+  :keystore-scan-interval - if not nil, the interval in seconds to scan for an
+                            updated keystore
   :truststore           - a truststore to use for SSL connections
   :trust-password       - the password to the truststore
   :max-threads          - the maximum number of threads to use (default 50)


Update alignment for run-jetty options

Update alignment for run-jetty options

--- ring-jetty-adapter/src/ring/adapter/jetty.clj
+++ ring-jetty-adapter/src/ring/adapter/jetty.clj
@@ -159,50 +159,53 @@
   "Start a Jetty webserver to serve the given handler according to the
   supplied options:

-  :configurator         - a function called with the Jetty Server instance
-  :async?               - if true, treat the handler as asynchronous
-  :async-timeout        - async context timeout in ms (defaults to 0, no timeout)
-  :async-timeout-handler - an async handler to handle an async context timeout
-  :port                 - the port to listen on (defaults to 80)
-  :host                 - the hostname to listen on
-  :join?                - blocks the thread until server ends (defaults to true)
-  :daemon?              - use daemon threads (defaults to false)
-  :http?                - listen on :port for HTTP traffic (defaults to true)
-  :ssl?                 - allow connections over HTTPS
-  :ssl-port             - the SSL port to listen on (defaults to 443, implies
-                          :ssl? is true)
-  :ssl-context          - an optional SSLContext to use for SSL connections
-  :exclude-ciphers      - when :ssl? is true, additionally exclude these
-                          cipher suites
-  :exclude-protocols    - when :ssl? is true, additionally exclude these
-                          protocols
+  :configurator           - a function called with the Jetty Server instance
+  :async?                 - if true, treat the handler as asynchronous
+  :async-timeout          - async context timeout in ms
+                            (defaults to 0, no timeout)
+  :async-timeout-handler  - an async handler to handle an async context timeout
+  :port                   - the port to listen on (defaults to 80)
+  :host                   - the hostname to listen on
+  :join?                  - blocks the thread until server ends
+                            (defaults to true)
+  :daemon?                - use daemon threads (defaults to false)
+  :http?                  - listen on :port for HTTP traffic (defaults to true)
+  :ssl?                   - allow connections over HTTPS
+  :ssl-port               - the SSL port to listen on (defaults to 443, implies
+                            :ssl? is true)
+  :ssl-context            - an optional SSLContext to use for SSL connections
+  :exclude-ciphers        - when :ssl? is true, additionally exclude these
+                            cipher suites
+  :exclude-protocols      - when :ssl? is true, additionally exclude these
+                            protocols
   :replace-exclude-ciphers?   - when true, :exclude-ciphers will replace rather
                                 than add to the cipher exclusion list (defaults
                                 to false)
   :replace-exclude-protocols? - when true, :exclude-protocols will replace
                                 rather than add to the protocols exclusion list
                                 (defaults to false)
-  :keystore             - the keystore to use for SSL connections
-  :keystore-type        - the keystore type (default jks)
-  :key-password         - the password to the keystore
+  :keystore               - the keystore to use for SSL connections
+  :keystore-type          - the keystore type (default jks)
+  :key-password           - the password to the keystore
   :keystore-scan-interval - if not nil, the interval in seconds to scan for an
                             updated keystore
-  :truststore           - a truststore to use for SSL connections
-  :trust-password       - the password to the truststore
-  :max-threads          - the maximum number of threads to use (default 50)
-  :min-threads          - the minimum number of threads to use (default 8)
-  :max-queued-requests  - the maximum number of requests to be queued
-  :thread-idle-timeout  - Set the maximum thread idle time. Threads that are idle
-                          for longer than this period may be stopped (default 60000)
-  :max-idle-time        - the maximum idle time in milliseconds for a connection
-                          (default 200000)
-  :client-auth          - SSL client certificate authenticate, may be set to
-                          :need,:want or :none (defaults to :none)
-  :send-date-header?    - add a date header to the response (default true)
-  :output-buffer-size   - the response body buffer size (default 32768)
-  :request-header-size  - the maximum size of a request header (default 8192)
-  :response-header-size - the maximum size of a response header (default 8192)
-  :send-server-version? - add Server header to HTTP response (default true)"
+  :truststore             - a truststore to use for SSL connections
+  :trust-password         - the password to the truststore
+  :max-threads            - the maximum number of threads to use (default 50)
+  :min-threads            - the minimum number of threads to use (default 8)
+  :max-queued-requests    - the maximum number of requests to be queued
+  :thread-idle-timeout    - Set the maximum thread idle time. Threads that are
+                            idle for longer than this period may be stopped
+                            (default 60000)
+  :max-idle-time          - the maximum idle time in milliseconds for a
+                            connection (default 200000)
+  :client-auth            - SSL client certificate authenticate, may be set to
+                            :need,:want or :none (defaults to :none)
+  :send-date-header?      - add a date header to the response (default true)
+  :output-buffer-size     - the response body buffer size (default 32768)
+  :request-header-size    - the maximum size of a request header (default 8192)
+  :response-header-size   - the maximum size of a response header (default 8192)
+  :send-server-version?   - add Server header to HTTP response (default true)"
   [handler options]
   (let [server (create-server (dissoc options :configurator))]
     (if (:async? options)


Rename edges

Rename edges

--- src/clj/cglossa/data_import/metadata_values.clj
+++ src/clj/cglossa/data_import/metadata_values.clj
@@ -16,9 +16,10 @@
                          :columns   ["corpus_cat:string" "value:string"]}}
                   {:vertex {:class "MetadataValue"}}
                   {:edge
-                   {:class                "InCategory"
+                   {:class                "HasMetadataValue"
                     :lookup               "MetadataCategory.corpus_cat"
                     :joinFieldName        "corpus_cat"
+                    :direction            "in"
                     :unresolvedLinkAction "HALT"}}]
    :loader       {:orientdb
                   {:dbURL               "remote:localhost/Glossa"
@@ -37,9 +38,10 @@
    :transformers [{:csv {:separator "\t"}}
                   {:vertex {:class "MetadataValue"}}
                   {:edge
-                   {:class                "InCategory"
+                   {:class                "HasMetadataValue"
                     :lookup               "MetadataCategory.corpus_cat"
                     :joinValue            "###CORPUS###_tid"
+                    :direction            "in"
                     :unresolvedLinkAction "HALT"}}]
    :loader       {:orientdb
                   {:dbURL               "remote:localhost/Glossa"
@@ -87,23 +89,30 @@

 (defn- create-tid-config! [corpus config-path orig-tsv-path]
   (with-open [tsv-file (io/reader orig-tsv-path)]
-    (let [cats           (first (utils/read-csv tsv-file))
-          other-cats     (->> cats
-                              rest
-                              (filter #(not (get #{"startpos" "endpos"} %1))))
-          cat-edges      (map (fn [cat]
-                                {:edge
-                                 {:class                "HasMetadataValue"
-                                  :lookup               (str "SELECT from MetadataValue WHERE corpus_cat = '"
-                                                             (str corpus "_" cat)
-                                                             "' AND value = ?")
-                                  :joinFieldName        cat
-                                  :unresolvedLinkAction "WARNING"}})
-                              other-cats)
-          field-removals (map (fn [cat]
-                                {:field {:fieldName cat
-                                         :operation "remove"}})
-                              other-cats)]
+    (let [cats            (first (utils/read-csv tsv-file))
+          non-tid-cats    (->> cats
+                               rest
+                               (filter #(not (get #{"startpos" "endpos"} %1))))
+          ;; Create edges from all the non-tid metadata values on the current tsv line
+          ;; to the tid value, representing the fact that these values describe the text
+          ;; identified by this tid. Note that the non-tid values were created in the
+          ;; database in a previous step, by importing a "uniqueified" list of values,
+          ;; since we would get lots of duplicate values if we created one value for each
+          ;; field on the current tsv line.
+          describes-edges (map (fn [cat]
+                                 {:edge
+                                  {:class                "DescribesText"
+                                   :lookup               (str "SELECT from MetadataValue WHERE corpus_cat = '"
+                                                              (str corpus "_" cat)
+                                                              "' AND value = ?")
+                                   :joinFieldName        cat
+                                   :direction            "in"
+                                   :unresolvedLinkAction "WARNING"}})
+                               non-tid-cats)
+          field-removals  (map (fn [cat]
+                                 {:field {:fieldName cat
+                                          :operation "remove"}})
+                               non-tid-cats)]
       (spit config-path (-> tids-template
                             ;; Mark all columns except startpos and endpos as strings
                             (update-in [:transformers 0 :csv]
@@ -111,7 +120,7 @@
                                                                        cat
                                                                        (str cat ":string")))
                                                            cats))
-                            (update-in [:transformers] concat cat-edges field-removals)
+                            (update-in [:transformers] concat describes-edges field-removals)
                             (cheshire/generate-string {:pretty true})
                             (str/replace "###TSV-PATH###" orig-tsv-path)
                             (str/replace "###CORPUS###" corpus))))))


Interrupt requests while current planet is matched

--- src/cljs/flux_challenge_reagent/sith_lords.cljs
+++ src/cljs/flux_challenge_reagent/sith_lords.cljs
@@ -6,58 +6,68 @@

 (defonce coll (r/atom (vec (repeat 5 nil)) :validator vector?))

+(defn homeworld-matches? [coll current-planet]
+  (let [sith-lords-homeworlds (map #(get-in % [:sith-lord "homeworld"]) coll)]
+     (not (empty? (filter #(= % current-planet) sith-lords-homeworlds)))))
+
 (defn frozen? []
-  (let [sith-lords-homeworlds (map #(get-in % [:sith-lord "homeworld"]) @coll)]
-    (not (empty? (filter current-planet/is? sith-lords-homeworlds)))))
+  (homeworld-matches? @coll @current-planet/state))

-(defn sith-lord-url [id]
-  (str "http://localhost:3000/dark-jedis/" id))
+(defn pending-sith-lord-item [id]
+  (if id {:id id} nil))

-(defn sith-lord-item [sith-lord]
-  {:id (get sith-lord "id")
-   :sith-lord sith-lord})
-
-(defn sith-lord-request-item! [id]
-  (if id
-    (let [url (sith-lord-url id)]
-      {:id id
-       :request (ajax/GET url
-                          :response-format :json
-                          :handler handle-sith-lord-response!)})
-    nil))
-
-(defn request-sith-lord! [coll index id]
+(defn assoc-pending-sith-lord [coll index id]
   (if (and (>= index 0) (< index (count coll)) id (nil? (get coll index)))
-    (assoc coll index (sith-lord-request-item! id))
+    (assoc coll index (pending-sith-lord-item id))
     coll))

-(defn accept-sith-lord! [coll sith-lord]
+(defn abort-request! [item]
+  (if-let [request (:request item)]
+    (do
+      (ajax/abort request)
+      (dissoc item :request))
+    item))
+
+(defn start-request! [item]
+  (if-let [id (:id item)]
+    (if (not (or (contains? item :sith-lord) (contains? item :request)))
+      (let [url (str "http://localhost:3000/dark-jedis/" id)
+            request (ajax/GET url :response-format :json :handler handle-sith-lord-response!)]
+        (assoc item :request request))
+      item)
+    item))
+
+(defn manage-requests! [coll current-planet]
+  (let [frozen (homeworld-matches? coll current-planet)
+        f (if frozen abort-request! start-request!)]
+    (vec (map f coll))))
+
+(defn accept-sith-lord [coll sith-lord]
   (let [sith-lord-id (get sith-lord "id")
         sith-lord-index (util/index-of (map :id coll) sith-lord-id)]
     (-> (vec coll)
-        (assoc sith-lord-index (sith-lord-item sith-lord))
-        (request-sith-lord! (inc sith-lord-index) (get-in sith-lord ["apprentice" "id"]))
-        (request-sith-lord! (dec sith-lord-index) (get-in sith-lord ["master" "id"])))))
+        (assoc sith-lord-index {:id (get sith-lord "id")
+                                :sith-lord sith-lord})
+        (assoc-pending-sith-lord (inc sith-lord-index) (get-in sith-lord ["apprentice" "id"]))
+        (assoc-pending-sith-lord (dec sith-lord-index) (get-in sith-lord ["master" "id"])))))

 (defn handle-sith-lord-response! [sith-lord]
-  (swap! coll accept-sith-lord! sith-lord))
-
-(defn abort-request! [item]
-  (if-let [request (:request item)]
-    (ajax/abort request)))
+  (swap! coll #(-> %
+                   (accept-sith-lord sith-lord)
+                   (manage-requests! @current-planet/state))))

 (defn scroll-once! [coll direction]
   (case direction
     :up (let [first-sith-lord (-> coll first :sith-lord)
               master-id (get-in first-sith-lord ["master" "id"])
-              master-request (sith-lord-request-item! master-id)]
+              master-item (pending-sith-lord-item master-id)]
           (abort-request! (peek coll))
-          (into [master-request] (pop coll)))
+          (into [master-item] (pop coll)))
     :down (let [last-sith-lord (-> coll last :sith-lord)
                 apprentice-id (get-in last-sith-lord ["apprentice" "id"])
-                apprentice-request (sith-lord-request-item! apprentice-id)]
+                apprentice-item (pending-sith-lord-item apprentice-id)]
             (abort-request! (nth coll 0))
-            (conj (subvec coll 1) apprentice-request))))
+            (conj (subvec coll 1) apprentice-item))))

 (defn scroll! [n direction]
   (swap! coll (fn [coll]
@@ -65,4 +75,9 @@

 (defn init! []
   (let [darth-sidious-id 3616]
-    (swap! coll #(request-sith-lord! % 0 darth-sidious-id))))
+    (swap! coll #(-> %
+                     (assoc-pending-sith-lord 0 darth-sidious-id)
+                     (manage-requests! @current-planet/state)))))
+
+(add-watch current-planet/state :current-planet-watcher
+           (fn [key a old-planet new-planet] (swap! coll manage-requests! new-planet)))


Doubled max points

Doubled max points

--- src/clojush/problems/boolean/rule30_dynamic.clj
+++ src/clojush/problems/boolean/rule30_dynamic.clj
@@ -81,7 +81,7 @@
                                   'in1)
                             (registered-for-stacks [:integer :boolean :exec]))

-   :max-points 512
+   :max-points 1024
    :max-genome-size-in-initial-program 128
    :evalpush-limit 2048
    :genetic-operator-probabilities {:alternation 0.2


(WIP) Add fancy window logging.

(WIP) Add fancy window logging.

--- samples/twitterbuzz/src/twitterbuzz/core.cljs
+++ samples/twitterbuzz/src/twitterbuzz/core.cljs
@@ -1,5 +1,20 @@
 (ns twitterbuzz.core
-  (:require [goog.net.Jsonp :as jsonp]))
+  (:require [goog.net.Jsonp :as jsonp]
+            [goog.debug :as debug]
+            [goog.debug.FancyWindow :as fancy]
+            [goog.debug.Logger :as logger]))
+
+;; Temporary way to see results
+(def debug-window
+  (let [w (goog.debug.FancyWindow. "Twitterbuzz")
+        _ (.setEnabled w true)
+        _ (.init w)]
+    w))
+
+(def log (logger/getLogger "Twitterbuzz Logger"))
+
+(defn show [x]
+  (.info log (debug/expose x)))

 (def twitter-uri (goog.Uri. "http://twitter.com/search.json"))

@@ -9,7 +24,7 @@
          callback))

 (defn my-callback [json]
-  (log json))
+  (show json))

 (retrieve (.strobj {"q" "clojure"}) my-callback)

@@ -26,4 +41,4 @@
   ;; if there are new tweets
   ;;   keywordize the JSON keys
   ;;   call every registered fn with the vector of maps of new tweets.
-  )+  )


Remove individual scroll sections on article view page

--- src-cljs/rmfu_ui/article.cljs
+++ src-cljs/rmfu_ui/article.cljs
@@ -46,12 +46,12 @@
                                                     (delete-article-by-id (session/get :article-id)))}
                                        "Delete"]]))
                                   [:h1.text-center (:title @article-state)]
-                                  [:div.pre-scrollable.borderbox
+                                  [:div.borderbox
                                    [:p (:content @article-state)]]
                                   [:p.greytext.displayinline (:author @article-state)] [:p.date.displayinline.pull-right (:created @article-state)]
                                   [:br]
                                   [:h4.greyheading "Category"]]
                                  [:h4.greyheading.text-center "Comments"]
                                  [:div
-                                  [:div.pre-scrollable.borderboxblack.whitebackground
+                                  [:div.borderboxblack.whitebackground
                                    [:div#disqus_thread]]]]])})))


[Fixes: #11586] Every element in a seq should have a unique :key

Signed-off-by: Andrea Maria Piana <39e16ece3c2d27e1889178b15ddb376e524032f8@gmail.com>

--- src/status_im/ui/screens/add_new/new_public_chat/view.cljs
+++ src/status_im/ui/screens/add_new/new_public_chat/view.cljs
@@ -92,6 +92,7 @@
        [chat-name-input topic error]]
       [react/view {:margin-top 32}
        (for [[section chats] (chat.models/chats)]
+         ^{:key section}
          [react/view
           [react/view {:margin-right               16 :padding-left            16 :padding-vertical 3
                        :border-bottom-width        1  :border-bottom-color     colors/gray-lighter


simpler code

simpler code

--- point-mutations/example.clj
+++ point-mutations/example.clj
@@ -1,18 +1,5 @@
-(ns point-mutations
-  (:require [clojure.string :refer [split]]))
+(ns point-mutations)

-(defn- nucleotides
-  [strand]
-  (rest (split strand #"")))
-
-(defn- matching?
-  [pair]
-  (= (first pair) (last pair)))
-
-(defn hamming-distance
-  [strand1 strand2]
-  (if (= (count strand1) (count strand2))
-    (->> (map vector (nucleotides strand1) (nucleotides strand2))
-         (remove #(matching? %1))
-         count)
-    nil))
+(defn hamming-distance [a b]
+  (when (= (count a) (count b))
+    (count (filter true? (map not= a b)))))


Learning clojure destructuring of parameters

--- hackerrank/functional_programming/clojure/clojure-koans/src/koans/14_destructuring.clj
+++ hackerrank/functional_programming/clojure/clojure-koans/src/koans/14_destructuring.clj
@@ -8,37 +8,41 @@

 (meditations
   "Destructuring is an arbiter: it breaks up arguments"
-  (= __ ((fn [[a b]] (str b a))
+  (= ":bar:foo" ((fn [[a b]] (str b a))
          [:foo :bar]))

   "Whether in function definitions"
   (= (str "First comes love, "
           "then comes marriage, "
           "then comes Clojure with the baby carriage")
-     ((fn [[a b c]] __)
+     ((fn [[a b c]] (str "First comes " a ", then comes " b ", then comes " c " with the baby carriage"))
       ["love" "marriage" "Clojure"]))

   "Or in let expressions"
   (= "Rich Hickey aka The Clojurer aka Go Time aka Macro Killah"
      (let [[first-name last-name & aliases]
            (list "Rich" "Hickey" "The Clojurer" "Go Time" "Macro Killah")]
-       __))
+       (str first-name " " last-name
+            (apply str (map #(str " aka " %) aliases)))))

   "You can regain the full argument if you like arguing"
   (= {:original-parts ["Stephen" "Hawking"] :named-parts {:first "Stephen" :last "Hawking"}}
      (let [[first-name last-name :as full-name] ["Stephen" "Hawking"]]
-       __))
+       {:original-parts full-name
+        :named-parts {:first first-name :last last-name}}))

   "Break up maps by key"
   (= "123 Test Lane, Testerville, TX"
      (let [{street-address :street-address, city :city, state :state} test-address]
-       __))
+       (str street-address ", " city ", " state)))

   "Or more succinctly"
   (= "123 Test Lane, Testerville, TX"
-     (let [{:keys [street-address __ __]} test-address]
-       __))
+     (let [{:keys [street-address city state]} test-address]
+       (str street-address ", " city ", " state)))

   "All together now!"
   (= "Test Testerson, 123 Test Lane, Testerville, TX"
-     (___ ["Test" "Testerson"] test-address)))
+     ((fn [[first-name last-name] {:keys [street-address city state]}]
+         (str first-name " " last-name ", " street-address ", " city ", " state)
+        )  ["Test" "Testerson"] test-address)))


added to need and necesitar

added to need and necesitar

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -808,7 +808,8 @@
    "nadar" {:synsem {:cat :verb
                       :sem {:pred :swim}}}

-   "necesitar" {}
+   "necesitar" {:synsem {:cat :verb
+                      :sem {:pred :need}}}

    "negar" {:espanol {:boot-stem "nieg"}
                 :synsem {:cat :verb


add (expression) function

add (expression) function

--- src/babel/francais/writer.clj
+++ src/babel/francais/writer.clj
@@ -6,12 +6,16 @@
 (require '[babel.francais.morphology :refer [analyze exception-generator
                                              fo]])
 (require '[babel.francais.pos :refer [intransitivize transitivize]])
-(require '[babel.writer :refer [delete-from-expressions process reload write-lexicon]])
+(require '[babel.writer :as writer :refer [process reload write-lexicon]])
 (require '[clojure.tools.logging :as log])
 (require '[dag-unify.core :refer (fail? get-in strip-refs unify)])

 (defn rewrite-lexicon []
   (write-lexicon "fr" @lexicon))
+
+(defn expression [& [spec]]
+  (let [spec (if spec spec :top)]
+    (writer/expression medium spec)))

 (defn tout [ & [count]]
   (let [count (if count (Integer. count) 10)


bulletproofing

bulletproofing

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- lein-light-nrepl/src/lighttable/nrepl/eval.clj
+++ lein-light-nrepl/src/lighttable/nrepl/eval.clj
@@ -109,9 +109,9 @@
       )))

 (defn prep-code [{:keys [code meta]}]
-  (if-not meta
+  (if-not (or meta (not (:start meta)))
     code
-    (str (reduce str "" (repeat (:start meta) "\n"))
+    (str (reduce str "" (repeat (:start meta 0) "\n"))
          code)))

 (defn watch [v meta]
@@ -151,10 +151,11 @@
         e-str (str e)]
     {:line (or (-> (re-seq #"starting at line ([\d]+)" e-str) first second)
                (:line pos)
-               (-> stack
-                   (find-eval-frame)
-                   (or (aget stack 0))
-                   (.getLineNumber)))}))
+               (when stack
+                 (-> stack
+                     (find-eval-frame)
+                     (or (aget stack 0))
+                     (.getLineNumber))))}))

 (defn normalize-ns [ns path]
   (let [ns (str ns)


remove drag when sidebar-open (easier to hit buttons)

--- src/braid/mobile/sidebar.cljs
+++ src/braid/mobile/sidebar.cljs
@@ -62,8 +62,7 @@
         touch-start!  (fn [e]
                         (let [x (.-clientX (aget (.-touches e) 0))
                               open? (get-open?)]
-                          (when (or (and (not @open?) (< x fudge-x))
-                                    (and @open? (< (- open-width fudge-x) x (+ open-width fudge-x))))
+                          (when (and (not @open?) (< x fudge-x))
                             (.stopPropagation e)
                             (drag-start! x))))


Upgrade Hello World version.

Upgrade Hello World version.

--- examples/hello-world/project.clj
+++ examples/hello-world/project.clj
@@ -1,10 +1,10 @@
-(defproject hello-world "0.43.3"
+(defproject hello-world "0.44.0"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.10.3"]
-                 [uncomplicate/neanderthal "0.43.3"]
+                 [uncomplicate/neanderthal "0.44.0"]
                  ;;Optional. If bytedeco is not present, a system-wide MKL is used.
-                 [org.bytedeco/mkl-platform-redist "2021.3-1.5.6"]]
+                 [org.bytedeco/mkl-platform-redist "2022.0-1.5.7"]]
   ;; Nvidia doesn't ship CUDA for macOS; you have to add this to your project
   :exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
                [org.jcuda/jcublas-natives :classifier "apple-x86_64"]]


apply current schema

apply current schema

--- src/clj/dbquery/databases.clj
+++ src/clj/dbquery/databases.clj
@@ -59,7 +59,7 @@
      (rs-rows rs row-reader offset limit)))
   ([rs] (read-as-map rs {})))

-(defn mk-ds [{:keys [dbms url user_name password]}]
+(defn mk-ds [{:keys [dbms url user_name password] :as params}]
   "Creates a datasource"
   (let [[driver jdbc-url]
         (case dbms
@@ -78,8 +78,10 @@
              (.setMaximumPoolSize 4)
              (.setIdleTimeout 180000)
              (.setMaxLifetime 300000))]
-    (if (= dbms "MS-SQL")
-      (.setConnectionTestQuery ds "SELECT GETDATE()"))
+    (case  dbms
+      "MS-SQL" (.setConnectionTestQuery ds "SELECT GETDATE()")
+      "ORACLE" (.setConnectionInitSql
+                ds (str "ALTER SESSION SET CURRENT_SCHEMA=" (or (:schema params) (:user_name params)))))
     (with-open [con (.getConnection ds)]
       ds)))


Avoid reserializing queries (until we implement a more readable serializer)

--- src/clj/sparqlab/exercise.clj
+++ src/clj/sparqlab/exercise.clj
@@ -63,11 +63,11 @@
         query-in-spin (sparql/query->spin (:query query))
         superfluous-prohibited (test-prohibited prohibited query-in-spin)
         missing-required (test-required required query-in-spin)]
-    {:canonical-query {:query (:query-string canonical-query)
+    {:canonical-query {:query canonical-query-string
                        :results canonical-results
                        :results-type (sparql/get-results-type (:query-type canonical-query))}
      :query {:missing-required missing-required
-             :query (:query-string query)
+             :query query-string
              :results query-results
              :results-type (sparql/get-results-type (:query-type query))
              :superfluous-prohibits superfluous-prohibited}


open story on press

open story on press

--- src/hackernews/shared/scenes/detail_view/detail_view.cljs
+++ src/hackernews/shared/scenes/detail_view/detail_view.cljs
@@ -4,6 +4,11 @@
             [hackernews.shared.components.story-row :as sr]
             [hackernews.shared.components.list :as l]
             [re-frame.core :refer [subscribe dispatch]]))
+
+(defn story-header
+  [story]
+  [rn/touchable-highlight {:on-press #(dispatch [:open-story-external (:id story)])}
+   (sr/story-row story)])

 (defn comment-row
   [{:keys [user time_ago content]}]
@@ -18,6 +23,6 @@
   [{:keys [id]}]
   [rn/view
    {:style {:margin-top 10}}
-   [sr/story-row @(subscribe [:get-story id])]
+   [story-header @(subscribe [:get-story id])]
    [l/list-view {::l/items @(subscribe [:story-flat-comments id])
                  ::l/render-row  comment-row}]])


Seems this is the way to go for re exporting symbols

--- src/clj_simple_chart/core.clj
+++ src/clj_simple_chart/core.clj
@@ -1,8 +1,11 @@
 (ns clj-simple-chart.core
   (:require [clojure.string :as string]
-            [clj-simple-chart.jfx :refer (render)]
-            [clj-simple-chart.scale.core :refer [scale]]
+            [clj-simple-chart.jfx :as jfx]
+            [clj-simple-chart.scale.core :as scale-core]
             [clj-simple-chart.ticks :as ticks]))
+
+(def scale scale-core/scale)
+(def render jfx/render)

 (defn svg-attrs
   [width height margin]


Change http query to idiomatic one

Change http query to idiomatic one

--- src/cljs/bartleby/events.cljs
+++ src/cljs/bartleby/events.cljs
@@ -3,36 +3,36 @@
   (:require [re-frame.core :as re-frame]
             [bartleby.db :as db]
             [cljs-http.client :as http]
+            [ajax.core :as ajax]
+            [day8.re-frame.http-fx]
             [cljs.core.async :refer [<!]]))
-
-(defn ^:export get-tasks []
-  (go (let [resp (<! (http/get "http://localhost:8080/tasks/" {:with-credentials? false}))
-            status (:status resp)]
-        (.info js/console status)
-        (when (= 200 status)
-          (re-frame/dispatch [:tasks-loaded (:body resp)])
-          (.info js/console "Tasks:\n")
-          (.info js/console (clojure.string/join "\n" (map (fn [task] (str (:description task))) (:body resp))))))))

 (re-frame/reg-event-db
  :initialize-db
  (fn [_ _]
-   (.info js/console "initialize-db")
    db/default-db))

-(re-frame/reg-event-db
+(re-frame/reg-event-fx
  :load-tasks
- (fn [db [_ _]]
-   (.info js/console "load-tasks")
-   (let [new-db (assoc db :loading true)]
-     (get-tasks)
-     new-db)))
+ (fn [{:keys [db]} _]
+   {:db (assoc db :rest "in progress")
+    :http-xhrio {:method :get
+                 :uri "/tasks/"
+                 :timeout 5000
+                 :response-format (ajax/json-response-format {:keywords? true})
+                 :on-success [:http-req-ok]
+                 :on-failure [:http-req-error]}}))

 (re-frame/reg-event-db
- :tasks-loaded
- (fn [db [_ tasks]]
-   (.info js/console "tasks loaded")
-   (assoc db :tasks tasks)))
+ :http-req-ok
+ (fn [db [_ result]]
+   (merge db {:tasks result
+              :rest "ok"})))
+
+(re-frame/reg-event-db
+ :http-req-error
+ (fn [db [_ result]]
+   (merge db {:rest "error"})))

 (re-frame/reg-event-db
  :task-toggle-done


Improved a way for inster the bc provider.

--- src/clojure/buddy/hashers.clj
+++ src/clojure/buddy/hashers.clj
@@ -25,8 +25,8 @@
            org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator
            buddy.impl.bcrypt.BCrypt))

-(java.security.Security/addProvider
- (org.bouncycastle.jce.provider.BouncyCastleProvider.))
+(when (nil? (Security/getProvider "BC"))
+  (Security/addProvider (org.bouncycastle.jce.provider.BouncyCastleProvider.)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Constants


Add missing deprecation note.

Add missing deprecation note.


Add missing default iteration number for pbkdf2+sha512

--- src/clojure/buddy/hashers.clj
+++ src/clojure/buddy/hashers.clj
@@ -34,6 +34,7 @@
   +iterations+
   {:pbkdf2+sha1 100000
    :pbkdf2+sha256 100000
+   :pbkdf2+sha512 100000
    :pbkdf2+blake2b-512 50000
    :pbkdf2+sha3_256 5000
    :pbkdf2+sha3-256 5000


Rename function

Rename function

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -21,16 +21,16 @@
     (.setText "")
     (.setCaretPosition 0)))

-(defn var-node
-  [{:keys [name] :as node}]
-  (proxy [DefaultMutableTreeNode] [node]
+(defn file-node
+  [{:keys [name] :as file}]
+  (proxy [DefaultMutableTreeNode] [file]
     (isLeaf [] true)
     (toString [] name)))

 (defn commit-node
   [[{:keys [name] :as commit} files]]
   (proxy [DefaultMutableTreeNode] []
-    (getChildAt [i] (var-node (nth files i)))
+    (getChildAt [i] (file-node (nth files i)))
     (getChildCount [] (count files))
     (toString [] name)))


add missing date parameter

add missing date parameter

--- test/clj_money/permissions/attachments_test.clj
+++ test/clj_money/permissions/attachments_test.clj
@@ -108,7 +108,8 @@
         image (find-image context "sample_receipt.jpg")
         attachment (tag-resource {:image-id (:id image)
                                   :caption "other receipt"
-                                  :transaction-id (:id transaction)}
+                                  :transaction-id (:id transaction)
+                                  :transaction-date (:transaction-date transaction)}
                                  :attachment)]
     (testing "A user has permission to create a attachments in his own entities"
       (with-authentication john


Get spelling closer.

Get spelling closer.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -93,7 +93,7 @@
   (->> notes
        (map (partial where :pitch #(+ % 5)))))

-(def balendorc
+(def balendoro
   (->> [tete ta ha tulule bongo
         (up tete) (up ta) (up ha) (up tulule) (up bongo)
         (up (up tete)) (up (up ta)) (up (up ha)) (up (up tulule)) (up (up bongo))
@@ -107,7 +107,7 @@
   (fx-reverb)
   (map fx-distortion [0 1])
   (->>
-    balendorc
+    balendoro
     (where :pitch (comp temperament/equal A inverse-pentatonic))
     (tempo (bpm 120))
     (live/play)


Added FirstCreated and LastModified fields when inserting records.

--- src/com/lemondronor/orbital_detector/updatedb.clj
+++ src/com/lemondronor/orbital_detector/updatedb.clj
@@ -25,7 +25,9 @@
     UserTag       - Agency
     ModeSCountry  - \"United States\"
     Registration  - Registration code"
-  (:require [clojure.data.csv :as csv]
+  (:require [clj-time.format :as timefmt]
+            [clj-time.local :as timelocal]
+            [clojure.data.csv :as csv]
             [clojure.java.io :as io]
             [clojure.java.jdbc :as jdbc]
             [com.lemondronor.orbital-detector.basestationdb :as basestationdb]))
@@ -75,8 +77,14 @@
     (basestationdb/update-aircraft! db-conn (:ICAO csv-rec) values)))

+
 (defn insert-aircraft! [db-conn csv-rec]
-  (let [values (assoc (db-values csv-rec)
+  (let [now (timefmt/unparse
+             ;; 2015-03-20 11:39:00
+             (timefmt/formatters :basic-date-time-no-ms) (timelocal/local-now))
+        values (assoc (db-values csv-rec)
+                      :FirstCreated now
+                      :LastModified now
                       :modes (:ICAO csv-rec))]
     (println "INSERTING:" values)
     (basestationdb/insert-aircraft! db-conn values)))


Removes TODO that was no longer valid

Removes TODO that was no longer valid

--- src/hundred_pushups/core.cljc
+++ src/hundred_pushups/core.cljc
@@ -157,7 +157,6 @@
      (for [[k v]  (into [] (:plank-reps-text ui-state))]
        [[k :exr/plank-reps] v] )))

-;; TODO - rename to circuit?
 (defn merge-day-changes [day ui-state ts]
   (reduce
    (fn [log [path v]]


Refactoring: read-from-product-table - read-product-name and read-product-description

--- src/hurvinek/db_interface.clj
+++ src/hurvinek/db_interface.clj
@@ -27,18 +27,28 @@
             (println e)
             nil)))

+(defn read-from-product-table
+    "Read selected column from the given product id."
+    [product-id what]
+    (try
+        (->
+            (jdbc/query db-spec/hurvinek-db
+                            [(str "select " (name what) " from products where id=?") product-id])
+            first
+            (get what))
+        (catch Exception e
+            (println e)
+            nil)))
+
 (defn read-product-name
     "Read name of product for the given product id."
     [product-id]
-    (try
-        (->
-            (jdbc/query db-spec/hurvinek-db
-                            ["select name from products where id=?" product-id])
-            first
-            (get :name))
-        (catch Exception e
-            (println e)
-            nil)))
+    (read-from-product-table product-id :name))
+
+(defn read-product-description
+    "Read description of product for the given product id."
+    [product-id]
+    (read-from-product-table product-id :description))

 (defn read-chapter-name
     "Read name of chapter for the given chapter id."


fix: [bug] transaction: wrong date getting updated during edit transaction

--- src/cljs/expense_tracker/transaction/add.cljs
+++ src/cljs/expense_tracker/transaction/add.cljs
@@ -70,7 +70,9 @@
                                       update-in [:trans]
                                       conj (atom (new-trans to-from))))
             (datepicker [] (.datepicker (jq/$ "#trans-date")))
-            (snn [] (let [date (trim-empty? (u/jq->long (.-value (u/by-id "trans-date"))) :date)
+            (snn [] (let [date (let [d (trim-empty? (.-value (u/by-id "trans-date")) :date)
+                                     dt (u/jq->long d)]
+                                 (if (= dt "Invalid date") d dt))
                           desc (trim-empty? (.-value (u/by-id "trans-desc")) :desc)]
                       (cond (or (zero? (:to @app-state))
                                 (zero? (:from @app-state))


Extract help vs run

Extract help vs run

--- src/desdemona/launcher/aeron_media_driver.clj
+++ src/desdemona/launcher/aeron_media_driver.clj
@@ -27,13 +27,11 @@
            (throw (Exception. aeron-launch-error-message ise))))))

 (defn -main [& args]
-  (let [opts (parse-opts args cli-options)
-        {:keys [help delete-dirs]} (:options opts)]
-    (when help
-      (run! (fn [opt]
-              (println (clojure.string/join " " (take 3 opt))))
-            cli-options)
-      (System/exit 0))
-    (run-media-driver!)
-    (println "Launched the Media Driver. Blocking forever...")
-    (<!! (chan))))
+  (let [opts (parse-opts args cli-options)]
+    (if (-> opts :options :help)
+      (do (run! (fn [opt]
+                  (println (clojure.string/join " " (take 3 opt))))
+                cli-options))
+      (do (run-media-driver!)
+          (println "Launched the Media Driver. Blocking forever...")
+          (<!! (chan))))))


Make parameter-object public

Make parameter-object public

--- src/io/aviso/rook/swagger.clj
+++ src/io/aviso/rook/swagger.clj
@@ -59,9 +59,9 @@
     (str/join "/")
     (str "/")))

-;; Revisit order of parameters in these for ease of ->> threading; should swagger-object always be the last?
-
-(defn- parameter-object
+(defn parameter-object
+  "Creates a parameter object, as part of an operation."
+  {:added "0.1.29"}
   [parameter-name location required? description]
   (cond-> {:name (name parameter-name)
            :type :string                                    ; may add something later to refine this


figure out how to reduce the results of processing upstream updates into a single batch to send downstream

--- src/main/clojure/org/dada/core/PivotModelView.clj
+++ src/main/clojure/org/dada/core/PivotModelView.clj
@@ -134,20 +134,21 @@
   ;; increment version
   ;; keep input and output models
   ;; send insertion/alteration upstream
-  [[nil nil nil]])
+  [nil nil nil])

 (defn process-deletion [in-extant in-extinct out-extant out-extinct pivot-fn deletion]
-  [[nil nil nil]])
+  [nil nil nil])

 (defn process-update [in-extant in-extinct out-extant out-extinct pivot-fn
 		      insertions alterations deletions]
   ;;TODO - sort out state required...
-  (map
-   identity ;; TODO - sort out reduction of list
+  (reduce
+   (fn [[oi oa od] [ii ia id]] [(if ii (concat ii oi) oi) (if ia (concat ia oa) oa) (if id (concat id od) od)])
+   [nil nil nil]
    (concat
-    (map #(process-addition %) in-extant in-extinct out-extant out-extinct pivot-fn insertions)
-    (map #(process-addition %) in-extant in-extinct out-extant out-extinct pivot-fn alterations)
-    (map #(process-deletion %) in-extant in-extinct out-extant out-extinct pivot-fn deletions))))
+    (map #(process-addition in-extant in-extinct out-extant out-extinct pivot-fn %) insertions)
+    (map #(process-addition in-extant in-extinct out-extant out-extinct pivot-fn %) alterations)
+    (map #(process-deletion in-extant in-extinct out-extant out-extinct pivot-fn %) deletions))))

 (defn -getData [this]
   (let [[[in-extant in-extinct out-extant out-extinct]] @(.state this)]


Доработки

Доработки

--- radiolamp-6P3S/src/ixinfestor/omut.cljs
+++ radiolamp-6P3S/src/ixinfestor/omut.cljs
@@ -2207,7 +2207,7 @@
 ;;**************************************************************************************************

 (defn ui-panel [{:keys [heading heading-glyphicon badge
-                        body after-body type]}]
+                        body after-body type style]}]
   (dom/div #js {:className (str "panel panel-"
                                 (get {:default "default"
                                       :primary "primary"
@@ -2215,7 +2215,8 @@
                                       :info "info"
                                       :warning "warning"
                                       :danger "danger"
-                                      } type "default"))}
+                                      } type "default"))
+                :style style}
            (when heading
              (dom/div #js {:className "panel-heading"}
                       (when heading-glyphicon


fixed date sync

fixed date sync

--- src/frontend/cljs/alibi/activity_graphic.cljs
+++ src/frontend/cljs/alibi/activity_graphic.cljs
@@ -228,7 +228,7 @@
                     :y (+ y-offset
                           (drawing-const
                             [:grid-day-label :height-px]))
-                    :on-click #(on-change-date date)}
+                    :onClick #(on-change-date date)}
                    (-> (. LocalDate ofInstant left-instant)
                        date->grid-label)))))))
     (draw-result-add-to-y


add veintiuna in numbers for ES

add veintiuna in numbers for ES

--- resources/duckling/rules/es.numbers.clj
+++ resources/duckling/rules/es.numbers.clj
@@ -31,10 +31,10 @@
    :value (+ (:value %1) (:value %3))}

   "number (16..19 21..29)"
-  #"(?i)(die(c|s)is(é|e)is|diecisiete|dieciocho|diecinueve|veintiuno|veintidos|veintitr(é|e)s|veinticuatro|veinticinco|veintis(é|e)is|veintisiete|veintiocho|veintinueve)"
+  #"(?i)(die(c|s)is(é|e)is|diecisiete|dieciocho|diecinueve|veintiun(o|a)|veintidos|veintitr(é|e)s|veinticuatro|veinticinco|veintis(é|e)is|veintisiete|veintiocho|veintinueve)"
   {:dim :number
    :integer true
-   :value (get {"dieciseis"16 "diesiseis"  16 "diesiséis"  16 "dieciséis" 16 "diecisiete" 17 "dieciocho" 18 "diecinueve" 19 "veintiuno" 21 "veintidos" 22 "veintitres" 23 "veintitrés" 23 "veinticuatro" 24 "veinticinco" 25
+   :value (get {"dieciseis"16 "diesiseis"  16 "diesiséis"  16 "dieciséis" 16 "diecisiete" 17 "dieciocho" 18 "diecinueve" 19 "veintiuno" 21 "veintiuna" 21 "veintidos" 22 "veintitres" 23 "veintitrés" 23 "veinticuatro" 24 "veinticinco" 25
               "veintiseis" 26 "veintiséis" 26 "veintisiete" 27 "veintiocho" 28 "veintinueve" 29}
               (-> %1 :groups first .toLowerCase))}


Add configuration to plot the data with Highcharts.


CMR-5848 Fix mime-type references.

CMR-5848 Fix mime-type references.

--- virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj
+++ virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj
@@ -5,7 +5,6 @@
    [cmr.common.concepts :as concepts]
    [cmr.common.log :refer (debug info warn error)]
    [cmr.common.mime-types :as mime-types]
-   [cmr.common.mime-types :as mt]
    [cmr.common.services.errors :as errors]
    [cmr.common.util :as u :refer [defn-timed]]
    [cmr.message-queue.config :as queue-config]
@@ -122,9 +121,9 @@
   (let [provider-id (svm/provider-alias->provider-id provider-id)
         orig-concept (mdb/get-concept context concept-id revision-id)
         format (-> (:format orig-concept)
-                   mt/base-mime-type-of)
+                   mime-types/base-mime-type-of)
         ;; If the format is umm-json, we need to use umm-spec to parse the metadata into UMM.
-        orig-umm (if (= format mt/umm-json)
+        orig-umm (if (= format mime-types/umm-json)
                    (umm-spec/parse-metadata context (:concept-type orig-concept) format (:metadata orig-concept))
                    (umm/parse-concept orig-concept))
         vp-config (svm/source-to-virtual-product-mapping [provider-id entry-title])
@@ -135,7 +134,7 @@
       (let [new-umm (svm/generate-virtual-granule-umm provider-id source-short-name
                                                       orig-umm virtual-coll)
             new-granule-ur (:granule-ur new-umm)
-            new-metadata (if (= format mt/umm-json)
+            new-metadata (if (= format mime-types/umm-json)
                            (umm-spec/generate-metadata context new-umm (mime-types/mime-type->format
                                                                          (:format orig-concept)))
                            (umm/umm->xml new-umm (mime-types/mime-type->format


CMR-5071 Test fix.

CMR-5071 Test fix.

--- umm-spec-lib/src/cmr/umm_spec/umm_g/granule.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_g/granule.clj
@@ -106,4 +106,5 @@
      :Platforms (platform/PlatformRefs->umm-g-platforms platform-refs)
      :CloudCover cloud-cover
      :Projects (project/ProjectRefs->umm-g-projects project-refs)
-     :TilingIdentificationSystem (tiling-system/TwoDCoordinateSystem->umm-g-tiling-identification-system)}))
+     :TilingIdentificationSystem (tiling-system/TwoDCoordinateSystem->umm-g-tiling-identification-system
+                                  two-d-coordinate-system)}))


log requests to darwin

log requests to darwin


Handle form-2 and form-3 components

Handle form-2 and form-3 components


Duplicate lines (typo)

Duplicate lines (typo)

--- src/clj/clojurewerkz/statistiker/metrics.clj
+++ src/clj/clojurewerkz/statistiker/metrics.clj
@@ -90,8 +90,6 @@
   [U V]
   {:pre [(= (count U) (count V))
          (not-any? coll? U)
-         (not-any? coll? V)
-         (not-any? coll? U)
          (not-any? coll? V)]}
   (if (or (empty? U)
           (= 1 (count (distinct U)) (count (distinct V)))          ;only one cluster


Expand require statements for searchability.

--- src/wonko/export/prometheus.clj
+++ src/wonko/export/prometheus.clj
@@ -2,9 +2,8 @@
   (:require [clojure.string :as s]
             [kits.logging.log-async :as log]
             [ring.util.response :as res]
-            [wonko.export.prometheus
-             [create :as create]
-             [register :as register]]
+            [wonko.export.prometheus.create :as create]
+            [wonko.export.prometheus.register :as register]
             [wonko.test-utils :as tu])
   (:import [io.prometheus.client CollectorRegistry Counter Gauge Histogram]
            io.prometheus.client.exporter.common.TextFormat


BIG in bad prisoner: snapshot stack becomes 17M items long, despite (nominally?) checking


fixing freenas test

fixing freenas test


skipping check for now

skipping check for now

--- test/celestial/test/proxmox.clj
+++ test/celestial/test/proxmox.clj
@@ -18,13 +18,10 @@
     )

-; not sure why but with-redefs dose not work
-(alter-var-root (var prox-get) (fn [_] (fn [_] (throw+ {:status 500}))))
-
 (with-redefs [config local-prox]
   (let [ct (vconstruct (assoc-in redis-prox-spec [:proxmox :features] ["nfs:on"]))]
     (expect
       (interaction (vzctl ct "set 33 --features \"nfs:on\" --save"))
       (enable-features ct))
-
-    (expect false (.status ct))))
+    ; (expect false (.status ct)) redef does not work
+    ))


Improve test comments.

Improve test comments.


whole thing is working now

whole thing is working now

--- server/src/gratefulplace/controllers/posts.clj
+++ server/src/gratefulplace/controllers/posts.clj
@@ -30,9 +30,8 @@

   :exists? record-in-ctx

-  :put! (fn [_]
-          ;; {:db/id 17592186045495 :post/content "test"
-          (db/t [(c/mapify params mr/post->txdata)]))
+  :put! (fn [_] (db/t [(c/mapify params mr/post->txdata)]))
+  :post! (fn [_] (db/t [(c/mapify params mr/post->txdata)]))
   :new? false
   :respond-with-entity? true
   :handle-ok (fn [_] (record (id))))


More changes to try and fix the build.

More changes to try and fix the build.

--- dev-system/project.clj
+++ dev-system/project.clj
@@ -63,7 +63,9 @@
                  [nasa-cmr/cmr-virtual-product-app "0.1.0-SNAPSHOT"]
                  [nasa-cmr/cmr-search-app "0.1.0-SNAPSHOT"]
                  [nasa-cmr/cmr-system-int-test "0.1.0-SNAPSHOT"]
-                 [nasa-cmr/cmr-common-lib "0.1.1-SNAPSHOT"]]
+                 [nasa-cmr/cmr-common-lib "0.1.1-SNAPSHOT"]
+
+                 [org.clojure/tools.nrepl "0.2.11"]]

   :plugins [[lein-shell "0.4.0"]


Basic generation working with new schema

--- src/de/sveri/clospcrud/db_code_generator.clj
+++ src/de/sveri/clospcrud/db_code_generator.clj
@@ -43,5 +43,5 @@
         file (io/file fp-path)
         new-content (add-db-to-entities file (:name dataset))]
     (spit file new-content)
-    (println "Generated db entities file.")))
+    (println "Added entity to entities file.")))


Migrated html generation to use frames

Migrated html generation to use frames

--- doclet/src/clojure/play_clj_doclet/html.clj
+++ doclet/src/clojure/play_clj_doclet/html.clj
@@ -20,7 +20,7 @@
      (cons [:div {:class "ns"} ns]
            (for [{:keys [name]} groups]
              [:div {:class "name"}
-              [:a {:href (str->filename ns name)}
+              [:a {:href (str->filename ns name) :target "content-frame"}
                name]])))])

 (defn java-param
@@ -61,14 +61,13 @@
      [:pre raw]]]])

 (defn create-site-file
-  [name sidebar content]
+  [name content]
   (html [:html
          [:head
           [:title name]
           [:link {:rel "stylesheet" :href "highlight.css"}]
           [:link {:rel "stylesheet" :href "main.css"}]]
          [:body
-          sidebar
           content
           [:script {:src "highlight.js"}]
           [:script {:src "main.js"}]]]))
@@ -82,6 +81,12 @@
   (spit (io/file dir file-name)
         (-> file-name io/resource slurp)))

+(defn index-frameset
+  []
+  (html [:frameset
+         [:frame {:src "sidebar.html"}
+          :frame {:name "content-frame"}]]))
+
 (defn create-site!
   [dir parsed-files]
   (.mkdir (io/file dir))
@@ -92,9 +97,11 @@
   (doseq [[ns groups] parsed-files]
     (doseq [{:keys [name] :as group} groups]
       (spit (io/file dir (str->filename ns name))
-            (create-site-file name (sidebar parsed-files) (content group)))))
+            (create-site-file name (content group)))))
+  (spit (io/file dir "sidebar.html")
+        (sidebar parsed-files))
   (spit (io/file dir "index.html")
-        (create-site-file "play-clj docs" (sidebar parsed-files) nil))
+        (create-site-file "play-clj docs" (index-frameset)))
   (println "Created" (str dir "/")))

 (defn create-embed!


Implementgin the getQName method

Implementgin the getQName method

--- src/app/javaparser.clj
+++ src/app/javaparser.clj
@@ -144,22 +144,36 @@
     (packageName (.variable this))))

 (defprotocol Named
-  (getName [this]))
+  (getName [this])
+  (getQName [this]))

 (extend-protocol Named
   TypeDeclaration
   (getName [this]
-    (.getName this)))
+    (.getName this))
+  (getQName [this]
+    (let
+      [pn (packageName this),
+       cn (getName this)]
+      (if (.isEmpty pn)
+        cn
+        (str pn "." cn)))))

 (extend-protocol Named
   EnumConstantDeclaration
   (getName [this]
-    (.getName this)))
+    (.getName this))
+  (getQName [this]
+    (let [pn (.getParentNode this)]
+      (str (getQName pn) "." (getName this)))))

 (extend-protocol Named
   MethodDeclaration
   (getName [this]
-    (.getName this)))
+    (.getName this))
+  (getQName [this]
+    (let [pn (.getParentNode this)]
+      (str (getQName pn) "." (getName this)))))

 (extend-protocol Named
   VariableDeclaratorId


+other language models besides medium

+other language models besides medium

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -3,7 +3,7 @@
   (:require
    [babel.engine :as engine]
    [babel.forest :as forest]
-   [babel.english.grammar :refer [medium]]
+   [babel.english.grammar :refer [medium small-plus-vp-pronoun small-plus-plus-np]]
    [babel.english.morphology :as morph :refer [fo]]
    [babel.parse :as parse]
    [clojure.string :as string]


[lein] bump nrepl

[lein] bump nrepl

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,5 +1,5 @@
 {:user {:plugins [; https://github.com/clojure-emacs/cider-nrepl#via-leiningen
-                  [cider/cider-nrepl                 "0.19.0"]
+                  [cider/cider-nrepl                 "0.21.1"]
                   [refactor-nrepl                    "2.4.0"]

                   [lein-cloverage                    "1.0.13"]


hotfix pagination bug caused by changes to select control

--- src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table.cljs
@@ -11,6 +11,7 @@
     ))

+(def ^:private rows-per-page-options [10 25 100 500])
 (def ^:private initial-rows-per-page 10)

 (defn- create-page-range [current-page total-pages]
@@ -34,7 +35,7 @@
       :current-page 1
       :num-rows-visible (:num-total-rows props)})
    :render
-   (fn [{:keys [props state refs]}]
+   (fn [{:keys [props state]}]
      (let [rows-per-page (:rows-per-page @state)
            current-page (:current-page @state)
            num-rows-visible (:num-rows-visible @state)
@@ -86,12 +87,11 @@
                         :padding "2.15em 0em" :textAlign "right"}}
           "Display"
           (style/create-select
-           {:style {:width 60 :margin "0em 1em"} :ref "numRows"
+           {:style {:width 60 :margin "0em 1em"}
             :onChange #(swap! state assoc
-                              :rows-per-page (js/parseInt
-                                               (-> (@refs "numRows") .getDOMNode .-value))
+                              :rows-per-page (nth rows-per-page-options (-> % .-target .-value js/parseInt))
                               :current-page 1)}
-            [10 25 100 500])
+            rows-per-page-options)
           "rows per page"]
          (common/clear-both)]]))
    :component-did-update


remove comments

remove comments

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -74,16 +74,6 @@
           [:a {:href "/" :target "_self"}
            (common/icon :logomark-precursor)
            [:span "Precursor"]]
-          ;; hide extra buttons until there's features to back them up
-          ;; [:button
-          ;;  (common/icon :user)
-          ;;  [:span "Login"]]
-          ;; [:button
-          ;;  (common/icon :download)
-          ;;  [:span "Download"]]
-          ;; [:button.collaborators
-          ;;  (common/icon :users)
-          ;;  [:span "Collaborators"]]
           (let [show-mouse? (get-in app [:subscribers client-id :show-mouse?])]
             [:button {:title "You're viewing this document. Try inviting others. Click to toggle sharing your mouse position."
                       :on-click #(put! controls-ch [:show-mouse-toggled {:client-uuid client-id :show-mouse? (not show-mouse?)}])}
@@ -103,20 +93,4 @@
            (om/build chat-aside {:db (:db app)
                                  :client-uuid (:client-uuid app)
                                  :chat-body (get-in app [:chat :body])
-                                 :aside-menu-opened (get-in app state/aside-menu-opened-path)})]
-          ; [:div.aside-settings
-          ;  [:button {:disabled "true"}
-          ;   (common/icon :settings)
-          ;   [:span "Settings"]]
-          ; [:div.settings-menu
-          ;  [:button {:on-click #(put! controls-ch [:show-grid-toggled])}
-          ;   [:span "Show Grid"]
-          ;   (if show-grid?
-          ;     (common/icon :check)
-          ;     (common/icon :times))]
-          ;  [:button {:on-click #(put! controls-ch [:night-mode-toggled])}
-          ;   [:span "Night Mode"]
-          ;   (if night-mode?
-          ;     (common/icon :check)
-          ;     (common/icon :times))]]]
-          ])))))
+                                 :aside-menu-opened (get-in app state/aside-menu-opened-path)})]])))))


Closing connect-ch better.

Closing connect-ch better.

--- src/cbfg/net-test.cljs
+++ src/cbfg/net-test.cljs
@@ -47,6 +47,7 @@
                     (aput tn listen-ch [:addr-a 1000 accept-ch2]) ; 2nd listen on same addr/port should fail.
                     (and (e n (atake tn accept-ch2) nil nil)
                          (do (aclose tn listen-ch)
+                             (aclose tn connect-ch)
                              (and (e n (atake tn accept-ch) nil nil)
                                   (e n (atake tn net) :done (atake tn net))))))
                   (let [listen-ch (achan tn)
@@ -56,6 +57,7 @@
                     (aput tn connect-ch [:addr-a 1000 :addr-x connect-result-ch])
                     (and (e n (atake tn connect-result-ch) nil nil)
                          (do (aclose tn listen-ch)
+                             (aclose tn connect-ch)
                              (e n (atake tn net) :done (atake tn net))))))
            "pass"
            (str "FAIL: on test-net #" @n)))))


Using areq in more places.

Using areq in more places.

--- src/cbfg/world/t2.cljs
+++ src/cbfg/world/t2.cljs
@@ -48,19 +48,12 @@
 (defn rq-authenticate [actx m]
   (act rq-authenticate actx
        (let [{:keys [server-state-ch lane-state-ch realm user]} m
-             res-ch (achan rq-authenticate)]
-         (if (aput rq-authenticate server-state-ch
-                   (assoc m :op :authenticate :res-ch res-ch))
-           (let [res (atake rq-authenticate res-ch)]
-             (when (= (:status res) :ok)
-               (let [res-ch (achan rq-authenticate)]
-                 (aput rq-authenticate lane-state-ch
-                       (assoc m :op :update-cred :res-ch res-ch
-                              :cred {:realm realm :user user}))
-                 (atake rq-authenticate res-ch)))
-             res)
-           (assoc (dissoc m :pswd)
-             :status :failed :status-info [:authenticate :closed])))))
+             res (areq rq-authenticate server-state-ch
+                       (assoc m :op :authenticate))]
+         (if (= (:status res) :ok)
+           (areq rq-authenticate lane-state-ch
+                 (assoc m :op :update-cred :cred {:realm realm :user user}))
+           res))))

 ; --------------------------------------------


fixes word alignment in builds table (#1736)

--- src-cljs/frontend/components/builds_table.cljs
+++ src-cljs/frontend/components/builds_table.cljs
@@ -158,7 +158,7 @@
                 {:title (str "Started: " (datetime/full-datetime (js/Date.parse (:start_time build))))}
                 [:i.material-icons "today"]
                 (om/build common/updating-duration {:start (:start_time build)} {:opts {:formatter datetime/time-ago-abbreviated}})
-                " ago"]
+                [:span " ago"]]
                [:span.metadata-item.recent-time.duration
                 {:title (str "Duration: " (build-model/duration build))}
                 [:i.material-icons "timer"]


Docstrings for modal components

Docstrings for modal components

--- src-cljs/frontend/components/pieces/modal.cljs
+++ src-cljs/frontend/components/pieces/modal.cljs
@@ -6,7 +6,15 @@
             om.next)
   (:require-macros [frontend.utils :refer [component element html]]))

-(defn dialog [{:keys [title body actions close-fn]}]
+(defn dialog
+  "A dialog box suitable for presenting in a modal.
+
+  :title    - Text that appears in the header of the dialog.
+  :body     - The body of the dialog.
+  :actions  - A sequence of action elements, typically buttons, which will appear
+              along the bottom of the dialog.
+  :close-fn - A function to call when the close button is clicked."
+  [{:keys [title body actions close-fn]}]
   (component
     (html
      [:div
@@ -19,7 +27,15 @@
          (for [action actions]
            [:.action action])])])))

-(defn modal [{:keys [shown? close-fn]} content]
+(defn modal
+  "A modal presentation. The given content will be displayed centered over a
+  darkened background.
+
+  :shown?   - When true, the modal is displayed. When false, it isn't. When this
+              value changes, the modal will animate in or out.
+  :close-fn - A function to call when the background is clicked. Typically
+              causes :shown? to become false and the modal to disappear."
+  [{:keys [shown? close-fn]} content]
   (component
     (js/React.createElement
      js/React.addons.CSSTransitionGroup
@@ -36,7 +52,10 @@
            [:.box
             content]]))))))

-(defn modal-dialog [opts]
+(defn modal-dialog
+  "A dialog displayed in a modal presentation. Takes the props that both
+  components take, in a single map; :close-fn is the same for both."
+  [opts]
   (modal (select-keys opts [:shown? :close-fn])
          (dialog (select-keys opts [:title :body :actions :close-fn]))))


Document beckon.

Document beckon.

--- src/clojure/beckon.clj
+++ src/clojure/beckon.clj
@@ -1,26 +1,60 @@
 (ns beckon
   (:import (com.hypirion.beckon SignalAtoms SignalRegisterer)))

-(defn signal-atom [signal-name]
+(defn signal-atom
+  "Returns the beckon atom of the signal with the name signal-name. The changes
+  in the atom returned is reflected back to the signal handling, but NOT vice
+  versa.
+
+  A beckon atom is an atom containing a Seqable Clojure collection, where all
+  the elements in the Seqable collection must be Callable. Clojure functions are
+  by default Callable if they take zero arguments. By default would a beckon
+  atom be a Clojure List with the default signal handler wrapped within a
+  Callable.
+
+  The signal handling of a (modified) beckon atom is as follows: The first
+  element in the sequence is called. If the element returns a truthy value, the
+  next element will be called in the same fashion. If the element returns a
+  falsey value or throws an Exception, the handling will stop and no more
+  elements will be called. A default signal handler will always return true
+  unless it throws an Exception. If the signal handler throws an Error, that
+  Error will not be caught.
+
+  signal-name must be a legal POSIX signal, where SIG is omitted from the first
+  part of the name."
+  [signal-name]
   (SignalAtoms/getSignalAtom signal-name))

-(defn raise! [signal-name]
+(defn raise!
+  "Raises a signal of the type specified. Consequently, the signal will also be
+  handled by the signal handling procedure.
+
+  signal-name must be a legal POSIX signal, where SIG is omitted from the first
+  part of the name."
+  [signal-name]
   (SignalRegisterer/raiseSignal signal-name))

-(defn re-init! [signal-name]
+(defn reinit!
+  "Reinitialises the signal handler to the signal name, just as it were at the
+  start of this JVM process."
+  [signal-name]
   (SignalRegisterer/resetDefaultHandler signal-name))

-(defn re-init-all! []
+(defn reinit-all!
+  "Reintializes all signal handlers handled by beckon to their default values."
+  []
   (SignalRegisterer/resetAllHandlers))

 (defn always-true
   "Takes a function of no arguments, and returns a function taking no arguments
-  which calls f and returns true. f has presumably side effects."
+  which calls f and returns true. f has presumably side effects. Will not handle
+  throwables."
   [f]
   (fn [] (f) true))

 (defn always-false
   "Takes a function of no arguments, and returns a function taking no arguments
-  which calls f and returns false. f has presumably side effects."
+  which calls f and returns false. f has presumably side effects. Will not
+  handle throwables."
   [f]
   (fn [] (f) false))


update project

update project

--- src/leiningen/new/clanhr_service/project.clj
+++ src/leiningen/new/clanhr_service/project.clj
@@ -1,5 +1,12 @@
 (defproject {{name}} "1.0.0-SNAPSHOT"
   :description "{{upper-name}} service"
+
+  :license {:name         "The MIT License"
+            :url          "file://LICENSE"
+            :distribution :repo
+            :comments     "Copyright Selfcare All Rights Reserved."}
+
+  :min-lein-version "2.5.0"

   :dependencies [[environ "1.0.0"]
                  [org.clojure/clojure "1.7.0"]
@@ -33,7 +40,7 @@

   :main clanhr.{{sanitized}}.controllers.routes
   :ring {:handler clanhr.{{sanitized}}.controllers.routes/app}
-  :uberjar-name "clanhr.{{sanitized}}.jar"
+  :uberjar-name "clanhr.{{name}}.jar"

   :profiles {:uberjar {:aot :all
                        :env {:gateway-provider :postgres}}


send step-running event later to make sure the kill-event doesn't happen before we want it to (#85)

--- src/clj/lambdacd/internal/execution.clj
+++ src/clj/lambdacd/internal/execution.clj
@@ -3,7 +3,7 @@
   (:require [clojure.core.async :as async]
             [lambdacd.internal.pipeline-state :as pipeline-state]
             [clojure.tools.logging :as log]
-            [lambdacd.step-id :as step-id]
+            [lambdacd.internal.step-id :as step-id]
             [lambdacd.steps.status :as status]
             [clojure.repl :as repl]
             [lambdacd.event-bus :as event-bus])
@@ -89,8 +89,7 @@

 (defn execute-step [args [ctx step]]
-  (let [_ (send-step-result ctx {:status :running})
-        step-id (:step-id ctx)
+  (let [step-id (:step-id ctx)
         result-ch (async/chan)
         child-kill-switch (atom false)
         parent-kill-switch (:is-killed ctx)
@@ -101,6 +100,7 @@
                                  :is-killed child-kill-switch)
         processed-async-result-ch (process-channel-result-async result-ch ctx)
         kill-subscription (kill-step-handling ctx-for-child)
+        _ (send-step-result ctx {:status :running})
         immediate-step-result (execute-or-catch step args ctx-for-child)
         processed-async-result (async/<!! processed-async-result-ch)
         complete-step-result (merge processed-async-result immediate-step-result)]


get some basic dom handling stuff from dommy. This should be replaced with goog.dom calls.

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -10,6 +10,30 @@

   (:require-macros [cljs.core.async.macros :refer [go]])
 )
+
+(defn as-str
+  "Coerces strings and keywords to strings, while preserving namespace of
+   namespaced keywords"
+  [s]
+  (if (keyword? s)
+    (str (some-> (namespace s) (str "/")) (name s))
+    s))
+
+(defn set-style!
+  "Set the style of `elem` using key-value pairs:
+      (set-style! elem :display \"block\" :color \"red\")"
+  [elem & kvs]
+  (assert (even? (count kvs)))
+  (let [style (.-style elem)]
+    (doseq [[k v] (partition 2 kvs)]
+      (.setProperty style (as-str k) v))
+    elem))
+
+(defn append!
+  "Append `child` to `parent`"
+  ([parent child]
+     (doto parent
+       (.appendChild child))))

 (defn make
   "make a new pixi canvas, or initialise pixi with an existing canvas.


Add some additional docstrings on poly1305 ns.

--- src/clojure/buddy/core/mac/poly1305.clj
+++ src/clojure/buddy/core/mac/poly1305.clj
@@ -50,6 +50,7 @@
 (defn key->poly1305key
   "Noramalizes any length byte array key to poly1305
   formatted byte array key.
+
   It uses sha3 (256 bit) for normalize the size to 32
   bytes and poly1305 algorithm for transform it."
   [^bytes key]
@@ -58,6 +59,8 @@
     bkey))

 (defn- make-poly1305-plain-impl
+  "Calculate the poly1305 message authentication code
+  for byte array objects."
   [^bytes input ^bytes pkey ^bytes iv ^Keyword alg]
   (let [engine (resolve-engine alg)
         mac    (Poly1305. engine)
@@ -71,6 +74,8 @@
     out))

 (defn- make-poly1305-stream-impl
+  "Calculate the poly1305 message authentication code
+  for file like objects in most memory efficient way."
   [^java.io.InputStream stream ^bytes pkey ^bytes iv ^Keyword alg]
   (let [engine (resolve-engine alg)
         mac    (Poly1305. engine)


Refamiliarize with CurveCP server translation status

Trying to remember where I was. And to decide whether I want to tackle
it tonight.

--- src/com/frereth/common/curve/server.clj
+++ src/com/frereth/common/curve/server.clj
@@ -107,18 +107,17 @@
    (+ (one-minute) now)))

 (defn handle-incoming!
+  "So...what *should* happen here?"
   [state msg]
   ;; Yay! I'm finally reaching here!
-  #_(throw (ex-info "curve.server/handle-incoming!"
-                  {:message msg
-                   :problem "Not yet written"}))
   (println "=============================================\n"
            "=\n"
            "curve.server/handle-incoming! -- What should I do?\n"
            "=\n"
            "=============================================")
-  ;;; Doing nothing is pretty definitely the wrong thing.
-  state)
+  (throw (ex-info "curve.server/handle-incoming!"
+                  {:message msg
+                   :problem "Not yet written"})))

 (defn hide-secrets!
   [this]
@@ -236,7 +235,8 @@
             (try
               ;; Q: Do I want unhandled exceptions to be fatal errors?
               (let [modified-state (handle-incoming! this msg)]
-                (println "Updated state based on incoming msg:" (hide-long-arrays modified-state))
+                (println "Updated state based on incoming msg:"
+                         (hide-long-arrays modified-state))
                 modified-state)
               (catch clojure.lang.ExceptionInfo ex
                 (println "handle-incoming! failed" ex (.getStackTrace ex))
@@ -256,8 +256,11 @@
         (fn [this]
           (if this
             (if-not (identical? this ::drained)
+              ;; Weren't called to explicitly close
               (if-not (realized? stopper)
                 (do
+                  ;; The promise that tells us to stop hasn't
+                  ;; been fulfillef
                   (println "curve.server/event-loop-bottom Rotating"
                            #_(util/pretty (hide-long-arrays this))
                            "...this...")
@@ -290,7 +293,9 @@
 ;;; Public

 (defn hide-long-arrays
-  "Try to make pretty printing less obnoxious"
+  "Try to make pretty printing less obnoxious
+
+  By hiding the vectors that take up huge amounts of screen space"
   [state]
   (-> state
       (assoc-in [::current-client ::message] "...")
@@ -305,8 +310,8 @@
     :as this}]
   {:pre [client-chan
          (:chan client-chan)
-         #_(::shared/server-name my-keys)
-         #_(::shared/keydir my-keys)
+         (::shared/server-name my-keys)
+         (::shared/keydir my-keys)
          extension
          ;; Actually, the rule is that it must be
          ;; 32 hex characters. Which really means


pmap when querying the services

pmap when querying the services

--- src/com/ig/swagger/search/collector.clj
+++ src/com/ig/swagger/search/collector.clj
@@ -120,9 +120,9 @@
                                parser/index-data-for-v2)
                    (partial find-swagger-ui http-client)
                    attach-ui)]
-    (map (comp pipeline
-               #(assoc pipeline-config :service-url %))
-         services)))
+    (pmap (comp pipeline
+                #(assoc pipeline-config :service-url %))
+          services)))

 (defn glue [json-client http-client pipeline-config services]
   (let [swagger-data (collect-swagger-data json-client http-client pipeline-config services)]


Fix: make regexp pattern from a string (book name)

--- src/emender_jenkins/metadata_reader.clj
+++ src/emender_jenkins/metadata_reader.clj
@@ -83,7 +83,7 @@
     [product version book-regexp item]
     (and (or (nil? product) (= product (:product item)))
          (or (nil? version) (= version (:version item)))
-         (or (nil? book-regexp) (re-matches book-regexp (:book item)))))
+         (or (nil? book-regexp) (re-matches (re-pattern book-regexp) (:book item)))))

 (defn get-metadata
     ([]


HTML armouring.

HTML armouring.

--- src/eu/cassiel/reveal_js_render_clj.clj
+++ src/eu/cassiel/reveal_js_render_clj.clj
@@ -24,8 +24,14 @@

 ;; Called from the slide contents:

+(defn htmlize [text]
+  (-> text
+      (clojure.string/replace "&" "&")
+      (clojure.string/replace "<" "<")
+      (clojure.string/replace ">" ">")))
+
 (defn code [& lines]
-  [:pre [:code (clojure.string/trim (clojure.string/join "\n" lines))]])
+  [:pre [:code.html (clojure.string/trim (htmlize (clojure.string/join "\n" lines)))]])

 (defn image-h [h f]
   [:img {:height h


lein-release plugin: bumped version from 1.1.0 to 1.1.1-SNAPSHOT for next development cycle

--- backend/project.clj
+++ backend/project.clj
@@ -1,4 +1,4 @@
-(defproject lambdaui "1.1.0"
+(defproject lambdaui "1.1.1-SNAPSHOT"
   :description "LambdaCD-Plugin that provides a modern UI for your pipeline."
   :url "https://github.com/sroidl/lambda-ui"
   :license {:name "Apache License 2.0"


Upgrade duct/core to 0.7.0 so we can use Bool coercion

--- backend/project.clj
+++ backend/project.clj
@@ -16,8 +16,8 @@
                  [com.layerware/hugsql "0.4.9"]
                  [commons-io/commons-io "2.6"]
                  [compojure "1.6.1" :exclusions [medley]]
-                 [duct/core "0.6.2"]
-                 [duct/module.logging "0.3.1"]
+                 [duct/core "0.7.0" :exclusions [org.clojure/clojure]]
+                 [duct/module.logging "0.3.1" :exclusions [com.stuartsierra/dependency]]
                  [duct/database.sql.hikaricp "0.3.3" :exclusions [org.slf4j/slf4j-nop integrant]]
                  [environ "1.1.0"]
                  [funcool/cuerdas "2.0.5"]
@@ -80,7 +80,7 @@
    :profiles/test  {}
    :project/dev   {:dependencies   [[diehard "0.7.2" :exclusions [org.clojure/spec.alpha]]
                                     [duct/generate "0.8.2"]
-                                    [integrant/repl "0.2.0"]
+                                    [integrant/repl "0.2.0" :exclusions [com.stuartsierra/dependency]]
                                     [reloaded.repl "0.2.4"]
                                     [org.clojure/tools.namespace "0.2.11"]
                                     [org.clojure/tools.nrepl "0.2.13"]


support pseudo functions

support pseudo functions

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -23,7 +23,17 @@
 (def ^:const fields [:suite :test :url :verb :headers :payload :params :exp-status :exp-body
                      :exp-headers :options :extractions])

-(def ^:const placeholder-pattern #"\$(\p{Alpha}\w*)\$")
+(def ^:const placeholder-pattern #"\$(\p{Alpha}[^\$]*)\$")
+
+(defmulti pseudo-fn
+  "converts strings into function calls. e.g. now fmt=yyyy-MM-dd
+  tomorrow today roll=7days"
+  first)
+
+(defn eval [s]
+  (pseudo-fn (str/split s #"\s+")))
+
+(defmethod "now" (fn [_ ]))

 (defn placeholders [s]
   (set (map second (re-seq placeholder-pattern s))))