Fix to align with current Cylon

Fix to align with current Cylon

--- modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
+++ modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
@@ -1,12 +1,11 @@
 ;; Copyright © 2014 JUXT LTD.
-
 (ns modular.bootstrap.cylon.user-forms
   (:require
    [com.stuartsierra.component :as component]
    [clojure.tools.logging :refer :all]
    [modular.bootstrap :refer (ContentBoilerplate wrap-content-in-boilerplate)]
    [modular.bidi :refer (path-for)]
-   [cylon.impl.authentication :refer (LoginFormRenderer)]
+   [cylon.authentication.login :refer (LoginFormRenderer)]
    [cylon.signup.protocols :refer (SignupFormRenderer SimpleMessageRenderer RequestResetPasswordFormRenderer WelcomeRenderer)]
    [cylon.totp :as totp]
    [hiccup.core :refer (html h)]
@@ -63,6 +62,10 @@

         [:h2.form-signin-heading login-prompt]

+        ;; When post-login-redirect is given, pass it through post_login-redirect
+        (when-let [post-login-redirect (-> model :form :post-login-redirect)]
+          [:input {:type "hidden" :name "post_login_redirect" :value post-login-redirect}])
+
         #_(when login-status
             [:div.alert.alert-warning.alert-dismissable
              [:button.close {:type "button" :data-dismiss "alert" :aria-hidden "true"} "×"]
@@ -153,19 +156,19 @@
         (when (:redirection-uri model) [:p "Now proceed to " [:a {:href (:redirection-uri model)} "continue"]])]])))

   SimpleMessageRenderer
-  (render-simple-message [this req model]
+  (render-simple-message [this req heading message]
     (boilerplate
      this req
      (html
       [:div.row {:style "padding-top: 50px"}
        [:div.col-md-2]
        [:div.col-md-10
-        [:h2 (:header model)]]]
+        [:h2 heading]]]
       [:div.row
        [:div.col-md-2]
        [:div.col-md-10
         [:style (styles)]
-        (:message model)]])))
+        message]])))

   RequestResetPasswordFormRenderer
   (render-request-reset-password-form [this req model]


Code review: Use the truthy value, positive if

--- src/cower/handler.clj
+++ src/cower/handler.clj
@@ -36,11 +36,11 @@

   (GET "/packages/:name" [name]
        (let [url (wcar* (car/get name))]
-         (if (nil? url)
-           {:status 404}
+         (if url
            {:status 200
             :body (write-json
-                   (key-value-to-map [name url]))})))
+                   (key-value-to-map [name url]))}
+           {:status 404})))

   (DELETE "/packages/:name" [name]
           (do


exclude 'commons-logging' from SDK dependencies.

--- lein-ancient/project.clj
+++ lein-ancient/project.clj
@@ -17,7 +17,7 @@
                  ;; S3 dependency is pinned because of conflicts of newer
                  ;; versions with Leiningen's precompiled dependencies.
                  [com.amazonaws/aws-java-sdk-s3 "1.11.28"
-                  :exclusions [joda-time]
+                  :exclusions [joda-time commons-logging]
                   :upgrade? false]]
   :license {:name "MIT License"
             :url "https://opensource.org/licenses/MIT"


(maint) fixup botched merge conflict resolution

--- test/integration/puppetlabs/services/jruby/puppet_environments_int_test.clj
+++ test/integration/puppetlabs/services/jruby/puppet_environments_int_test.clj
@@ -72,7 +72,6 @@
   []
   (-> (http-client/get
         "https://localhost:8140/production/catalog/localhost"
-        bootstrap/request-options)
         catalog-request-options)
       :body
       json/parse-string))


external browser connection

external browser connection

--- env/dev/clj/clojexcms/dev.clj
+++ env/dev/clj/clojexcms/dev.clj
@@ -11,7 +11,9 @@
    (prepend (html [:script {:type "text/javascript" :src "/js/out/goog/base.js"}]))
    (prepend (html [:script {:type "text/javascript" :src "/react/react.js"}]))
    (prepend (html [:script {:type "text/javascript" :src "/js/react-bootstrap.min.js"}]))
-   (append  (html [:script {:type "text/javascript"} "goog.require('clojexcms.dev')"]))))
+   (append  (html [:script {:type "text/javascript"} "goog.require('clojexcms.dev')"]))
+   (append  (html [:script {:type "text/javascript" :id "lt_ws"
+                            :src "http://localhost:62439/socket.io/lighttable/ws.js"}]))))

 (defn start-figwheel []
   (future


About to remove testing from sahtn

About to remove testing from sahtn


add arrows comment to made with post

add arrows comment to made with post

--- src/pc/views/blog/ideas_are_made_with_precursor.clj
+++ src/pc/views/blog/ideas_are_made_with_precursor.clj
@@ -86,8 +86,9 @@

     [:article
      [:h3 "That was fast."]
-     [:p  "Peter made short work of this map by staying focused on his content—a great strategy for diagramming. "
-          "He figured out alignment and connections afterwards. "]]
+     [:p  "Peter made short work of this by focusing on his content—great strategy—lining things up afterwards. "
+          "You may like our new arrows, Peter. "
+          "Hold ctrl+shift and click shapes to connect them! "]]
     [:figure (card-github "peteratticusberg" "17592197310304?cx=687&cy=636&z=0.8&replay=true" "Peter Berg" "https://avatars0.githubusercontent.com/u/3895824" "11 repos")]

     [:article


CMR-1926: Added logging for ingest time to visible.

--- indexer-app/src/cmr/indexer/services/index_service.clj
+++ indexer-app/src/cmr/indexer/services/index_service.clj
@@ -24,7 +24,9 @@
             [cmr.system-trace.core :refer [deftracefn]]
             [cmr.message-queue.config :as qcfg]
             [cmr.indexer.data.elasticsearch :as es]
-            [cmr.common.lifecycle :as lifecycle]))
+            [cmr.common.lifecycle :as lifecycle]
+            [clj-time.core :as t]
+            [clj-time.format :as f]))

 (defn filter-expired-concepts
   "Remove concepts that have an expired delete-time."
@@ -134,9 +136,21 @@
   (let [{:keys [all-revisions-index?]} options
         concept-type (cs/concept-id->type concept-id)]
     (when (indexing-applicable? concept-type all-revisions-index?)
-      (let [concept (meta-db/get-concept context concept-id revision-id)
+      (let [{:keys [revision-date] :as concept} (meta-db/get-concept context concept-id revision-id)
             umm-record (umm/parse-concept concept)]
-        (index-concept context concept umm-record options)))))
+        (index-concept context concept umm-record options)
+        ;; Guard against revision-date that is not set or set to the future by a provider or a test.
+        (try
+          (info
+            (format "Concept [%s] took [%d] msec from start of ingest to become visible in search."
+                    (:concept-id concept)
+                    (t/in-millis (t/interval (f/parse (f/formatters :date-time) revision-date)
+                                             (t/now)))))
+          (catch Exception _
+            (warn (format
+                    "Cannot compute time from ingest to search visibility for [%s] with revision date [%s]."
+                    concept-id
+                    revision-date))))))))

 (deftracefn delete-concept
   "Delete the concept with the given id"
@@ -149,7 +163,7 @@
       (info (format "Deleting concept %s, revision-id %s, all-revisions-index? %s"
                     concept-id revision-id all-revisions-index?))
       (let [index-name (idx-set/get-concept-index-name
-                            context concept-id revision-id all-revisions-index?)
+                         context concept-id revision-id all-revisions-index?)
             concept-mapping-types (idx-set/get-concept-mapping-types context)
             elastic-options (select-keys options [:all-revisions-index? :ignore-conflict?])]
         (if all-revisions-index?


Fix #60 Protect against lack of :print

Fix #60 Protect against lack of :print

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -13,6 +13,15 @@
            [java.io File BufferedReader BufferedWriter IOException]
            (javax.jmdns JmDNS ServiceListener)))

+(defn print-fn [opts]
+  (or (:print-no-newline opts) print))
+
+(defn println-fn [opts]
+  (or (:print opts) println))
+
+(defn flush-fn [opts]
+  (or (:flush opts) flush))
+
 (defn set-logging-level [logger-name level]
   (.setLevel (java.util.logging.Logger/getLogger logger-name) level))

@@ -30,9 +39,9 @@

 (defn print-discovered-devices [name-endpoint-map opts]
   (if (empty? name-endpoint-map)
-    ((:print opts) "(No devices)")
+    ((println-fn opts) "(No devices)")
     (doseq [[choice-number [bonjour-name _]] (name-endpoint-map->choice-list name-endpoint-map)]
-      ((:print opts) (str "[" choice-number "] " (bonjour-name->display-name bonjour-name))))))
+      ((println-fn opts) (str "[" choice-number "] " (bonjour-name->display-name bonjour-name))))))

 (defn discover-and-choose-device
   "Looks for Ambly WebDAV devices advertised via Bonjour and presents
@@ -63,16 +72,16 @@
         (when (empty? @name-endpoint-map)
           (Thread/sleep 100)
           (when (= 20 count)
-            ((:print opts) "\nSearching for devices ..."))
+            ((println-fn opts) "\nSearching for devices ..."))
           (recur (inc count))))
       (Thread/sleep 500)                                    ;; Sleep a little more to catch stragglers
       (loop [current-name-endpoint-map @name-endpoint-map]
-        ((:print opts))
+        ((println-fn opts))
         (print-discovered-devices current-name-endpoint-map opts)
         (when-not choose-first-discovered?
-          ((:print opts) "\n[R] Refresh\n")
-          ((:print-no-newline opts) "Choice: ")
-          ((:flush opts)))
+          ((println-fn opts) "\n[R] Refresh\n")
+          ((print-fn opts) "Choice: ")
+          ((flush-fn opts)))
         (let [choice (if choose-first-discovered? "1" (read-line))]
           (if (= "r" (.toLowerCase choice))
             (recur @name-endpoint-map)
@@ -108,8 +117,8 @@
                    (deliver resp-promise :eof))
                  :eof)
       (= c 1) (do
-                ((:print-no-newline opts) (str sb))
-                ((:flush opts))
+                ((print-fn opts) (str sb))
+                ((flush-fn opts))
                 (recur (StringBuilder.) (.read in)))
       (= c 0) (do
                 (deliver @response-promise (str sb))
@@ -217,7 +226,7 @@
           output-dir (io/file webdav-mount-point)
           env (ana/empty-env)
           core (io/resource "cljs/core.cljs")]
-      ((:print opts) "\nConnecting to" (bonjour-name->display-name bonjour-name) "...\n")
+      ((println-fn opts) "\nConnecting to" (bonjour-name->display-name bonjour-name) "...\n")
       (reset! (:webdav-mount-point repl-env) webdav-mount-point)
       (when (.exists output-dir)
         (shell/sh "umount" webdav-mount-point))
@@ -298,7 +307,7 @@
             (repl/mapped-stacktrace stacktrace build-options)]
       (let [url (when url (string/trim (.toString url)))
             file (when file (string/trim (.toString file)))]
-       ((:print repl/*repl-opts*)
+       ((println-fn repl/*repl-opts*)
         "\t" (str (when function (str function " "))
                "(" (str (or url file)) (when line (str ":" line)) (when column (str ":" column)) ")")))))
   repl/IJavaScriptEnv


Fix regressions switching to single-arg print fns

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -27,7 +27,7 @@

 (defn repl-flush [opts]
   {:pre [(map? opts)]}
-  (or (:flush opts) flush))
+  ((or (:flush opts) flush)))

 (defn set-logging-level [logger-name level]
   {:pre [(string? logger-name) (instance? java.util.logging.Level level)]}
@@ -283,7 +283,7 @@
           output-dir (io/file webdav-mount-point)
           env (ana/empty-env)
           core (io/resource "cljs/core.cljs")]
-      (repl-println opts (str "\nConnecting to" (bonjour-name->display-name bonjour-name) "...\n"))
+      (repl-println opts (str "\nConnecting to " (bonjour-name->display-name bonjour-name) " ...\n"))
       (set-up-socket repl-env opts endpoint-address (dec endpoint-port))
       (if (= "true" (:value (jsc-eval repl-env "typeof cljs === 'undefined'")))
         (do


CMR-1412: Minor formatting change

CMR-1412: Minor formatting change

--- metadata-db-app/src/cmr/metadata_db/data/memory_db.clj
+++ metadata-db-app/src/cmr/metadata_db/data/memory_db.clj
@@ -107,22 +107,22 @@
                             pid :provider-id
                             nid :native-id :as concept}]
                         (let [query-map (util/remove-nil-keys {:concept-type concept-type
-                                                        :provider-id provider-id
-                                                        :native-id native-id
-                                                        :extra-fields extra-field-params})
+                                                               :provider-id provider-id
+                                                               :native-id native-id
+                                                               :extra-fields extra-field-params})
                               full-concept-map {:concept-type ct
-                                  :provider-id pid
-                                  :native-id nid
-                                  :extra-fields (select-keys extra-fields
-                                                                      (keys extra-field-params))}
-                              concept-map (select-keys  full-concept-map (keys query-map))]
-                        (when (= query-map concept-map)
-                          (dissoc (if (and (= :granule concept-type)
-                                           (nil? (get-in concept [:extra-fields :granule-ur])))
-                                    (assoc-in concept [:extra-fields :granule-ur]
-                                              (:native-id concept))
-                                    concept)
-                                  (when exclude-metadata? :metadata)))))
+                                                :provider-id pid
+                                                :native-id nid
+                                                :extra-fields (select-keys extra-fields
+                                                                           (keys extra-field-params))}
+                              concept-map (select-keys full-concept-map (keys query-map))]
+                          (when (= query-map concept-map)
+                            (dissoc (if (and (= :granule concept-type)
+                                             (nil? (get-in concept [:extra-fields :granule-ur])))
+                                      (assoc-in concept [:extra-fields :granule-ur]
+                                                (:native-id concept))
+                                      concept)
+                                    (when exclude-metadata? :metadata)))))
                       @concepts-atom)))
             providers))


Correct ns

Correct ns

--- metrics-clojure-core/test/metrics/test/meters_test.clj
+++ metrics-clojure-core/test/metrics/test/meters_test.clj
@@ -1,4 +1,4 @@
-(ns metrics.test.meters
+(ns metrics.test.meters-test
   (:require [metrics.meters :as meters]
             [metrics.test.test-utils :refer :all]
             [clojure.test :refer :all]))


Add comments, include tooltips

Add comments, include tooltips

--- src/discuss/core.cljs
+++ src/discuss/core.cljs
@@ -1,8 +1,10 @@
 (ns ^:figwheel-always discuss.core
+  "Entrypoint to this application. Loads all requirements, and bootstraps the application."
   (:require [om.core :as om :include-macros true]
             [discuss.auth :as auth]
             [discuss.communication :as com]
             [discuss.debug :as debug]
+            [discuss.references.integration]
             [discuss.utils.extensions]
             [discuss.utils.common :as lib]
             [discuss.tooltip :as tooltip]


show an extra timestamp for chats more than 5 minutes apart

--- src-cljs/frontend/components/chat.cljs
+++ src-cljs/frontend/components/chat.cljs
@@ -194,8 +194,12 @@
                     (for [[prev-chat chat] (partition 2 1 (concat [nil] (sort-by :server/timestamp chat-group)))]
                       (om/build chat-item {:chat chat
                                            :uuid->cust (get-in app [:cust-data :uuid->cust])
-                                           :show-sender? (not= (chat-model/display-name prev-chat sente-id)
-                                                               (chat-model/display-name chat sente-id))}
+                                           :show-sender? (and (not= (chat-model/display-name prev-chat sente-id)
+                                                                    (chat-model/display-name chat sente-id))
+                                                              (or (not (:server/timestamp chat))
+                                                                  (not (:server/timestamp prev-chat))
+                                                                  (< (* 1000 60 5) (- (.getTime (:server/timestamp chat))
+                                                                                (.getTime (:server/timestamp prev-chat))))))}
                                 {:react-key (:db/id chat)
                                  :opts {:sente-id sente-id}})))))])))))


Change namespace alias from core to t

Change namespace alias from core to t

This feels more elegant. Of course, it is hoped that t will be a
common alias for tick.api eventually, but internal tick namespaces
should not use tick.api anyway, so t should stand for tick.core.

--- src/tick/cal.clj
+++ src/tick/cal.clj
@@ -3,7 +3,7 @@
 (ns tick.cal
   (:require
    [clojure.spec.alpha :as s]
-   [tick.core :as core])
+   [tick.core :as t])
   (:import
    [java.time Clock ZoneId Instant Duration DayOfWeek Month ZonedDateTime LocalDate YearMonth Month]
    [java.time.temporal ChronoUnit]))
@@ -29,10 +29,10 @@
   (fn [d] (.isBefore d now)))

 (defn- first-named-day-from [ld day]
-  (first (drop-while #(not= (day-of-week %) day) (core/range ld))))
+  (first (drop-while #(not= (day-of-week %) day) (t/range ld))))

 (defn- last-named-day-from [ld day]
-  (first (drop-while #(not= (day-of-week %) day) (core/range ld nil -1))))
+  (first (drop-while #(not= (day-of-week %) day) (t/range ld nil -1))))

 (defn first-monday-of-month [^YearMonth ym]
   (first-named-day-from (.atDay ym 1) DayOfWeek/MONDAY))
@@ -60,10 +60,10 @@
         :ret ::holiday)

 (defn new-years-day [year]
-  (LocalDate/of (core/int (core/year year)) 1 1))
+  (LocalDate/of (t/int (t/year year)) 1 1))

 (defn new-years-day-holiday [year]
-  (let [day (new-years-day (core/int (core/year year)))
+  (let [day (new-years-day (t/int (t/year year)))
         hol (cond-> day (weekend? day) (first-named-day-from DayOfWeek/MONDAY))]
     (holiday "New Year's Day" day hol)))

@@ -75,7 +75,7 @@
   ;; TODO: From what year does this algorithm makes sense from, need
   ;; to throw an exception outside this range.
   [year]
-  (let [year (core/int (core/year year))
+  (let [year (t/int (t/year year))
         a (mod year 19)
         b (quot year 100)
         c (mod year 100)
@@ -93,41 +93,41 @@
     (LocalDate/of year n (+ p 1))))

 (defn good-friday [year]
-  (.minusDays (easter-sunday (core/int (core/year year))) 2))
+  (.minusDays (easter-sunday (t/int (t/year year))) 2))

 (defn good-friday-holiday [year]
-  (holiday "Good Friday" (good-friday (core/int (core/year year)))))
+  (holiday "Good Friday" (good-friday (t/int (t/year year)))))

 (defn easter-monday [year]
-  (.plusDays (easter-sunday (core/int (core/year year))) 1))
+  (.plusDays (easter-sunday (t/int (t/year year))) 1))

 (defn easter-monday-holiday [year]
-  (holiday "Easter Monday" (easter-monday (core/int (core/year year)))))
+  (holiday "Easter Monday" (easter-monday (t/int (t/year year)))))

 (defn may-day [year]
-  (LocalDate/of (core/int (core/year year)) 5 1))
+  (LocalDate/of (t/int (t/year year)) 5 1))

 (defn early-may-bank-holiday [year]
   (holiday "Early May bank holiday"
-           (first-named-day-from (may-day (core/int (core/year year))) DayOfWeek/MONDAY)))
+           (first-named-day-from (may-day (t/int (t/year year))) DayOfWeek/MONDAY)))

 (defn spring-bank-holiday [year]
   (holiday "Spring bank holiday"
-           (last-monday-of-month (YearMonth/of (core/int (core/year year)) Month/MAY))))
+           (last-monday-of-month (YearMonth/of (t/int (t/year year)) Month/MAY))))

 (defn summer-bank-holiday [year]
   (holiday "Summer bank holiday"
-           (last-monday-of-month (YearMonth/of (core/int (core/year year)) Month/AUGUST))))
+           (last-monday-of-month (YearMonth/of (t/int (t/year year)) Month/AUGUST))))

 (defn christmas-day [year]
-  (LocalDate/of (core/int (core/year year)) 12 25))
+  (LocalDate/of (t/int (t/year year)) 12 25))

 (s/fdef christmas-day
         :args (s/cat :year ::year)
         :ret ::date)

 (defn christmas-day-holiday [year]
-  (let [day (christmas-day (core/int (core/year year)))
+  (let [day (christmas-day (t/int (t/year year)))
         hol (cond-> day
               (#{DayOfWeek/SATURDAY DayOfWeek/SUNDAY} (.getDayOfWeek day)) (.plusDays 2))]
     (holiday "Christmas Day" day hol)))
@@ -137,14 +137,14 @@
         :ret ::holiday)

 (defn boxing-day [year]
-  (LocalDate/of (core/int (core/year year)) 12 26))
+  (LocalDate/of (t/int (t/year year)) 12 26))

 (s/fdef boxing-day
         :args (s/cat :year ::year)
         :ret ::date)

 (defn boxing-day-holiday [year]
-  (let [day (boxing-day (core/int (core/year year)))
+  (let [day (boxing-day (t/int (t/year year)))
         hol (cond-> day
               (#{DayOfWeek/SATURDAY DayOfWeek/SUNDAY} (.getDayOfWeek day)) (.plusDays 2))]
     (holiday "Boxing Day" day hol)))


Add commentary/organization to algorithms-properties


default profile

default profile

--- src/aero/core.clj
+++ src/aero/core.clj
@@ -18,9 +18,14 @@
 (defn read-config
   "Optional second argument is a map. Keys are :profile, indicating the
   profile for use with #cond"
-  ([r {:keys [profile]}]
-   (edn/read
-    {:readers (readers profile)}
-    (java.io.PushbackReader. (io/reader r))))
+  ([r {:keys [profile schema]}]
+   (let [config
+         (edn/read
+          {:readers (readers (or profile :default))}
+          (java.io.PushbackReader. (io/reader r)))]
+     (when schema
+       (s/validate schema config))
+     config))
+
   ([r]
-   (read-config r {:profile :default})))
+   (read-config r {})))


Need to merge response status with original message m.

--- src/cbfg/kvs.cljs
+++ src/cbfg/kvs.cljs
@@ -97,7 +97,8 @@
      (kvs-do actx state-ch (:res-ch m)
              (kvs-checker m (fn [state kvs]
                               [(dissoc-in state [:kvss (:name kvs)])
-                               {:status :ok :status-info [:removed (:kvs-ident m)]}]))))
+                               (merge m {:status :ok
+                                         :status-info [:removed (:kvs-ident m)]})]))))

    :multi-get
    (fn [actx state-ch m]
@@ -146,7 +147,7 @@
    :snapshot
    (fn [actx state-ch m]
      (kvs-do actx state-ch (:res-ch m)
-             (fn [state] [state {:status :ok :kvs-snapshot state}])))
+             (fn [state] [state (merge m {:status :ok :kvs-snapshot state})])))

    :sync
    (fn [actx state-ch m]
@@ -156,7 +157,8 @@
                                          (-> kvs
                                              (assoc :clean (:dirty kvs))
                                              (assoc :dirty (make-kc))))
-                               {:status :ok :status-info [:synced (:kv-ident m)]}]))))})
+                               (merge m {:status :ok
+                                         :status-info [:synced (:kv-ident m)]})]))))})

 (defn make-kvs-mgr [actx & {:keys [cmd-ch state-ch op-handlers]}]
   (let [cmd-ch (or cmd-ch (achan actx))


don't use function application to deconstruct construction arglist from array - this is limited to a max of 20 params - use 'let' instead.

--- dada-core/src/main/clojure/org/dada/core.clj
+++ dada-core/src/main/clojure/org/dada/core.clj
@@ -314,7 +314,8 @@
 (defmacro defrecord-creator [class-name field-names]
   `(proxy [Creator] []
      (^{:tag ~class-name} create [#^{:tag (type (into-array Object []))} args#]
-      (apply (fn [~@field-names] (~(symbol (str (name class-name) "." )) ~@field-names)) args#))))
+      (let [~(apply vector field-names) args#] (~(symbol (str (name class-name) "." )) ~@field-names)))
+     ))

 (defmacro defrecord-getter [field-name input-type output-type]
   `(proxy [Getter] [] (^{:tag ~output-type} get [^{:tag ~input-type} datum#] (~(symbol (str "." field-name)) datum#))))


RDC - Make a rotate-cell function.

RDC - Make a rotate-cell function.

--- src/icfp2015/cell.clj
+++ src/icfp2015/cell.clj
@@ -21,6 +21,19 @@
     :southwest [-1 0 1]
     :southeast [0 -1 1] })

+(defn rotate-cell
+  "Returns a function that rotates a cell around a pivot point"
+  [pivot direction]
+  (fn [cell]
+    (let [pivot (offset->cube pivot)
+          cell  (offset->cube cell)
+          hex-vector (mapv - cell pivot)
+          [x y z] hex-vector]
+      (cube->offset
+        (case direction
+          :counterclockwise (mapv - [z x y])
+          :clockwise (mapv - [y z x]))))))
+
 (defn translate-dir [direction]
   (fn [cell]
     (->> cell


Make config private.

Make config private.

--- src/incise/config.clj
+++ src/incise/config.clj
@@ -1,7 +1,7 @@
 (ns incise.config
   (:refer-clojure :exclude [assoc get]))

-(def config (atom {}))
+(def ^:private config (atom {}))

 (defn assoc [& args]
   (apply swap! config assoc args))


Remove spec from wrap-reload.

Remove spec from wrap-reload.

--- src/incise/server.clj
+++ src/incise/server.clj
@@ -33,7 +33,7 @@
   (-> (routes (files "/" {:root (conf/get :out-dir)})
               (not-found (html5 [:h1 "404"])))
       (wrap-static-index)
-      (wrap-reload :dirs ["src" "spec"])
+      (wrap-reload :dirs ["src"])
       (wrap-incise)
       (wrap-log-exceptions)
       (wrap-stacktrace-web)


examples/fronted: Upgrade dependencies

examples/fronted: Upgrade dependencies

Fixes https://github.com/metosin/reitit/issues/423

--- examples/frontend/project.clj
+++ examples/frontend/project.clj
@@ -4,25 +4,25 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}

-  :dependencies [[org.clojure/clojure "1.10.0"]
+  :dependencies [[org.clojure/clojure "1.10.1"]
                  [ring-server "0.5.0"]
-                 [reagent "0.8.1"]
-                 [ring "1.7.1"]
+                 [reagent "0.10.0"]
+                 [ring "1.8.1"]
                  [hiccup "1.0.5"]
-                 [org.clojure/clojurescript "1.10.439"]
+                 [org.clojure/clojurescript "1.10.773"]
                  [metosin/reitit "0.5.5"]
                  [metosin/reitit-spec "0.5.5"]
                  [metosin/reitit-frontend "0.5.5"]
                  ;; Just for pretty printting the match
-                 [fipp "0.6.14"]]
+                 [fipp "0.6.23"]]

-  :plugins [[lein-cljsbuild "1.1.7"]
-            [lein-figwheel "0.5.18"]]
+  :plugins [[lein-cljsbuild "1.1.8"]
+            [lein-figwheel "0.5.20"]]

   :source-paths []
   :resource-paths ["resources" "target/cljsbuild"]

-  :profiles {:dev {:dependencies [[binaryage/devtools "0.9.10"]]}}
+  :profiles {:dev {:dependencies [[binaryage/devtools "1.0.2"]]}}

   :cljsbuild
   {:builds


We're back! Jar/uberjar fails with a failed compile

--- src/leiningen/jar.clj
+++ src/leiningen/jar.clj
@@ -155,10 +155,10 @@
 be used as the main-class for an executable jar."
   ([project jar-name]
      (binding [compile/*silently* true]
-       (compile/compile project)
-       (let [jar-path (get-jar-filename project jar-name)
-             deps-fileset (deps project :skip-dev)]
-         (write-jar project jar-path (filespecs project deps-fileset))
-         (println "Created" jar-path)
-         jar-path)))
+       (when (compile/compile project)
+         (let [jar-path (get-jar-filename project jar-name)
+               deps-fileset (deps project :skip-dev)]
+           (write-jar project jar-path (filespecs project deps-fileset))
+           (println "Created" jar-path)
+           jar-path))))
   ([project] (jar project (get-default-jar-name project))))


Fix missing goog.require, which causes errors in latest cljs-versions.

--- src/active/clojure/record_runtime.cljc
+++ src/active/clojure/record_runtime.cljc
@@ -1,6 +1,7 @@
 (ns ^:no-doc active.clojure.record-runtime
   (:refer-clojure :exclude [record?])
-  #?(:cljs (:require-macros [active.clojure.record-runtime :refer [really-make-record record-check-rtd!]])))
+  #?(:cljs (:require-macros [active.clojure.record-runtime :refer [really-make-record record-check-rtd!]]))
+  #?(:cljs (:require [goog.array])))

 (defrecord RecordField [name])


get-triggers now accepts vectors too

get-triggers now accepts vectors too

previously get-triggers accepted lists of symbols like '(:key-x :key-y)
to be used as keys of the key-map hash, but not vectors like
[:key-x :key-y]

--- src/maqueta/input.clj
+++ src/maqueta/input.clj
@@ -32,9 +32,9 @@

 (defn get-triggers
   [names]
-  (if (seq? names)
-    (vec (map #(get-trigger %) names))
-    [(get-trigger names)]))
+  (if (or (keyword? names) (string? names))
+    (list (get-trigger names))
+    (map #(get-trigger %) names)))

 (defn register-inputs
   [input-manager listener key-map]


lein-release plugin: bumped version from 0.3.2 to 0.3.3-SNAPSHOT for next development cycle


Simplify the code around figuring out how to create an id column.

--- clj_record/test/main.clj
+++ clj_record/test/main.clj
@@ -6,15 +6,15 @@

 ;; Multiple DB Support
 ;;--------------------------------------------------
-(defmulti get-id-key-spec (fn [{sb :subprotocol} _ ] (.toUpperCase sb)))
+(defmulti get-id-key-spec :subprotocol)

-(defmethod get-id-key-spec "DERBY" [db-spec name]
+(defmethod get-id-key-spec "derby" [db-spec name]
   [:id :int (str "GENERATED ALWAYS AS IDENTITY CONSTRAINT " name " PRIMARY KEY")])

-(defmethod get-id-key-spec "POSTGRESQL" [db-spec name]
+(defmethod get-id-key-spec "postgresql" [db-spec name]
   [:id (str "SERIAL UNIQUE PRIMARY KEY")])

-(defmethod get-id-key-spec "MYSQL" [db-spec name]
+(defmethod get-id-key-spec "mysql" [db-spec name]
   [:id :serial])
 ;;--------------------------------------------------


fixing cider-jack-in issue

fixing cider-jack-in issue

--- clojureclass/project.clj
+++ clojureclass/project.clj
@@ -7,8 +7,9 @@
                  [org.clojure/core.async "0.4.474"]
                  [http-kit "2.3.0-beta2"]
                  [enlive "1.1.6"]]
-  :plugins [[refactor-nrepl "2.3.1"]
-            [cider/cider-nrepl "0.14.0"]]
+  :plugins [
+            ;; [refactor-nrepl "2.3.1"]
+            [cider/cider-nrepl "0.18.0"]]
   :main ^:skip-aot clojureclass.core
   :target-path "target/%s"
   :profiles {:uberjar {:aot :all}})


code comment

code comment


Update refactor-nrepl to 1.0.1

Update refactor-nrepl to 1.0.1

--- roles/clojure/files/profiles.clj
+++ roles/clojure/files/profiles.clj
@@ -24,7 +24,7 @@
                   [lein-swank "1.4.4"]
                   [lein-try "0.4.3"]
                   [lein-typed "0.3.5"]
-                  [refactor-nrepl "0.2.2"]]
+                  [refactor-nrepl "1.0.1"]]

         :injections [(require 'spyscope.core)]


Detect clojure files in a project.

Detect clojure files in a project.

--- src/circle/backend/build/inference.clj
+++ src/circle/backend/build/inference.clj
@@ -4,13 +4,12 @@
   (:require [circle.backend.build.template :as template])
   (:require [circle.backend.action :as action])
   (:require circle.backend.build.inference.rails
-            circle.backend.build.inference.php))
+            circle.backend.build.inference.php
+            circle.backend.build.inference.clojure))

 (def inference-fns {:rails (var circle.backend.build.inference.rails/spec)
+                    :clojure (var circle.backend.build.inference.clojure/spec)
                     :php (var circle.backend.build.inference.php/spec)})
-
-(defmethod infer-actions* :clojure [_ repo]
-  (circle.backend.build.inference.clojure/spec repo))

 (defn set-inferred [actions]
   (map #(action/set-source % :inferred) actions))


better disc pages

better disc pages

--- src/clj/hsm/controllers/discussion.clj
+++ src/clj/hsm/controllers/discussion.clj
@@ -50,57 +50,57 @@
                "" ""
             [:div.row
               [:div.col-lg-10
-              [:div.bs-callout.bs-callout-danger
-                [:div.post-head.row
+                [:div.bs-callout.bs-callout-danger {:style "background-color:#f4f4f4;" }
+                  [:div.post-head.row
+                        [:div.col-lg-6
+                        (render-user (actions/load-user2 db "bcambel") :show-followers false)]
+                        [:div.col-lg-6
+                        [:div.btn-group.pull-right.post-actions
+                        [:a.btn.pull-right {:href (format "/discussion/%s/post/%s/edit" disc-id (:id (:post discussion))) :style "font-weight:bolder;"} [:i.fa.fa-edit]]
+                        [:a.btn. {:href "#reply-section" :onclick "$('#reply-section').toggle();" :style "display:block;"}
+                          [:i.fa.fa-reply] "Reply"]]
+                        ]
+                        ]
+                  [:h4 (:title discussion)]
+                  [:p (md-to-html-string (get-in discussion [:post :text]))]]
+                ; [:hr]
+                (when-not (!!nil? posts)
+                  [:div.bs-callout.bs-callout-warning [:h4 "No posts yet."]
+                    [:p "Be the first one to answer! The unicorns will be with you all the time."]])
+                 (for [p posts]
+                  [:div.bs-callout.row.post {:id (str "post-" (:id p)) :data-id (:id p) }
+                    [:div.post-head.row
                       [:div.col-lg-6
-                      (render-user (actions/load-user2 db "bcambel") :show-followers false)]
+                        (render-user (actions/load-user2 db "bcambel"))]
                       [:div.col-lg-6
-                      [:a.btn.btn-default.pull-right {:href (format "/discussion/%s/post/%s/edit" disc-id (:id (:post discussion))) } [:i.fa.fa-edit]]]
+                        [:div.btn-group.pull-right.post-actions
+                        [:a.btn {:href "#"} [:i.fa.fa-reply]]
+                        [:a.btn {:href "#"} [:i.fa.fa-share]]
+                        [:a.btn {:href (format "/discussion/%s/post/%s/edit" disc-id (:id p)) } [:i.fa.fa-edit]]
+                        [:a.btn {:href "#" :data-remote :true
+                                            :data-method :POST
+                                            :data-redirect :true
+                                            :data-url (format "/discussion/%s/post/%s/delete" disc-id (:id p) ) }
+                          [:i.fa.fa-trash]]]
                       ]
-                [:h4 (:title discussion)]
-                [:p (md-to-html-string (get-in discussion [:post :text]))]
-
+                    ]
+                    [:div.post-body ;{:id (str "post-" (:id p))}
+                      (md-to-html-string (:text p) :heading-anchors true :reference-links? true)]])
                 [:hr]
-                [:div.row
-                [:a.btn.btn-primary.btn-xs.pull-right {:href "#reply-section" :onclick "$('#reply-section').toggle();" :style "display:block;"}
-                  [:i.fa.fa-reply] "Reply"]]]
-              ; [:hr]
-              (when-not (!!nil? posts)
-                [:div.bs-callout.bs-callout-warning [:h4 "No posts yet."]
-                  [:p "Be the first one to answer! The unicorns will be with you all the time."]])
-               (for [p posts]
-                [:div.bs-callout.row.post {:id (str "post-" (:id p)) :data-id (:id p) }
-                  [:div.post-head.row
-                    [:div.col-lg-6
-                      (render-user (actions/load-user2 db "bcambel"))]
-                    [:div.col-lg-6
-                      [:div.btn-group.pull-right.post-actions
-                      [:a.btn {:href "#"} [:i.fa.fa-reply]]
-                      [:a.btn {:href "#"} [:i.fa.fa-share]]
-                      [:a.btn {:href (format "/discussion/%s/post/%s/edit" disc-id (:id p)) } [:i.fa.fa-edit]]
-                      [:a.btn {:href "#" :data-remote :true
-                                          :data-method :POST
-                                          :data-redirect :true
-                                          :data-url (format "/discussion/%s/post/%s/delete" disc-id (:id p) ) }
-                        [:i.fa.fa-trash]]]
-                    ]
-                  ]
-                  [:div.post-body ;{:id (str "post-" (:id p))}
-                    (md-to-html-string (:text p) :heading-anchors true :reference-links? true)]])
-              [:hr]
-              [:div.row.discussion-buttons
-              [:a.btn.btn-primary.btn-md {:href "#" :onclick "$('#reply-section').toggle();return false;"} [:i.fa.fa-reply] "Reply"]
-
-              [:a.btn.btn-success.btn-md {:href "#" :onclick "return false;"} [:i.fa.fa-share] "Share"]
-              ]
-
-              [:div#reply-section.bs-callout.bs-callout-info {:style "display:none;"}
-                [:h4 "Reply to the post"]
-                [:form {:data-remote :true :data-redirect :true :action (str "/discussion/" id  "/post/create") :method :POST}
-                  [:div.form-group
-                    [:textarea.form-control {:name :text :rows 5 :data-provide :markdown :data-iconlibrary :fa}]]
-                  [:button.btn.btn-success {:type :submit} [:i.fa.fa-reply] "Post"]]]
-                  ]
+                [:div.row.discussion-buttons
+                [:a.btn.btn-primary.btn-md {:href "#" :onclick "$('#reply-section').toggle();return false;"} [:i.fa.fa-reply] "Reply"]
+
+                [:a.btn.btn-success.btn-md {:href "#" :onclick "return false;"} [:i.fa.fa-share] "Share"]
+                ]
+
+                [:div#reply-section.bs-callout.bs-callout-info {:style "display:none;"}
+                  [:h4 "Reply to the post"]
+                  [:form {:data-remote :true :data-redirect :true :action (str "/discussion/" id  "/post/create") :method :POST}
+                    [:div.form-group
+                      [:textarea.form-control {:name :text :rows 5 :data-provide :markdown :data-iconlibrary :fa}]]
+                    [:button.btn.btn-success {:type :submit} [:i.fa.fa-reply] "Post"]]]
+                [:hr]
+                ]
               [:div.col-lg-2 ]
             ])))))


short accounts/show title

short accounts/show title

--- src/cljs/clj_money/views/accounts.cljs
+++ src/cljs/clj_money/views/accounts.cljs
@@ -200,7 +200,7 @@

 (defn- account-header
   [account]
-  [:h1 (str "Account " (:name @account))])
+  [:h1 (:name @account)])

 (defn- item-row
   [item]


use every instead of coll-of in model specs

--- src/cljs/daveconservatoire/models.cljs
+++ src/cljs/daveconservatoire/models.cljs
@@ -10,8 +10,8 @@
 (s/def :course/title string?)
 (s/def :course/description string?)
 (s/def :course/author string?)
-(s/def :course/topics (s/coll-of :model/topic []))
-(s/def :course/lessons (s/coll-of :model/lesson []))
+(s/def :course/topics (s/every :model/topic))
+(s/def :course/lessons (s/every :model/lesson))

 (s/def :model/course
   (s/keys :opt [:db/id :url/slug :ordering/position


show add button only in preview mode

show add button only in preview mode

--- src/cljs/salava/badge/ui/settings.cljs
+++ src/cljs/salava/badge/ui/settings.cljs
@@ -264,16 +264,16 @@
         ;;Buttons
         [:div.col-md-12
          [:hr]
-         [:button {:type "button"
-                   :class "btn btn-primary"
-                   :disabled (not (url? @evidence-url-atom))
-                   :on-click #(do
-                                (.preventDefault %)
-                                (if (= @input-mode :url_input) (reset! (cursor state [:evidence :properties :resource_type] ) "url"))
-                                (evidence/save-badge-evidence data state init-data)
-                                (when-not @(cursor state [:evidence :message])(swap! state assoc :tab [settings-tab-content data state init-data]
-                                                                                :tab-no 2)))}
-          (t :core/Add)]
+         (when @(cursor state [:show-preview])[:button {:type "button"
+                                                        :class "btn btn-primary"
+                                                        :disabled (not (url? @evidence-url-atom))
+                                                        :on-click #(do
+                                                                     (.preventDefault %)
+                                                                     (if (= @input-mode :url_input) (reset! (cursor state [:evidence :properties :resource_type] ) "url"))
+                                                                     (evidence/save-badge-evidence data state init-data)
+                                                                     (when-not @(cursor state [:evidence :message])(swap! state assoc :tab [settings-tab-content data state init-data]
+                                                                                :tab-no 2)))}
+                                               (t :core/Add)])
          [:a.cancel {:on-click #(do
                                   (.preventDefault %)
                                   (swap! state assoc :tab [settings-tab-content (dissoc data :evidence) state init-data]


Move instantiation to place used

Move instantiation to place used

--- src/musicbox/one.cljs
+++ src/musicbox/one.cljs
@@ -118,7 +118,6 @@
         (assoc (assoc instrument :h h) :w w))))

 (let [canvas-id "canvas"
-      draw-ctx (util/get-ctx canvas-id)
       instrument (update-size (create-instrument (scales/c-minor)) canvas-id)
       c-app-state (chan)
       c-instrument (chan)
@@ -131,13 +130,14 @@
    (>! c-app-state "start"))

   (go
-   (draw-start-screen draw-ctx)
-   (loop [instrument (<! c-instrument)]
-     (let [[data c] (alts! [c-instrument (timeout 30)])]
-       (condp = c
-         c-instrument (recur data)
-         (do (draw-instrument draw-ctx instrument)
-             (recur instrument))))))
+   (let [draw-ctx (util/get-ctx canvas-id)]
+     (draw-start-screen draw-ctx)
+     (loop [instrument (<! c-instrument)]
+       (let [[data c] (alts! [c-instrument (timeout 30)])]
+         (condp = c
+           c-instrument (recur data)
+           (do (draw-instrument draw-ctx instrument)
+               (recur instrument)))))))

   (go
    (<! c-app-state)


remove inspect

remove inspect

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -983,10 +983,10 @@
     ;;       the inputs things I built for Circle
     (let [s (.-value chat-input)]
       (set! (.-value chat-input)
-            (utils/inspect (str (when (seq s)
-                                  ;; maybe separate with space
-                                  (str s (when (not= " " (last s)) " ")))
-                                "@" id-str " "))))))
+            (str (when (seq s)
+                   ;; maybe separate with space
+                   (str s (when (not= " " (last s)) " ")))
+                 "@" id-str " ")))))

 (defmethod control-event :self-updated
   [browser-state message {:keys [name]} state]


add basic query functionality - error handling still needs work

--- src/passport/core.clj
+++ src/passport/core.clj
@@ -1,6 +1,51 @@
-(ns passport.core)
+(ns passport.core
+  (:require [cheshire.core :as json]
+            [clj-http.lite.client :as http]))

-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))
+(def ^:const ^:private api-username "OPEN_CNAM_SID")
+(def ^:const ^:private api-token "OPEN_CNAM_TOKEN")
+(def ^:const ^:private base-url "https://api.opencnam.com/v2/phone/")
+(def ^:const ^:private error-text-400 "400: Invalid phone number")
+(def ^:const ^:private error-text-401 "401: Incorrect/invalid Professional Tier credentials")
+(def ^:const ^:private error-text-402 "402: Insufficient funds for Professional Tier query")
+(def ^:const ^:private error-text-403 "403: Hourly limit for hobbyist tier exceeded")
+(def ^:const ^:private error-text-404 "404: No CNAM information available for phone number")
+(def ^:const ^:private error-text-generic "Something went wrong. Please check response status")
+
+(defn- get-env-username []
+  (get (System/getenv) api-username ""))
+
+(defn- get-env-token []
+  (get (System/getenv) api-token ""))
+
+(defn- handle-response [resp]
+  (let [status (:status resp)]
+    (cond
+      (= status 200) (json/parse-string (:body resp) true)
+      (= status 400) (json/generate-string {:error error-text-400 :status status})
+      (= status 401) (json/generate-string {:error error-text-401 :status status})
+      (= status 402) (json/generate-string {:error error-text-402 :status status})
+      (= status 403) (json/generate-string {:error error-text-403 :status status})
+      (= status 404) (json/generate-string {:error error-text-404 :status status})
+      :else (json/generate-string {:error error-text-generic :status status}))))
+
+(defn- passport-get [url username token]
+  (-> url
+      (http/get {:accept :json :query-params {"format" "json"} :basic-auth [username token] :throw-exceptions false})
+      (handle-response)))
+
+(defn caller-id
+  "Takes the phone number to query and
+   and optional token and sid. Token and
+   sid can be specified in the OPEN_CNAM_TOKEN
+   and OPEN_CNAM_SID env variables or passed in
+   to this function if use of the professional tier is desired"
+
+  ([phone]
+    (let [url (str base-url phone)
+          username (get-env-username)
+          token (get-env-token)]
+      (passport-get url username token)))
+
+  ([phone username token]
+    (passport-get (str base-url phone) username token)))


Upgrade Noir to use the Hiccup middleware to properly deal with a context path.

Style still messed up due to static path in css from jar, however.

--- integration-tests/apps/ring/noir-app/project.clj
+++ integration-tests/apps/ring/noir-app/project.clj
@@ -1,6 +1,6 @@
 (defproject noir-app "0.1.0-SNAPSHOT"
             :description "FIXME: write this!"
             :dependencies [[org.clojure/clojure "1.3.0"]
-                           [noir "1.2.1"]]
+                           [noir "1.3.0-alpha5"]]
             :main noir-app.server)


Nothing

Nothing

--- src/edu/berkeley/ai/angelic/hierarchies/top_down_forward.clj
+++ src/edu/berkeley/ai/angelic/hierarchies/top_down_forward.clj
@@ -270,6 +270,7 @@
    (doseq [simplifier (butlast *simplifiers*)
 	   maker [strips-hierarchies/get-flat-strips-hierarchy
 		  #(get-hierarchy warehouse/*warehouse-hierarchy-unguided* %)]]
+;     (println simplifier maker (map :name (first (textbook/a-star-search (tdf-node (maker (simplifier *strips-wh*)))))))
      (util/is (*strips-wh-sols* (get-and-check-sol (maker (simplifier *strips-wh*))))))))


Add finally function.

Add finally function.

--- src/promesa/core.cljc
+++ src/promesa/core.cljc
@@ -294,6 +294,15 @@
                    (callback e)
                    (throw e))))))

+(defn finally
+  "Attach handler to promise that will be
+  executed independently if promise is
+  resolved or rejected."
+  [p callback]
+  #?(:clj (-> (p/then #(callback))
+              (p/catch #(callback)))
+     :cljs (.finally p callback)))
+
 (defn branch
   [p callback errback]
   (m/bimap errback callback p))


initial janus migration

initial janus migration

--- src/ophion/db.clj
+++ src/ophion/db.clj
@@ -175,14 +175,18 @@
     {:featureId String}
     {:referenceName String}
     {:chromosome String}
+    {:level Double}
     {:start String}
     {:end String}
     {:genotype String}
     {:phenotype String}
-    {:chromosome String :start String :end String}
-    {:referenceName String :start String :end String}]
+    [:chromosome String :start String :end String]
+    [:referenceName String :start String :end String]]
    :edges
-   [{:variantIn {:featureId String}}]})
+   [{:variantIn {:featureId String}}
+    {:expressionLevel {:level Double}}
+    {:expressionLevel {:gene String}}
+    {:expressionLevel {:sample String}}]})

 (defn -main
   [& args]


Prettier code

Prettier code

--- src/re_demo/core.cljs
+++ src/re_demo/core.cljs
@@ -93,7 +93,8 @@
   []
   (let [id-store        (local-storage (atom nil) ::id-store)
         selected-tab-id (reagent/atom (if (nil? @id-store) (:id (first tabs-definition)) @id-store))   ;; id of the selected tab
-        on-select-tab   #(do (reset! selected-tab-id %1) (reset! id-store %1))]
+        on-select-tab   #(do (reset! selected-tab-id %1)
+                             (reset! id-store %1))]
     (fn ;; _main
       []
       [h-box


address comments about copy

address comments about copy

--- frontend/components/jobs.cljs
+++ frontend/components/jobs.cljs
@@ -148,11 +148,11 @@
              [:li "Someone who considers the user's experience from start to finish."]
              [:li "An aptitude in many skill sets and a hunger for learning."]
              [:li "The ability to communicate effeciently in a developer-centric environment."]
-             [:li "A strong personality with a equally strong sense of taste."]
+             [:li "A keen eye and a very strong sense of taste."]
              [:li "A deep understanding of web design and development best practices."]
              [:li "Work you've done for other web-based developer tools."]
              [:li "Any other interesting work you wish to share, finished or not."]
-             [:li "A willingness to approach sophisticated problems with an incredibly talented team at your side."]]
+             [:li "A willingness to approach sophisticated problems."]]
            [:a
             {:role "button", :href "/jobs#apply"}
             [:span "Apply for Design roles"]]]


Improved handling of event bar when events are long (added vertical scrollbar)

--- src/day8/re_frame/trace/view/container.cljs
+++ src/day8/re_frame/trace/view/container.cljs
@@ -94,7 +94,11 @@
                                 {:on-click #(rf/dispatch [:epochs/previous-epoch])}
                                 {:class "arrow__disabled"}) "◀"]
                  [rc/v-box
-                  :size "auto"
+                  :size     "auto"
+                  :style    {:max-height       "42px" ;42 is exactly 2 lines which is perhaps neater than common/gs-50s (which would allow 3 lines to be seen)
+                             :overflow-x       "hidden"
+                             :overflow-y       "auto"
+                             :background-color "white"}
                   :children [[:span.event-header (prn-str current-event)]]]
                  [:span.arrow (if newer-epochs-available?
                                 {:on-click #(rf/dispatch [:epochs/next-epoch])}
@@ -102,8 +106,7 @@
                   "▶"]]]
      [rc/gap-f :size common/gs-12s]
      [rc/line :size "2px" :color common/sidebar-heading-divider-color]
-     [right-hand-buttons external-window?]])
-  )
+     [right-hand-buttons external-window?]]))

 (defn devtools-inner [traces opts]
   (let [selected-tab      (rf/subscribe [:settings/selected-tab])


gui looking better

gui looking better

--- src/wines/gui.clj
+++ src/wines/gui.clj
@@ -8,13 +8,16 @@

 (def bg-color "#fdfdfd")

+(def max-height 550)
+(def app-height 600)
+
 (ss/native!)

 (def window (ss/frame :title "Wine Finder",
 ;;            :on-close :exit,    ; add this when done...?
 ;;                       :minimum-size [800 :by 400]
-;;                       :resizable? false
-                      :size [900 :by 500]
+                      :resizable? false
+                      :size [950 :by app-height]
               ))

 (defn display [content]
@@ -68,7 +71,7 @@
                          :border [2 "Results" 10]
                          :background :white
                          :foreground :black
-;;                          :size [2000 :by 1000]
+                         :size [300 :by max-height]
                          ))

 (def result-properties
@@ -76,29 +79,33 @@
     :id :result-properties
     :model ["Description: Hello World" "Location: left right"]
     :border [2 "Properties" 10]
-    :minimum-size [600 :by 100]
+    :size [400 :by max-height]
     )
   )

 (def container
-  (ss/border-panel
-    :west (ss/flow-panel
-            :size [200 :by 300]
-            :items [(ss/flow-panel
-                      :size [98 :by 110]
-                      :items [wine-com-img title-lbl]
-                      :background bg-color
-                      )
-                    (ss/grid-panel
-                      :rows 2
-                      :vgap 3
-                      :background bg-color
-                      :items [search-input search-button]
-                      )]
-            :background bg-color)
-    :center results
-    :east result-properties
-    ))
+  (ss/flow-panel
+;;     :hgap   horizontal gap between widgets
+    :vgap   20
+    :background bg-color
+    :align  :center
+    :items [(ss/flow-panel
+              :align :center
+              :vgap 10
+              :size [210 :by max-height]
+              :items [(ss/flow-panel
+                        :size [98 :by 110]
+                        :items [wine-com-img title-lbl]
+                        :background bg-color
+                        )
+                      (ss/grid-panel
+                        :rows 2
+                        :vgap 3
+                        :background bg-color
+                        :items [search-input search-button]
+                        )]
+              :background bg-color)
+            (ss/horizontal-panel :items [ results result-properties ])]))

 (show-window)


fix :requires

fix :requires

--- src/puppetlabs/trapperkeeper/services/jetty/jetty_config.clj
+++ src/puppetlabs/trapperkeeper/services/jetty/jetty_config.clj
@@ -2,8 +2,7 @@
   (:import [java.security KeyStore])
   (:require [clojure.tools.logging :as log]
             [puppetlabs.kitchensink.ssl :as ssl]
-            [puppetlabs.kitchensink.core :as pl-utils]
-            [puppetlabs.kitchensink.core :refer [missing?]]))
+            [puppetlabs.kitchensink.core :refer [missing? num-cpus uuid]]))

 (defn configure-web-server-ssl-from-pems
   "Configures the web server's SSL settings based on Puppet PEM files, rather than
@@ -29,7 +28,7 @@
                   (keys old-ssl-config)))))
   (let [truststore  (-> (ssl/keystore)
                       (ssl/assoc-cert-file! "PuppetDB CA" ssl-ca-cert))
-        keystore-pw (pl-utils/uuid)
+        keystore-pw (uuid)
         keystore    (-> (ssl/keystore)
                       (ssl/assoc-private-key-file! "PuppetDB Agent Private Key" ssl-key keystore-pw ssl-cert))]
     (-> options
@@ -52,7 +51,7 @@
   This bug is solved in Jetty 9, so this check can probably be removed if we
   upgrade."
   ([threads]
-    (jetty7-minimum-threads threads (inc (pl-utils/num-cpus))))
+    (jetty7-minimum-threads threads (inc (num-cpus))))

   ([threads min-threads]
     {:pre [(pos? threads)


Schematized chessground.cljs

Schematized chessground.cljs

--- src/chessground.cljs
+++ src/chessground.cljs
@@ -4,14 +4,25 @@
             [chessground.data :as data]
             [chessground.api :as api]
             [chessground.show :as show]
-            [chessground.ctrl :as ctrl])
-  (:require-macros [cljs.core.async.macros :as am]))
+            [chessground.ctrl :as ctrl]
+            [chessground.schemas :refer [AnyMap]]
+            [schema.core :as s]
+            [cljs.core.async.impl.channels :refer [ManyToManyChannel]])
+  (:require-macros [cljs.core.async.macros :as am]
+                   [schema.macros :as sm :refer [defschema]]))

 (extend-type js/NodeList ISeqable (-seq [array] (array-seq array 0)))

-(defn load-app
+(defschema AppMap
+  {:element   js/HTMLDivElement
+   :state     Atom
+   :channels  {s/Keyword ManyToManyChannel}
+   :consumers {s/Keyword js/Function}})
+
+(sm/defn load-app :- AppMap
   "Return a map containing the initial application"
-  [element config]
+  [element :- js/HTMLDivElement
+   config :- js/Object]
   {:element element
    :state (atom (data/make config))
    :channels {:toggle-orientation (a/chan)
@@ -27,8 +38,7 @@
               :set-pieces (a/chan)
               :drop-off (a/chan)
               :api-move (a/chan)
-              :show-moved (a/chan)
-              }
+              :show-moved (a/chan)}
    :consumers {:toggle-orientation ctrl/toggle-orientation
                :set-orientation ctrl/set-orientation
                :set-fen ctrl/set-fen
@@ -42,15 +52,13 @@
                :set-pieces ctrl/set-pieces
                :drop-off ctrl/drop-off
                :api-move ctrl/api-move
-               :show-moved ctrl/show-moved
-               }
-   })
+               :show-moved ctrl/show-moved}})

-(defn init-updates
+(sm/defn init-updates
   "For every entry in a map of channel identifiers to consumers,
    initiate a channel listener which will update the application state
    using the appropriate function whenever a value is received"
-  [app]
+  [app :- AppMap]
   (doseq [[ch update-fn] (:consumers app)]
     (am/go (while true
              (let [val (a/<! (get (:channels app) ch))
@@ -59,10 +67,11 @@
                (reset! (:state app) new-state)
                (mutate-dom (:element app) (:channels app)))))))

-(defn ^:export main
+(sm/defn ^:export main :- js/Object
   "Application entry point; returns the public JavaScript API"
-  [element config]
-  (let [app (load-app element (or (js->clj config) {}))]
+  [element :- js/HTMLDivElement
+   config :- AnyMap]
+  (let [app (load-app element (js->clj (or config {})))]
     (show/app (:element app) @(:state app) (:channels app))
     (init-updates app)
     (api/build (:channels app) (:state app) (:element app))))


"And I hope you've learned to sanitize your database inputs." (http://xkcd.com/327/)

--- src/client/chat.cljs
+++ src/client/chat.cljs
@@ -26,7 +26,7 @@
   [{:keys [user color msg]}]
   [:p.message
     [:span#user {:class (str "color-" color)}(str user ": ")]
-    [:span.txt msg]])
+    [:span.txt (hiccups.runtime/escape-html msg)]])

 (hiccups/defhtml chat-join-html
   [{:keys [user color]}]


Add cljs SVG bounding box helper.

Add cljs SVG bounding box helper.

--- src/cljx/c2/svg.cljx
+++ src/cljx/c2/svg.cljx
@@ -19,6 +19,18 @@
   (match [coordinates]
          [[x y]] (str "scale(" x "," y ")")
          [{:x x :y y}] (recur [x y])))
+
+
+(defn ^:cljs get-bounds
+  "Returns map of {:x :y :width :height} containing SVG element bounding box.
+   All coordinates are in userspace. See: http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable"
+  [$svg]
+  (let [b (.getBBox $svg)]
+    {:x (.-x b)
+     :y (.-y b)
+     :width (.-width b)
+     :height (.-height b)}))
+

 (defn axis
@@ -43,11 +55,11 @@

     (into [:g.axis {:class (name orientation)}
            [:line.rule (apply hash-map (interleave [y1 y2] (:range scale)))]]
-           (map (fn [d]
-            [:g.major-tick {:transform (translate {x 0 y (scale d)})}
-             [:text {x (* parity text-margin)} (formatter d)]
-             [:line {x1 0 x2 (* parity major-tick-width)}]])
-          ticks))))
+          (map (fn [d]
+                 [:g.major-tick {:transform (translate {x 0 y (scale d)})}
+                  [:text {x (* parity text-margin)} (formatter d)]
+                  [:line {x1 0 x2 (* parity major-tick-width)}]])
+               ticks))))

 (def ArcMax (- Tau 0.0000001))


Handle both cases (jar/file) by default (even mixed) while doing resolve (#31)

* Handle both cases by defile while doing resolve

- for lein and jars behaves same
- able to handle mixed includes

* (:import (java.io StringReader))

* optimized

--- src/aero/core.clj
+++ src/aero/core.clj
@@ -6,7 +6,8 @@
    [clojure.string :refer [trim]]
    [clojure.walk :refer [walk postwalk]]
    [clojure.java.io :as io]
-   [clojure.java.shell :as sh]))
+   [clojure.java.shell :as sh])
+  (:import (java.io StringReader)))

 (declare read-config)

@@ -98,7 +99,7 @@
           (io/file (-> source io/file .getParent) include))]
     (if (.exists fl)
       fl
-      (java.io.StringReader. (pr-str {:aero/missing-include include})))))
+      (StringReader. (pr-str {:aero/missing-include include})))))

 (defn resource-resolver [_ include]
   (io/resource include))
@@ -106,9 +107,16 @@
 (defn root-resolver [_ include]
   include)

+(defn adaptive-resolver [source include]
+  (let [include (or (io/resource include)
+                    include)]
+    (if (string? include)
+      (relative-resolver source include)
+      include)))
+
 (def default-opts
   {:profile  :default
-   :resolver relative-resolver})
+   :resolver adaptive-resolver})

 (defrecord Deferred [delegate])


Avoid truth and equality

Avoid truth and equality

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -8,7 +8,7 @@
   (let [keymap (make-array (alength to-fields))]
     (dotimes [i (alength from-fields)]
       (dotimes [j (alength to-fields)]
-        (when (= (aget from-fields i) (aget to-fields j))
+        (when (identical? (aget from-fields i) (aget to-fields j))
           (aset keymap j i))))
     (dotimes [j (alength keymap)]
       (assert (not (nil? (aget keymap j))) (str "Fields mismatch: " from-fields " :: " to-fields))) ;; ie every to-field is in from-fields somewhere


fix typo in docstring

fix typo in docstring

--- src/chat/server/db.clj
+++ src/chat/server/db.clj
@@ -803,7 +803,7 @@

 (defn group-set!
   "Set a key to a value for the group's settings  This will throw if
-  permissions are changed in between reading & setting"
+  settings are changed in between reading & setting"
   [group-id k v]
   (let [old-prefs (-> (d/pull (d/db *conn*) [:group/settings] [:group/id group-id])
                       :group/settings)


don't deref more than necessary

don't deref more than necessary

--- src/chronoid/core.cljs
+++ src/chronoid/core.cljs
@@ -69,15 +69,15 @@
    based on the deadline and :tolerance-early and :tolerance-late, which are
    either provided as keyword arguments, or taken from the clock's options."
   [{:keys [id clock-id clock deadline tolerance-early tolerance-late] :as event}]
-  (let [clock    (if clock-id
-                   (get *clocks* clock-id)
-                   clock)
+  (let [clock    @(if clock-id
+                    (get *clocks* clock-id)
+                    clock)
         id       (or id (gensym 'event))
-        latest   (+ deadline (or tolerance-late  (:tolerance-late @clock)))
-        earliest (- deadline (or tolerance-early (:tolerance-early @clock)))]
+        latest   (+ deadline (or tolerance-late  (:tolerance-late clock)))
+        earliest (- deadline (or tolerance-early (:tolerance-early clock)))]
     (-> event
         (assoc :id id
-               :clock-id (:id @clock)
+               :clock-id (:id clock)
                :latest-time latest
                :earliest-time earliest)
         (dissoc :clock))))


[core] Add 'categorize-peer-liveness fn.

This fn transforms the :peers map in local state into a form more suited to
choosing a random gossip partner.

--- src/birdie_tell/core.clj
+++ src/birdie_tell/core.clj
@@ -183,6 +183,30 @@
         (println "Seems dead: " [host port])
         (handler-fn false peer-host-port)))))

+(defn- categorize-peer-liveness
+  "Take a peers map with :identified and :potential keys, and extract
+  a mapping of peer states to host-port strings.
+
+  Example:
+      (categorize-peer-liveness
+       {:identified {\"uuid:1\" {:alive? true :host-port \"127.0.0.1:400\"}
+                     \"uuid:2\" {:alive? false :host-port \"127.0.0.1:401\"}}
+        :potential #{\"127.0.0.1:402\"}})
+      ;;=> {:alive [\"127.0.0.1:400\"]
+      ;;    :dead [\"127.0.0.1:401\"]
+      ;;    :potential [\"127.0.0.1:402\"]}
+  "
+  [peers]
+  (let [categorized (reduce
+                     (fn [categories [_k v]]
+                       (let [category (if (:alive? v) :alive :dead)
+                             host-port (:host-port v)
+                             category-members (categories category)]
+                         (assoc categories category (conj category-members host-port))))
+                     {:alive [] :dead []}
+                     (:identified peers))]
+    (assoc categorized :potential (-> peers :potential vec))))
+
 (defn choose-news
   "Choose all the latest hot news that I have in my little bird-brain.


s/unifyc/unify/

s/unifyc/unify/

--- src/babel/ug.cljc
+++ src/babel/ug.cljc
@@ -1,7 +1,7 @@
 (ns babel.ug
   (:refer-clojure :exclude [get-in resolve])
   (:require [clojure.string :as string]
-            [dag_unify.core :refer (fail? get-in unifyc)]))
+            [dag_unify.core :refer (fail? get-in unify)]))

 (def phrasal {:phrasal true})

@@ -14,7 +14,7 @@
         head-essere (atom :top)
         head-is-pronoun (atom :top)
         head-sem (atom :top)]
-    (unifyc phrasal
+    (unify phrasal
             {:synsem {:cat head-cat
                       :essere head-essere
                       :pronoun head-is-pronoun
@@ -29,7 +29,7 @@
 ;;  /     \
 ;; H[1]    C
 (def head-principle
-  (unifyc head-principle-no-infl
+  (unify head-principle-no-infl
           phrasal
           (let [head-infl (atom :top)
                 agr (atom :top)]
@@ -219,7 +219,7 @@
                                   {:synsem {:infl :present}})))))]
        (let [merged
              (if (= input :fail) :fail
-                 (unifyc input finitize))]
+                 (unify input finitize))]
          (do
            merged)))))) ;; for now, no recursive call.

@@ -264,7 +264,7 @@
      (throw (js/Error. error-string))))

 (defn unify-check [ & vals]
-  (let [result (apply unifyc vals)]
+  (let [result (apply unify vals)]
     (if (fail? result)
       (exception (str "failed to unify grammar rule with values: " vals))
       result)))


Fix typo

Fix typo

--- src/braid/core/core.cljc
+++ src/braid/core/core.cljc
@@ -43,7 +43,7 @@
        (swap! braid.core.client.ui.views.new-message/autocomplete-engines conj f))

      (defn register-message-transform!
-       "Register new stateless transformers to message bodies. The functions should expect to recieve either some text or hiccup nodes and should return the same."
+       "Register new stateless transformers to message bodies. The functions should expect to receive either some text or hiccup nodes and should return the same."
        [f]
        {:pre [(fn? f)]}
        (swap! braid.core.client.ui.views.message/stateless-formatters conj f))


add a touch

add a touch

--- src/cake/tasks/swank.clj
+++ src/cake/tasks/swank.clj
@@ -29,7 +29,7 @@
         [opts (swank-opts project opts)]
         (if (not (swank/installed?))
           (do (println "swank-clojure not installed.")
-              (println "add swank-clojure as a dependency in project.clj or add .cake/swank to enable"))
+              (println "add swank-clojure as a dependency in project.clj or touch .cake/swank to enable"))
           (if (swank/running?)
             (let [num (swank/num-connections), s (if (= 1 num) "" "s")]
               (println (format "swank currently running on port %d with %d active connection%s" (swank/port) num s)))


Bump lein-shadow

Bump lein-shadow

See https://gitlab.com/nikperic/lein-shadow/-/blob/master/CHANGELOG.md and https://gitlab.com/nikperic/lein-shadow/-/merge_requests/3 for full list of changes

Thanks to @superstructor for his work on it

--- src/leiningen/new/re_frame/project.clj
+++ src/leiningen/new/re_frame/project.clj
@@ -18,7 +18,7 @@
                  [re-pressed "0.3.1"]{{/re-pressed?}}{{#breaking-point?}}
                  [breaking-point "0.1.2"]{{/breaking-point?}}]

-  :plugins [[lein-shadow "0.1.7"]
+  :plugins [[lein-shadow "0.2.0"]
             {{#garden?}}[lein-garden "0.3.0"]{{/garden?}}{{#less?}}
             [lein-less "1.7.5"]{{/less?}}
             [lein-shell "0.5.0"]]


make adding messages notify extensions

make adding messages notify extensions

--- src/chat/server/sync.clj
+++ src/chat/server/sync.clj
@@ -9,7 +9,10 @@
             [chat.server.invite :as invites]
             [chat.server.digest :as digest]
             [clojure.set :refer [difference intersection]]
-            [chat.shared.util :refer [valid-nickname? valid-tag-name?]]))
+            [chat.shared.util :refer [valid-nickname? valid-tag-name?]]
+            [chat.server.extensions :refer [handle-thread-change]]
+            ; just requiring to register multimethods
+            chat.server.extensions.asana))

 (let [{:keys [ch-recv send-fn ajax-post-fn ajax-get-or-ws-handshake-fn
               connected-uids]}
@@ -43,6 +46,13 @@
   [ev-msg]
   ; Do nothing, just avoid unhandled event message
   )
+
+(defn notify-extensions
+  "Notify extensions about a thread changing if they're interested"
+  [thread-id]
+  (let [exts (db/with-conn (db/extensions-watching thread-id))]
+    (doseq [ext exts]
+      (handle-thread-change ext thread-id))))

 (defn broadcast-thread
   "broadcasts thread to all subscribed users, except those in ids-to-skip"
@@ -59,7 +69,8 @@
       (let [user-tags (db/with-conn (db/get-user-visible-tag-ids uid))
             filtered-thread (update-in thread [:tag-ids] (partial filter user-tags))
             thread-with-last-opens (db/with-conn (db/thread-add-last-open-at filtered-thread uid))]
-        (chsk-send! uid [:chat/thread thread-with-last-opens])))))
+        (chsk-send! uid [:chat/thread thread-with-last-opens])))
+    (notify-extensions thread-id)))

 (defn broadcast-user-change
   "Broadcast user info change to clients that can see this user"


remove broadcaster

remove broadcaster

--- src/chat/server/sync.clj
+++ src/chat/server/sync.clj
@@ -17,15 +17,6 @@
 (defroutes sync-routes
   (GET  "/chsk" req (ring-ajax-get-or-ws-handshake req))
   (POST "/chsk" req (ring-ajax-post                req)))
-
-(defn start-broadcaster! []
-  (go-loop [i 0]
-    (<! (async/timeout 10000))
-    (println (format "Broadcasting server->user: %s" @connected-uids))
-    (doseq [uid (:any @connected-uids)]
-      (chsk-send! uid
-                  [:some/broadcast {:i i}]))
-    (recur (inc i))))

 (defmulti event-msg-handler :id)


redirect / to index.html

redirect / to index.html

--- src/t2000/handler.clj
+++ src/t2000/handler.clj
@@ -2,11 +2,13 @@
   (:require [compojure.core :refer :all]
             [compojure.route :as route]
             [t2000.twitlib :as twitlib]
-            [ring.util.response :refer [response content-type]]
+            [ring.util.response :refer [response redirect content-type]]
             [ring.middleware.cors :refer [wrap-cors]]
             [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

-(defroutes app-routes
+(defroutes app-routes
+  (GET "/" [] (redirect "/index.html"))
+
   (GET "/data" []
        (-> (twitlib/get-data)
            response


Make grandfathered\? handle trials appropriately.

--- src-cljs/frontend/models/plan.cljs
+++ src-cljs/frontend/models/plan.cljs
@@ -141,12 +141,16 @@
         {:keys [free_containers container_cost]} template-properties]
     (max 0 (* container_cost (- containers free_containers)))))

-(defn cost [plan containers]
+(defn cost [plan containers & {:keys [include-trial?]}]
   (let [paid-plan-template (or (-> plan :paid :template)
                                (-> plan :enterprise :template)
                                default-template-properties)
         plan-base-price (:price paid-plan-template)
-        paid-plan-containers (- containers (freemium-containers plan))]
+        paid-plan-containers (- containers
+                                (freemium-containers plan)
+                                (if-not include-trial?
+                                  0
+                                  (trial-containers plan)))]
     (if (< paid-plan-containers 1)
       0
       (+ plan-base-price
@@ -160,7 +164,7 @@
 (defn grandfathered? [plan]
   (and (paid? plan)
        (< (stripe-cost plan)
-          (cost plan (usable-containers plan)))))
+          (cost plan (usable-containers plan) :include-trial? true))))

 (defn admin?
   "Whether the logged-in user is an admin for this plan."


Don't fetch data for 'old' inbox anymore.

--- src-cljs/pepa/components/root.cljs
+++ src-cljs/pepa/components/root.cljs
@@ -25,8 +25,6 @@
   application."
   [state route]
   (go
-    ;; Inbox initial data
-    (om/update! state :workflow/inbox inbox/initial-data)
     (<! (api/fetch-tags! state))))

 (defn ^:private transition-to! [state route query-params]


Add support for :get-tests metadata on Vars

--- src/main/clojure/lazytest/testable.clj
+++ src/main/clojure/lazytest/testable.clj
@@ -26,8 +26,10 @@

   clojure.lang.Var
   (get-tests [this-var]
-    (when (bound? this-var)
-      (let [value (var-get this-var)]
-	(when (extends? Testable (type value))
-	  (filter-focused
-	   (get-tests value)))))))
+    (if-let [f (:get-tests (meta this-var))]
+      (do (assert (fn? f)) (f))
+      (when (bound? this-var)
+	(let [value (var-get this-var)]
+	  (when (extends? Testable (type value))
+	    (filter-focused
+	     (get-tests value))))))))


add node header further down

add node header further down

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -983,9 +983,9 @@
           (if (and optim (not= optim :none))
             (->> js-sources
               (apply optimize all-opts)
-              (add-header all-opts)
               (add-wrapper all-opts)
               (add-source-map-link all-opts)
+              (add-header all-opts)
               (output-one-file all-opts))
             (apply output-unoptimized all-opts js-sources)))))))


Get port from sys env PORT for heroku

Get port from sys env PORT for heroku

--- src/clj/potoo/system.clj
+++ src/clj/potoo/system.clj
@@ -20,8 +20,9 @@
         {:datomic-connection :db}))))

 (defn -main [& args]
-  (.start
-    (new-system
-      {:db-uri   "datomic:mem://localhost:4334/potoos"
-       :port 8081
-       :join?    true})))
+  (let [port (Integer/parseInt (get (System/getenv) "PORT" "8081"))]
+    (.start
+      (new-system
+        {:db-uri "datomic:mem://localhost:4334/potoos"
+         :port   port
+         :join?  true}))))


No need to wrap top-level protocol methods.

--- src/cljs/go/compiler.clj
+++ src/cljs/go/compiler.clj
@@ -590,19 +590,18 @@

 (defn emit-protocol-method
   [protocol name {:keys [type params expr env recurs]} ret-tag]
-  (emit-wrap env
-    (emits "func (self__ *" (-> params first :tag go-type-fqn) ") "
-           (-> name munge go-short-name go-public)
-           (when-not ('#{cljs.core/Object} protocol)
-             (str "_Arity" (cond-> (count params)
-                                   (and (= 'cljs.core/IFn protocol)
-                                        (= '-invoke (:name name))) dec))))
-    (emit-fn-signature (rest params) ret-tag)
-    (emits "{")
-    (binding [*go-return-tag* (when (go-needs-coercion? (:tag expr) ret-tag)
-                                ret-tag)]
-      (emit-fn-body type expr recurs))
-    (emitln "}")))
+  (emits "func (self__ *" (-> params first :tag go-type-fqn) ") "
+         (-> name munge go-short-name go-public)
+         (when-not ('#{cljs.core/Object} protocol)
+           (str "_Arity" (cond-> (count params)
+                                 (and (= 'cljs.core/IFn protocol)
+                                      (= '-invoke (:name name))) dec))))
+  (emit-fn-signature (rest params) ret-tag)
+  (emits "{")
+  (binding [*go-return-tag* (when (go-needs-coercion? (:tag expr) ret-tag)
+                              ret-tag)]
+    (emit-fn-body type expr recurs))
+  (emitln "}"))

 (defn emit-variadic-fn-method
   [{:keys [type name variadic params expr env recurs max-fixed-arity] :as f}]


CMR-512: Changes to support cahced lookups of parent collections.

--- src/cmr/common/cache.clj
+++ src/cmr/common/cache.clj
@@ -8,8 +8,8 @@
 (defn cache-lookup
   "Returns value of a key if present else it will create a cache entry with the suplied key and value
   generated by the supplied function."
-  [cache-atom key f]
-  (-> (swap! cache-atom
+  [cmr-cache key f]
+  (-> (swap! (:atom cmr-cache)
              (fn [cache]
                (if (cc/has? cache key)
                  (cc/hit cache key)
@@ -18,11 +18,16 @@

 (defn create-cache
   "Create system level cache."
-  []
-  (atom (cc/lru-cache-factory {})))
+  ([]
+   (create-cache (cc/lru-cache-factory {})))
+  ([initial-cache]
+   {:initial initial-cache
+    :atom (atom initial-cache)}))

 (defn reset-cache
-  [cache-atom]
-  (reset! cache-atom (cc/lru-cache-factory {})))
+  [cmr-cache]
+  (reset! (:atom cmr-cache) (:initial cmr-cache)))

+
+


pass offering type to transaction pending sub

--- src/name_bazaar/ui/subs/offerings_subs.cljs
+++ src/name_bazaar/ui/subs/offerings_subs.cljs
@@ -303,7 +303,6 @@
 (reg-sub
   :offering.unregister/tx-pending?
   (fn [[_ offering-address offering-type]]
-    ;; TODO: buy now or auction
     (subscribe [:district0x/tx-pending? offering-type :unregister {:offering/address offering-address}]))
   identity)


add file-name info in error message if provided

--- src/main/clojure/clojure/tools/reader/reader_types.clj
+++ src/main/clojure/clojure/tools/reader/reader_types.clj
@@ -27,7 +27,9 @@
   (get-line-number [reader]
     "Returns the line number of the next character to be read from the stream")
   (get-column-number [reader]
-    "Returns the line number of the next character to be read from the stream"))
+    "Returns the line number of the next character to be read from the stream")
+  (get-file-name [reader]
+    "Returns the file name the reader is reading from, or nil"))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; reader deftypes
@@ -95,7 +97,7 @@

 (deftype IndexingPushbackReader
     [rdr ^:unsynchronized-mutable line ^:unsynchronized-mutable column
-     ^:unsynchronized-mutable line-start? ^:unsynchronized-mutable prev]
+     ^:unsynchronized-mutable line-start? ^:unsynchronized-mutable prev file-name]
   Reader
   (read-char [reader]
     (when-let [ch (read-char rdr)]
@@ -120,7 +122,8 @@

   IndexingReader
   (get-line-number [reader] (int (inc line)))
-  (get-column-number [reader] (int column)))
+  (get-column-number [reader] (int column))
+  (get-file-name [reader] file-name))

 (extend-type java.io.PushbackReader
   Reader
@@ -145,7 +148,8 @@
    :get-column-number (compile-if >=clojure-1-5-alpha*?
                         (fn [rdr]
                           (.getColumnNumber ^LineNumberingPushbackReader rdr))
-                        (fn [rdr] 0))})
+                        (fn [rdr] 0))
+   :get-file-name (constantly nil)})

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Public API
@@ -191,8 +195,10 @@
   ([s-or-rdr]
      (indexing-push-back-reader s-or-rdr 1))
   ([s-or-rdr buf-len]
+     (indexing-push-back-reader s-or-rdr buf-len nil))
+  ([s-or-rdr buf-len file-name]
      (IndexingPushbackReader.
-      (if (string? s-or-rdr) (string-push-back-reader s-or-rdr buf-len) s-or-rdr) 0 1 true nil)))
+      (if (string? s-or-rdr) (string-push-back-reader s-or-rdr buf-len) s-or-rdr) 0 1 true nil file-name)))

 (defn read-line
   "Reads a line from the reader or from *in* if no reader is specified"
@@ -213,5 +219,8 @@
   (throw (ex-info (apply str msg)
                   (merge {:type :reader-exception}
                          (when (indexing-reader? rdr)
-                           {:line (get-line-number rdr)
-                            :column (get-column-number rdr)})))))
+                           (merge
+                            {:line (get-line-number rdr)
+                             :column (get-column-number rdr)}
+                            (when-let [file-name (get-file-name rdr)]
+                              {:file file-name})))))))


proper parameter handling in views

proper parameter handling in views

--- src/caws/core.clj
+++ src/caws/core.clj
@@ -175,17 +175,17 @@
 (defn GET [key] ((:get *request*) key))
 (defn POST [key] ((:post *request*) key))

-(defn ->param-getter [param-type]
+(defn ->param-getter [param-type name]
   (assert (or (= :get param-type) (= :post param-type)) param-type)
-  ({:get GET :post POST} param-type))
-
-(defn ->lookup-pair [[param-type name]] `[~name (~(->param-getter param-type) ~(str name))])
+  `((~param-type *request*) ~(str name)))
+
+(defn ->lookup-pair [[param-type name]] `[~name ~(->param-getter param-type name)])

 (defn remove-prefix [prefix str]
   (.substring str (count prefix)))

 (defn parse-view-params [params]
-  (vec (concat [(first params) '*request*]
+  (vec (concat `[~(first params) *request*]
                (apply concat (map ->lookup-pair (partition 2 (rest params)))))))

 (defmacro view [name params & body]


better github fetcher

better github fetcher

--- src/dasha/github.clj
+++ src/dasha/github.clj
@@ -6,7 +6,17 @@
   (gists/specific-gist
     (last (str/split url #"/"))))

+(defn- predicate [ext]
+  (fn [x] (.endsWith (:filename x) ext)))
+
+(defn- get-raw [pred collection]
+  (:raw_url (first (filter pred collection))))
+
 (defn get-raws-from-gist-url [url]
-  (let [g (get-gist-from-url url)]
-    (for [[_ v] (:files g)]
-      (:raw_url v))))+  (let [gist (get-gist-from-url url)]
+    (let [files (:files gist)
+          sets (for [[_ v] files] v)
+          c (predicate "clj")
+          cj (predicate "cljs")]
+      {:backend  (get-raw c sets)
+       :frontend (get-raw cj sets)})))


De-n00bed multimethod dispatcher

De-n00bed multimethod dispatcher

--- src/depends/reader.clj
+++ src/depends/reader.clj
@@ -236,11 +236,6 @@
         (conj dependencies (create-dependency class-name fixed-exception-type :uses)))
     ]))

-
-(defn- class-of-first
-  [& args]
-  (class (first args)))
-
 (defn- build-class-info-for-missing-dependency
   "Constructs a class-info for the given fully qualified type name if it doesn't already exist in
    class-infos, or nil otherwise."
@@ -289,7 +284,7 @@
   Notes:
    * Keys in the first map may have empty or nil values.
    * Each source/target pair may appear more than once in the relationship set, albeit with a different relationship type each time."
-  class-of-first)
+  #(class (first %&)))

 (defmethod class-info java.io.InputStream
   ([^java.io.InputStream class-input-stream] (class-info class-input-stream nil))


Fix usage string of sort command.

Fix usage string of sort command.

--- src/cljam/cli.clj
+++ src/cljam/cli.clj
@@ -139,7 +139,7 @@
 (defn- sort-usage [options-summary]
   (->> ["Sort alignments by leftmost coordinates."
         ""
-        "Usage: cljam sort [-o ORDER] <in.bam|sam> <out.bam|sam>"
+        "Usage: cljam sort [-o ORDER] [-c CHUNK] <in.bam|sam> <out.bam|sam>"
         ""
         "Options:"
         options-summary]


docstrings

docstrings

--- src/euler/euler001.clj
+++ src/euler/euler001.clj
@@ -12,8 +12,6 @@
 ;; Find the sum of all the multiples of 3 or 5 below 1000.

 (defn p001
-  "*Int, (Int) -> Int*
-  Sums up the multiples of all integers below limit."
   ([] (p001 1000 3 5))
   ([limit & divisors]
     ;; for the range 0 to (limit - 1)
@@ -41,8 +39,6 @@
 ;; - rec case: ``fib (n > 1) = fib(n - 1) + fib(n - 2)``

 (defn p002
-  "*Int -> Int*
-  Retrieve the sum of all even Fibonacci numbers up to n."
   ([] (p002 (* 4 1000 1000)))
   ([n]
    (->> fibs
@@ -182,11 +178,10 @@
 ;; **Task:**
 ;; Find the sum of all the primes below two million.

-(defn p010 [n]
+(defn p010
+  ([] (p010 2000000))
+  ([n]
   (->>
    primes
    (take-while #(< % n))
-   (reduce +)))
-
-;; calculation
-;; (p010 2000000)+   (reduce +))))


Added content type to recorded request

Added content type to recorded request

--- src/fake_http/fake.clj
+++ src/fake_http/fake.clj
@@ -1,6 +1,6 @@
 (ns fake-http.fake
   (:import (okhttp3.mockwebserver MockWebServer Dispatcher MockResponse RecordedRequest))
-  (:require [clojure.string :refer [split blank?]]))
+  (:require [clojure.string :refer [split blank? lower-case]]))

 (defn- index-of [coll item]
   "Get the index of an item in a collection"
@@ -12,9 +12,11 @@
       str
       (.substring str (inc index-of-after)))))

-(defn map-vals [f m]
-  "Maps the values in a map with the function f"
-  (into {} (for [[k v] m] [k (f v)])))
+(defn map-kv [fk fv m]
+  "Maps the keys and values in a map with the supplied functions.
+  fk = the function for the keys
+  fv = the function for the values"
+  (into {} (for [[k v] m] [(fk k) (fv v)])))

 (defn- keywordize-keys
   "Recursively transforms all map keys from strings to keywords."
@@ -93,8 +95,8 @@
                                             (.toMultimap)
                                             ; Create a clojure map of the multimap.
                                             ; The multimap contains a list as value and thus we map it to a clojure vector
-                                            (map-vals vec)
-                                            (keywordize-keys))
+                                            (map-kv lower-case vec))
+                         :content-type (last (get :headers "content-type"))
                          :request-line (.getRequestLine request)
                          :path         (.getPath request)
                          :body         body


Fixing typo, should be nil, not null

Fixing typo, should be nil, not null

--- src-cljs/tropefest/core.cljs
+++ src-cljs/tropefest/core.cljs
@@ -44,7 +44,7 @@
 ; Graph!

-(def state (atom {:sigma null}))
+(def state (atom {:sigma nil}))

 (-> js/sigma .-classes .-graph (.addMethod "neighbors",
                                            (fn [node-id]


s/unifyc/unify/

s/unifyc/unify/

--- src/babel/francais/morphology.cljc
+++ src/babel/francais/morphology.cljc
@@ -8,7 +8,7 @@
    [clojure.string :refer (trim)]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
-   [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unify unifyc)]))
+   [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unify)]))

 (def regular-patterns
   (concat
@@ -44,7 +44,7 @@
                        lex (string/replace surface-form from to)]
                    (filter (fn [result] (not (= :fail result)))
                            (map (fn [lexical-entry]
-                                  (unifyc unify-with lexical-entry))
+                                  (unify unify-with lexical-entry))
                                 (get lexicon lex)))))))
            regular-patterns)))

@@ -381,11 +381,10 @@

           (and (map? a-map)
                (not (= :no-français (get-in a-map [:français] :no-français))))
-          (unifyc {:français {:français a-string}}
-                  common
-                  a-map)
-
+          (unify {:français {:français a-string}}
+                 common
+                 a-map)
         true
-        (unifyc a-map
-                {:français {:français a-string}}
-                common))))
+        (unify a-map
+               {:français {:français a-string}}
+               common))))


increase visibility: move preposition-plus-article rule to the top

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -22,6 +22,57 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [dag_unify.core :refer (copy dissoc-paths fail? get-in merge ref? unifyc)]))
+
+;; TODO: convert all morphology rules to this format used for prepositions:
+(def preposition-plus-article
+  [["a il"   "al"]
+   ["a lo"   "allo"]
+   ["a la"   "alla"]
+   ["a l'"   "all'"]
+   ["a i"    "ai"]
+   ["a gli"  "agli"]
+   ["a le"   "alle"]
+
+   ["da il"  "dal"]
+   ["da lo"  "dallo"]
+   ["da la"  "dalla"]
+   ["da l'"  "dall'"]
+   ["da i"   "dai"]
+   ["da gli" "dagli"]
+   ["da le"  "dalle"]
+
+   ["de il"  "del"]
+   ["de lo"  "dello"]
+   ["de la"  "della"]
+   ["de l'"  "dell'"]
+   ["de i"   "dei"]
+   ["de gli" "degli"]
+   ["de le"  "delle"]
+
+   ["di il"  "del"]
+   ["di lo"  "dello"]
+   ["di la"  "della"]
+   ["di l'"  "dell'"]
+   ["di i"   "dei"]
+   ["di gli" "degli"]
+   ["di le"  "delle"]
+
+   ["in il"  "nel"]
+   ["in lo"  "nello"]
+   ["in la"  "nella"]
+   ["in l'"  "nell'"]
+   ["in i"   "nei"]
+   ["in gli" "negli"]
+   ["in le"  "nelle"]
+
+   ["su il"  "sul"]
+   ["su lo"  "sullo"]
+   ["su la"  "sulla"]
+   ["su l'"  "sull'"]
+   ["su i"   "sui"]
+   ["su gli" "sugli"]
+   ["su le"  "sulle"]
+      ])

 ;; replace-patterns are declarative data that determine how analysis (and soon conjugation) are performed.
 (def replace-patterns
@@ -1214,55 +1265,19 @@
      true
      expr)))

-(def preposition-plus-article
-  [[#"\ba il "  "al "]
-   [#"\ba lo "  "allo "]
-   [#"\ba la "  "alla "]
-   [#"\ba l'"   "all'"]
-   [#"\ba i "   "ai "]
-   [#"\ba gli " "agli "]
-   [#"\ba le "  "alle "]
-
-   [#"\bda il "  "dal "]
-   [#"\bda lo "  "dallo "]
-   [#"\bda la "  "dalla "]
-   [#"\bda l'"   "dall'"]
-   [#"\bda i "   "dai "]
-   [#"\bda gli " "dagli "]
-   [#"\bda le "  "dalle "]
-
-   [#"\bde il "  "del "]
-   [#"\bde lo "  "dello "]
-   [#"\bde la "  "della "]
-   [#"\bde l'"   "dell'"]
-   [#"\bde i "   "dei "]
-   [#"\bde gli " "degli "]
-   [#"\bde le "  "delle "]
-
-   [#"\bdi il "  "del "]
-   [#"\bdi lo "  "dello "]
-   [#"\bdi la "  "della "]
-   [#"\bdi l'"   "dell'"]
-   [#"\bdi i "   "dei "]
-   [#"\bdi gli " "degli "]
-   [#"\bdi le "  "delle "]
-
-   [#"\bin il "  "nel "]
-   [#"\bin lo "  "nello "]
-   [#"\bin la "  "nella "]
-   [#"\bin l'"   "nell'"]
-   [#"\bin i "   "nei "]
-   [#"\bin gli " "negli "]
-   [#"\bin le "  "nelle "]
-
-   [#"\bsu il "  "sul "]
-   [#"\bsu lo "  "sullo "]
-   [#"\bsu la "  "sulla "]
-   [#"\bsu l'"   "sull'"]
-   [#"\bsu i "   "sui "]
-   [#"\bsu gli " "sugli "]
-   [#"\bsu le "  "sulle "]
-      ])
+(def ppa-tokens-to-surface
+  (map (fn [pair]
+         [(java.util.regex.Pattern/compile
+           (str "\\b" (first pair) "\\b"))
+          (second pair)])
+       preposition-plus-article))
+
+(def ppa-surface-to-tokens
+  (map (fn [pair]
+         [(java.util.regex.Pattern/compile
+           (str "\\b" (second pair) "\\b"))
+          (first pair)])
+       preposition-plus-article))

 (defn conjugate-italian-prep [prep np]
   (let [concat (str (get prep :italiano)


get form added

get form added

--- src/webdriver/dsl.clj
+++ src/webdriver/dsl.clj
@@ -200,15 +200,15 @@
      ~@body))

 (defmacro with-els [term el & body]
-  `(doseq [~el (api/find-elements *server* *session* *locator* ~term)]
+  `(for [~el (api/find-elements *server* *session* *locator* ~term)]
      ~@body))

 (defmacro with-el-from [parent term el & body]
   `(let [~el (api/find-element-from-element *server* *session* ~parent *locator* ~term)]
      ~@body))

-(defmacro with-els-from [parent term el & body]
-  `(doseq [~el (api/find-elements-from-element *server* *session* ~parent *locator* ~term)]
+(defmacro with-els-from [el-parent term el & body]
+  `(for [~el (api/find-elements-from-element *server* *session* ~el-parent *locator* ~term)]
      ~@body))

 (defn with-el-active [el & body]
@@ -477,6 +477,18 @@
   (with-el term el-form
     (fill-form-el el-form form)))

+(defn get-form-el [el-form]
+  (let [term "//input"
+        el-inputs (api/find-elements-from-element
+                   *server* *session* el-form *locator* term)
+        fields (map #(prop-el % "name") el-inputs)
+        values (map #(prop-el % "value") el-inputs)]
+    (apply hash-map (interleave (map keyword fields) values))))
+
+(defn get-form [term]
+  (with-el term el-form
+    (get-form-el el-form)))
+
 ;;
 ;; proceses
 ;;
@@ -582,10 +594,9 @@
         (with-session capabilities
           (client/with-pool {}
             (go-url "http://ya.ru")
-            (wait 3)
             (js-set-hash "fooooo")
-            (with-url url
-              (is (= url 1)))
+            ;; (with-url url
+            ;;   (is (= url 1)))
             (with-xpath
               (wait-visible input)
               (with-el input el
@@ -611,7 +622,10 @@
                 (is (= border-right-width "40px"))
                 (is (= border-collapse "collapse")))
               (fill-form "//form" {:text "sdfsdfsdfsdfs"})
-              (fill-human input "I dunno why I do that.")
+              (let [form (get-form "//form")]
+                (is (= (-> form (dissoc :msid))
+                       {:text "testtestsdfsdfsdfsdfs"})))
+              ;; (fill-human input "I dunno why I do that.")
               (with-el-rect input {:keys [x y width height]}
                 (is (= x 222.0))
                 (is (= y 295.0))


further fix to linkifying

further fix to linkifying

--- src/chat/client/views/helpers.cljs
+++ src/chat/client/views/helpers.cljs
@@ -1,6 +1,7 @@
 (ns chat.client.views.helpers
   (:require [om.dom :as dom]
-            [clojure.string :as string]))
+            [clojure.string :as string]
+            [cljs-utils.core :refer [flip]]))

 (defn tag->color [tag]
   ; normalized is approximately evenly distributed between 0 and 1
@@ -17,12 +18,22 @@
   ; tried doing this with instaparse, but the js parser generator is way too slow, it seems
   [text]
   (let [url-re #"http(?:s)?://\S+(?:\w|\d|/)"
+        flipped-or (fn [x y] (or y x))
+        flipped-conj (fn [x y] (conj y x))
+        nop {:text ""}
+        ensure-seq (fn [s]
+                     (->> s
+                          ; make sure seq is non-empty
+                          seq (flipped-or [nop])
+                          ; make sure interleave consumes all of both
+                          vec (flipped-conj nop)))
         text-links-seq (interleave
                          (->> (string/split text url-re)
-                              seq (or [""])
-                              (map (partial assoc {} :text)))
+                              (map (partial assoc {} :text))
+                              ensure-seq)
                          (->> (re-seq url-re text)
-                              (map (partial assoc {} :link))))]
+                              (map (partial assoc {} :link))
+                              ensure-seq))]
     (if (empty? text-links-seq)
       (list text)
       (map


Only allow creating files in writable directories.

--- src/mash_commander/nix/filesystem.cljs
+++ src/mash_commander/nix/filesystem.cljs
@@ -16,8 +16,14 @@
     (apply concat
            ;; Flattened list of lists of command structures
            (map #(cond
-                   (= :dir (:type (second %))) (commands (second %))
-                   (and (= :file (:type (second %))) (contains? (:mod (second %)) :x)) [(assoc (second %) :name (first %))]
+                   ;;; directory
+                   (= :dir (:type (second %)))
+                   (commands (second %))
+                   ;;; executable files
+                   (and (= :file (:type (second %)))
+                        (contains? (:mod (second %)) :x))
+                   [(assoc (second %) :name (first %))]
+                   ;;; nothing
                    :default [])
                 files))))

@@ -33,8 +39,7 @@
     (get-in (:root fs) (interleave (repeat :files) (:cwd fs)))))

 (defn create-file-in-fs [fs name file]
-  (print "creating file " name " with " file)
-  (let [path (conj [:root] (interleave (repeat :files) (:cwd fs)) [name])]
+  (let [path (apply concat [:root] (interleave (repeat :files) (:cwd fs)) [[:files name]])]
     (assoc-in fs path file)))

 (defn ls-cmd []
@@ -74,11 +79,15 @@
     nil))

 (defn touch-cmd [param]
-  (if (contains? param (:files (cwd)))
+  (cond
+    (contains? param (:files (cwd)))
     "500 error: file already exists"
+    (not (contains? (:mod (cwd)) :w))
+    "409 error: directory is not writable"
+    :default
     (om/transact!
      (fs-cursor)
-    #(create-file-in-fs % param {:mod #{:r :w}
+     #(create-file-in-fs % param {:mod #{:r :w}
                                   :type :file
                                   :contents ""}))))

@@ -97,7 +106,7 @@
                                   "cd" {:mod #{:x}
                                         :type :file
                                         :fn cd-cmd
-                                        :args [:file]
+                                        :args [:dir]
                                         :help "`cd` changes your current directory."}
                                   "clear" {:mod #{:x}
                                            :type :file
@@ -119,7 +128,7 @@
                                           :fn touch-cmd
                                           :args [:alpha]
                                           :help "`touch` creates an empty file."}}}
-                   "usr" {:mod #{:r}
+                   "usr" {:mod #{:r :w}
                           :type :dir
                           :files {}}}}
     :cwd []
@@ -142,7 +151,6 @@

 ;; TODO: cache delay evaluation
 (defn- alpha-trie [level]
-  (print "alpha-trie level " level)
   (let [alpha "abcdefghijklmnopqrstuvwxyz"
         t (reduce #(assoc %1 %2 (delay (alpha-trie (+ 1 level)))) {} alpha)]
     (if (< 0 level) (assoc t "" "") t)))
@@ -156,6 +164,14 @@
       (if (empty? cwd)
         (trie/build (cons ".." (files cwd)))
         (trie/build (files cwd))))
+    ;; Looking for a valid directory in the current working directory
+    (= :dir args-spec)
+    (let [everything (seq (:files (cwd)))
+          dirs (filter #(= :dir (:type (second %))) everything)
+          names (map first dirs)]
+      (if (empty? (:cwd @(fs-cursor)))
+        (trie/build names)
+        (trie/build (cons ".." names))))
     ;; Looking for a valid command
     (= :cmd args-spec)
     (trie/build (keys (command-map)))


Fix new examplars: turns out ~unrecognized is recognized as malformed uuid

--- test/exemplar.clj
+++ test/exemplar.clj
@@ -221,12 +221,12 @@
   (write-exemplar
     "maps_unrecognized_keys"
     "Vector of maps with keys with unrecognized encodings"
-    [{"`~#unrecognized" :anything} {"`~#U" :anything-else}])
+    [{"`~#unrecognized" :anything} {"`~#X" :anything-else}])

   (write-exemplar
     "map_unrecognized_vals"
     "Map with vals with unrecognized encodings"
-    {:key "`~unrecognized"})
+    {:key "`~notrecognized"})

   (write-exemplar
     "vector_93_keywords_repeated_twice"
@@ -246,4 +246,4 @@
   (write-exemplar
     "vector_unrecognized_vals"
     "Vector with vals with unrecognized encodings"
-    ["`~unrecognized"]))
+    ["`~notrecognized"]))


major optimization for use case of passing an already compiled path to inline caching specter operations

--- src/clj/com/rpl/specter/macros.clj
+++ src/clj/com/rpl/specter/macros.clj
@@ -450,7 +450,7 @@
            ~precompiled-sym (.-precompiled info#)
            ~params-maker-sym (.-params-maker info#)]
        (if (nil? ~precompiled-sym)
-         (i/comp-paths* ~(vec path))
+         (i/comp-paths* ~(if (= (count path) 1) (first path) (vec path)))
          (if (nil? ~params-maker-sym)
            ~precompiled-sym
            ~handle-params-code