(ns uxbox.core
  (:require [beicon.core :as rx]
            [cats.labs.lens :as l]
            [uxbox.state :as st]
            [uxbox.router :as rt]
            [uxbox.rstore :as rs]
            [uxbox.ui :as ui]
            [uxbox.data.load :as dl]))

(enable-console-print!)

(defn main
  "Initialize the storage subsystem."
  []
  (let [lens (l/select-keys [:pages-by-id
                             :shapes-by-id
                             :colors-by-id
                             :projects-by-id])
        stream (->> (l/focus-atom lens st/state)
                    (rx/from-atom)
                    (rx/debounce 1000)
                    (rx/tap #(println "[save]")))]
    (rx/on-value stream #(dl/persist-state %))))

(defonce +setup+
  (do
    (println "bootstrap")

    (st/init)
    (rt/init)
    (ui/init)

    (rs/emit! (dl/load-data))
    (main)))

(ns uxbox.core
  (:require [beicon.core :as rx]
            [cats.labs.lens :as l]
            [uxbox.state :as st]
            [uxbox.router :as rt]
            [uxbox.rstore :as rs]
            [uxbox.ui :as ui]
            [uxbox.data.load :as dl]))

(enable-console-print!)

(defn main
  "Initialize the storage subsystem."
  []
  (let [lens (l/select-keys [:pages-by-id
                             :shapes-by-id
                             :colors-by-id
                             :projects-by-id])
        stream (->> (l/focus-atom lens st/state)
                    (rx/from-atom)
                    (rx/dedupe)
                    (rx/debounce 1000)
                    (rx/tap #(println "[save]")))]
    (rx/on-value stream #(dl/persist-state %))))

(defonce +setup+
  (do
    (println "bootstrap")

    (st/init)
    (rt/init)
    (ui/init)

    (rs/emit! (dl/load-data))
    (main)))

Add dedupe on state persistence stream.

Add dedupe on state persistence stream.


(ns pz-discover.util
  (:require [clojure.tools.logging :as log]
            [zookeeper :as zk]
            [pz-discover.models.services :as sm]))

(defn setup-zk-env! [client chroot]
  (let [names-node (format "%s/%s" chroot "names")
        types-node (format "%s/%s" chroot "types")]
    (when-not (zk/exists client chroot)
      (zk/create client chroot :persistent? true))
    (when-not (zk/exists client names-node)
      (zk/create client names-node :persistent? true))
    (when-not (zk/exists client types-node)
      (zk/create client types-node :persistent? true))))

(defn register-kafka! [client kafka-config]
  (let [kafka-data {:type "infrastructure"
                    :brokers (get-in kafka-config [:producer "bootstrap.servers"])}]
    (sm/register-by-name client "kafka" kafka-data)))

(defn register-zookeeper! [client zookeeper-config]
  (let [zk-data (assoc zookeeper-config :type "infrastructure")]
    (sm/register-by-name client "zookeeper" zk-data)))

(ns pz-discover.util
  (:require [clojure.tools.logging :as log]
            [zookeeper :as zk]
            [pz-discover.models.services :as sm]))

(defn setup-zk-env! [client chroot]
  (let [names-node (format "%s/%s" chroot "names")
        types-node (format "%s/%s" chroot "types")]
    (when-not (zk/exists client chroot)
      (zk/create client chroot :persistent? true))
    (when-not (zk/exists client names-node)
      (zk/create client names-node :persistent? true))
    (when-not (zk/exists client types-node)
      (zk/create client types-node :persistent? true))))

(defn register-kafka! [client kafka-config]
  (let [kafka-data {:type "infrastructure"
                    :host (get-in kafka-config [:producer "bootstrap.servers"])}]
    (when-not (sm/register-by-name client "kafka" kafka-data)
      (sm/update-by-name client "kafka" kafka-data))))

(defn register-zookeeper! [client zookeeper-config]
  (let [zk-normalized {:host (format "%s:%s%s"
                                     (:host zookeeper-config)
                                     (:port zookeeper-config)
                                     (:chroot zookeeper-config))}
        zk-data (assoc zk-normalized :type "infrastructure")]
    (when-not (sm/register-by-name client "zookeeper" zk-data)
      (sm/update-by-name client "zookeeper" zk-data))))

Change format of infrastructure data, update if already registered.


(ns frontend.intercom
  (:require [frontend.utils :as utils :include-macros true]))

(defn intercom-jquery []
  (aget js/window "intercomJQuery"))

(defn intercom-v1-new-message [jq message]
  (.click (jq "#IntercomTab"))
  (when-not (.is (jq "#IntercomNewMessageContainer") ":visible")
    (.click (jq "[href=IntercomNewMessageContainer]")))
  (when-not (.is (jq "#newMessageBody") ":visible")
    (throw "didn't find intercom v1 widget"))
  (.focus (jq "#newMessageBody"))
  (when message
    (.text (jq "#newMessageBody") (str message "\n\n"))))

(defn intercom-v2-new-message []
  (js/Intercom "show"))

(defn raise-dialog [ch & [message]]
  (try
    (let [jq (intercom-jquery)]
      (intercom-v1-new-message jq message))
    (catch :default e
      (try
        (intercom-v2-new-message)
        (catch :default e
          (utils/notify-error ch "Uh-oh, our Help system isn't available. Please email us instead, at sayhi@circleci.com")
          (utils/merror e)))))
  (utils/notify-error ch "Uh-oh, our Help system isn't available. Please email us instead, at sayhi@circleci.com"))

(defn user-link []
  (let [path (.. js/window -location -pathname)
        re (js/RegExp. "/gh/([^/]+/[^/]+)")]
    (when-let [match (.match path re)]
      (str "https://www.intercom.io/apps/vnk4oztr/users"
           "?utf8=%E2%9C%93"
           "&filters%5B0%5D%5Battr%5D=custom_data.pr-followed"
           "&filters%5B0%5D%5Bcomparison%5D=contains&filters%5B0%5D%5Bvalue%5D="
           (second path)))))

(ns frontend.intercom
  (:require [frontend.utils :as utils :include-macros true]))

(defn raise-dialog [ch & [message]]
  (try
    (js/Intercom "show")
    (catch :default e
      (utils/notify-error ch "Uh-oh, our Help system isn't available. Please email us instead, at sayhi@circleci.com")
      (utils/merror e))))

(defn user-link []
  (let [path (.. js/window -location -pathname)
        re (js/RegExp. "/gh/([^/]+/[^/]+)")]
    (when-let [match (.match path re)]
      (str "https://www.intercom.io/apps/vnk4oztr/users"
           "?utf8=%E2%9C%93"
           "&filters%5B0%5D%5Battr%5D=custom_data.pr-followed"
           "&filters%5B0%5D%5Bcomparison%5D=contains&filters%5B0%5D%5Bvalue%5D="
           (second path)))))

Remove references to old widget

Remove references to old widget


{:user {:dependencies [[clj-stacktrace "0.2.5"]
                       [org.clojure/tools.trace "0.7.6"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [redl "0.1.0"]
                       [speclj-tmux "1.0.0"]
                       [spyscope "0.1.3"]
                       [slamhound "1.3.3"]]
        :plugins [[lein-difftest "1.3.7"]
                  [lein-exec "0.3.0"]
                  [org.bodil/lein-noderepl "0.1.10"]
                  [lein-clojars "0.9.1"]
                  [lein-pprint "1.1.1"]
                  [lein-ring "0.8.0"]
                  [lein-cljsbuild "0.3.2"]
                  [lein-deps-tree "0.1.2"]
                  [lein-marginalia "0.7.1"]]
        :repl-options {:timeout 120000}
        :injections [(require '[redl core complete])
                     (require 'spyscope.core)
                     (require 'clojure.tools.namespace)
                     (let [orig (ns-resolve (doto 'clojure.stacktrace require)
                                            'print-cause-trace)
                           new (ns-resolve (doto 'clj-stacktrace.repl require)
                                           'pst)]
                       (alter-var-root orig (constantly @new)))]
        :vimclojure-opts {:repl true}}}

{:user {:dependencies [[clj-stacktrace "0.2.5"]
                       [org.clojure/tools.trace "0.7.6"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [redl "0.1.0"]
                       [speclj-tmux "1.0.0"]
                       [spyscope "0.1.3"]
                       [slamhound "1.3.3"]]
        :plugins [[lein-difftest "1.3.7"]
                  [lein-exec "0.3.0"]
                  [org.bodil/lein-noderepl "0.1.10"]
                  [quickie "0.2.1"]
                  [lein-clojars "0.9.1"]
                  [lein-pprint "1.1.1"]
                  [lein-ring "0.8.0"]
                  [lein-cljsbuild "0.3.2"]
                  [lein-deps-tree "0.1.2"]
                  [lein-marginalia "0.7.1"]]
        :repl-options {:timeout 120000}
        :injections [(require '[redl core complete])
                     (require 'spyscope.core)
                     (require 'clojure.tools.namespace)
                     (let [orig (ns-resolve (doto 'clojure.stacktrace require)
                                            'print-cause-trace)
                           new (ns-resolve (doto 'clj-stacktrace.repl require)
                                           'pst)]
                       (alter-var-root orig (constantly @new)))]
        :vimclojure-opts {:repl true}}}

Add quickie test runner to plugins.

Add quickie test runner to plugins.


(defproject domain "0.1.0-SNAPSHOT"
  :description "CV + RTB"
  :url "http://example.com/OMGLOL"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [ring/ring-jetty-adapter "1.4.0"]
                 [ring/ring-defaults "0.1.5"]
                 [ring/ring-json "0.4.0"]
                 [compojure "1.4.0"]
                 [clj-http "2.0.0"]
                 [org.clojure/core.async "0.2.374"]
                 [org.clojure/data.json "0.2.6"]
                 [ring-cors "0.1.7"]]
  :plugins [[lein-ring "0.9.7"]]
  :ring {:handler domain.core/app
         :nrepl {:start? true
                 :port 3001}}
  :jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"]
  :aot [domain.core])

(defproject domain "0.1.0-SNAPSHOT"
  :description "CV + RTB"
  :url "http://example.com/OMGLOL"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [ring/ring-jetty-adapter "1.4.0"]
                 [ring/ring-defaults "0.1.5"]
                 [ring/ring-json "0.4.0"]
                 [compojure "1.4.0"]
                 [clj-http "2.0.0"]
                 [org.clojure/core.async "0.2.374"]
                 [org.clojure/data.json "0.2.6"]
                 [ring-cors "0.1.7"]]
  :plugins [[lein-ring "0.9.7"]]
  :ring {:handler domain.core/app
         :nrepl {:start? true :port 3001}}
  :profiles {:dev {:jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"]}}
  :aot [domain.core])

Move JVM debug only to dev profile

Move JVM debug only to dev profile


(ns wlmmap.map
  (:require [mrhyde.extend-js]
            [blade :refer [L]]
            [cljs.core.async :refer [chan <! >!]]
            [shoreleave.remotes.http-rpc :refer [remote-callback]])
  (:require-macros [cljs.core.async.macros :refer [go]]))

(blade/bootstrap)

(def mymap (-> L .-mapbox (.map "map" "examples.map-uci7ul8p")
      (.setView [45 3.215] 5)))

(def markers (L/MarkerClusterGroup.))

(let [ch (chan)]
  (go (while true
        (let [a (<! ch)]
          (let [lat (first (first a))
                lng (last (first a))
                title (last a)
                icon ((get-in L [:mapbox :marker :icon])
                      {:marker-symbol "post" :marker-color "0044FF"})
                marker (-> L (.marker (L/LatLng. lat lng) {:icon icon :title title}))]
            (.bindPopup marker title)
            (.addLayer markers marker))
          (.addLayer mymap markers))))
  (remote-callback
   :get-markers []
   #(doseq [a %] (go (>! ch a)))))

;; FIXME: get language
;; (js/alert (.-language js/navigator))

(ns wlmmap.map
  (:require [mrhyde.extend-js]
            [blade :refer [L]]
            [cljs.core.async :refer [chan <! >! timeout]]
            [shoreleave.remotes.http-rpc :refer [remote-callback]])
  (:require-macros [cljs.core.async.macros :refer [go]]))

(blade/bootstrap)

(def mymap (-> L .-mapbox (.map "map" "examples.map-uci7ul8p")
               (.setView [45 3.215] 5)))

(def markers (L/MarkerClusterGroup.))

(let [ch (chan)]
  (go (while true
        (let [a (<! ch)]
          (let [lat (first (first a))
                lng (last (first a))
                title (last a)
                icon ((get-in L [:mapbox :marker :icon])
                      {:marker-symbol "" :marker-color "0044FF"})
                marker (-> L (.marker (L/LatLng. lat lng)
                                      {:icon icon}))]
            (.bindPopup marker title)
            (.addLayer markers marker)))))
  (remote-callback :get-markers []
                   #(go (doseq [a %]
                          (<! (timeout 1))
                          (>! ch a)))))

(.addLayer mymap markers)

;; FIXME: get language
;; (js/alert (.-language js/navigator))

Add a timeout when loading markers.

Add a timeout when loading markers.

It works fine with chromium, but there is still something wrong
with recent version of Firefox.


(ns braid.ui.styles.body)

(def body
  [:body
   {:margin 0
    :padding 0
    :font-family "\"Open Sans\", Helvetica, Arial, sans-serif"
    :font-size "12px"
    :background "#eee"}
   [:textarea :input
    {:font-family "inherit"}]])

(ns braid.ui.styles.body)

(def body
  [:body
   {:margin 0
    :padding 0
    :font-family "\"Open Sans\", Helvetica, Arial, sans-serif"
    :font-size "12px"
    :background "#eee"}
   [:textarea :input
    {:font-family "inherit"
     :font-size "1em"}]])

Fix inconsistent textarea font-size on Firefox


(ns test.leindroid.sample.main
  (:use [neko.activity :only [defactivity do-ui set-content-view!]]
        [neko.notify :only [toast]]
        [neko.ui :only [defui by-id]]
        [neko.application :only [defapplication]]))

(declare ^android.app.Activity a
         ^android.widget.EditText user-input)

;; This line defines the Application class and automatically
;; initializies neko and nREPL.
(defapplication test.leindroid.sample.Application)

(defn notify-from-edit [_]
  (toast (str "Your input: " (.getText user-input))
         :long))

(defactivity test.leindroid.sample.MainActivity
  :def a
  :create
  (fn [this bundle]
    (do-ui
     (set-content-view! a
      (defui [:linear-layout {:orientation :vertical
                              :layout-width :fill
                              :layout-height :wrap}
              [:edit {:def user-input
                      :layout-width :fill}]
              [:button {:text "Touch me"
                        :on-click notify-from-edit}]])))))

(ns test.leindroid.sample.main
  (:use [neko.activity :only [defactivity set-content-view!]]
        [neko.notify :only [toast]]
        [neko.ui :only [defui]]
        [neko.threading :only [on-ui]]
        [neko.application :only [defapplication]]))

(declare ^android.app.Activity a
         ^android.widget.EditText user-input)

;; This line defines the Application class and automatically
;; initializies neko and nREPL.
(defapplication test.leindroid.sample.Application)

(defn notify-from-edit [_]
  (toast (str "Your input: " (.getText user-input))
         :long))

(defactivity test.leindroid.sample.MainActivity
  :def a
  :create
  (fn [this bundle]
    (on-ui
     (set-content-view! a
      (defui [:linear-layout {:orientation :vertical
                              :layout-width :fill
                              :layout-height :wrap}
              [:edit {:def user-input
                      :layout-width :fill}]
              [:button {:text "Touch me"
                        :on-click notify-from-edit}]])))))

Update sample project for changes in neko

The do-ui macro was moved to the neko.threading namespace and renamed to
on-ui.


(ns pfrt.core)

(defprotocol Lifecycle
  (init [_ system] "Initialize method")
  (start [_ system] "Start service")
  (stop [_ system] "Stop service"))

(ns pfrt.core
  (:require [swiss.arrows :refer [-<>]]))

(defprotocol IComponentLifecycle
  (init [_ system] "Initialize method")
  (start [_ system] "Start service")
  (stop [_ system] "Stop service"))

(defprotocol ISystemLifecycle
  (init [_] "Initialize method")
  (start [_] "Start service")
  (stop [_] "Stop service"))

(defrecord System [components]
  ISystemLifecycle
  (init [this]
    (-<> this (reduce #(init %1 %2) <> components)))
  (start [this]
    (-<> this (reduce #(start %1 %2) <> components)))
  (stop [this]
    (-<> this (reduce #(stop %1 %2) <> components))))

Add concise system record class.

Add concise system record class.


(ns teach-by-friends.shared.components.row
  (:require [teach-by-friends.shared.ui :as ui]
            [clojure.string :refer [capitalize]]))

(defn row [data press-handler]
  (let [data-to-clj (js->clj data :keywordize-keys true)]
    [ui/touchable-opacity {:style    {:border-bottom-width 1
                                      :border-color        "rgba(0,0,0,.1)"
                                      :padding-top         20
                                      :padding-bottom      20
                                      :padding-left        30}
                           :on-press (partial press-handler data-to-clj)}
     [ui/text {:style {:font-size 30 :color "white"}} (capitalize (:title data-to-clj))]]))

(ns teach-by-friends.shared.components.row
  (:require [teach-by-friends.shared.ui :as ui]
            [clojure.string :refer [capitalize]]))

(defn row [data press-handler]
  (let [data-to-clj (js->clj data :keywordize-keys true)]
    [ui/touchable-opacity {:style    {:position "relative"
                                      :height 100}
                           :on-press (partial press-handler data-to-clj)}
     [ui/image {:source {:uri (:cover data-to-clj)}
                :resize-mode "cover"
                :style {:width (ui/get-device-width)
                        :height 100}}]
     [ui/linear-gradient {:colors ["rgba(0,0,0,0.6)" "rgba(0,0,0,0)"]
                          :start  [0.0 0.5] :end [1.0 0.5]
                          :style  {:width (ui/get-device-width)
                                   :height 100
                                   :position "absolute"
                                   :top 0}}]
     [ui/text {:style {:position "absolute"
                       :font-size 14
                       :color "white"
                       :left 16
                       :bottom 10}}
      (capitalize (:title data-to-clj))]]))

Use cover image in serials list

Use cover image in serials list


; vi: ft=clojure

(set-env!
  :source-paths #{"src", "test"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [org.clojure/data.csv "0.1.3"]
                  [incanter "1.9.0"]
                  [adzerk/boot-test "1.2.0" :scope "test"]])

(require '[adzerk.boot-test :refer [test]])

(task-options!
    aot {:all true}
    pom {:project 'tf-idf
         :version "0.0.0"}
    jar {:main 'analyze-data.core})

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

; vi: ft=clojure

(set-env!
  :source-paths #{"src", "test"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [org.clojure/data.csv "0.1.3"]
                  [metosin/boot-alt-test "0.3.1" :scope "test"]
                  [net.mikera/core.matrix "0.58.0"]
                  [net.mikera/vectorz-clj "0.46.0"]])

(require '[metosin.boot-alt-test :refer [alt-test]])

(task-options!
    aot {:all true}
    pom {:project 'tf-idf
         :version "0.0.0"}
    jar {:main 'analyze-data.core})

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

Add core.matrix and vectorz-clj, and switch to boot-alt-test.


(ns kixi.hecuba.weather
  (:require [kixi.hecuba.weather.metofficeapi :as ma]))

(ns kixi.hecuba.weather
  (:require [kixi.hecuba.weather.metoffice-api :as ma]))

Update namespace name in :require.

Update namespace name in :require.


;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:user {:plugins [[lein-pprint    "1.3.2"
                   lein-ancient   "0.7.0"
                   lein-cloverage "1.2.2"]]
        :dependencies [[alembic   "0.3.2"]
                       [clj-kondo "RELEASE"]
                       [antq      "RELEASE"]]
        :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
                  "outdated"  ["run" "-m" "antq.core"]}}}

;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:user {:plugins [[lein-pprint "1.3.2"
                   lein-ancient "0.7.0"
                   lein-cloverage "1.2.2"]]
        :dependencies [[alembic "0.3.2"]
                       [clj-kondo "RELEASE"]
                       [antq "RELEASE"]
                       [vvvvalvalval/scope-capture "0.3.2"]]
        :injections [(require 'sc.api)]
        :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
                  "outdated"  ["run" "-m" "antq.core"]}}}

Add configuration for scope-capture for Clojure


(ns ashiba.controller
  (:require [cljs.core.async :refer [put!]]))

(defprotocol IController
  (params [this route])
  (start [this params db])
  (stop [this params db])
  (execute [this command-name] [this command-name args])
  (handler [this app-db in-chan out-chan])
  (send-command [this command-name] [this command-name args])
  (is-running? [this]))

(extend-type default
  IController
  (params [_ route] route)
  (start [_ params db] db)
  (stop [_ params db] db)
  (handler [_ _ _ _])
  (execute
    ([this command-name]
     (execute this command-name nil))
    ([this command-name args]
     (put! (:in-chan this) [command-name args])))
  (send-command
    ([this command-name]
     (send-command this command-name nil))
    ([this command-name args]
     (let [out-chan (:out-chan this)]
       (put! out-chan [command-name args])
       this)))
  (is-running? [this]
    (= this ((:running this)))))

(ns ashiba.controller
  (:require [cljs.core.async :refer [put!]]))

(defprotocol IController
  (params [this route])
  (start [this params db])
  (stop [this params db])
  (execute [this command-name] [this command-name args])
  (handler [this app-db-atom in-chan out-chan])
  (send-command [this command-name] [this command-name args])
  (is-running? [this]))

(extend-type default
  IController
  (params [_ route] route)
  (start [_ params db] db)
  (stop [_ params db] db)
  (handler [_ _ _ _])
  (execute
    ([this command-name]
     (execute this command-name nil))
    ([this command-name args]
     (put! (:in-chan this) [command-name args])))
  (send-command
    ([this command-name]
     (send-command this command-name nil))
    ([this command-name args]
     (let [out-chan (:out-chan this)]
       (put! out-chan [command-name args])
       this)))
  (is-running? [this]
    (= this ((:running this)))))

Make it clear that handler receives atom instead of value


(ns enduro-session.core-test
  (:require [clojure.test :refer :all]
            [enduro-session.core :refer :all]))

(deftest a-test
  (testing "FIXME, I fail."
    (is (= 0 1))))

(ns enduro-session.core-test
  (:require [clojure.test :refer :all]
            [enduro-session.core :refer :all]))

(deftest a-test
  (testing "FIXME, I fail."
    (is (= 1 1))))

Fix leiningen boilerplate test failure

Fix leiningen boilerplate test failure


(ns lt.objs.platform
  (:require [lt.object :as object]
            [lt.util.dom :as dom])
  (:require-macros [lt.macros :refer [behavior]]))

(def atom-shell true)

(def clipboard (js/require "clipboard"))
(def shell (js/require "shell"))

(defn get-data-path []
  (.getDataPath (.require (js/require "remote") "app")))

(defn normalize [plat]
  (condp = plat
    "win32" :windows
    "linux" :linux
    "darwin" :mac))

(defn open [path]
  (.openItem shell path))

(defn open-url [path]
  (.openExternal shell path))

(defn show-item [path]
  (.showItemInFolder shell path))

(defn copy
  "Copies given text to platform's clipboard"
  [text]
  (.writeText clipboard text))

(defn paste
  "Returns text of last copy to platform's clipboard"
  []
  (.readText clipboard))

(def platform (normalize (.-platform js/process)))

(defn mac? []
  (= platform :mac))

(defn win? []
  (= platform :windows))

(defn linux? []
  (= platform :linux))

(ns lt.objs.platform
  (:require [lt.object :as object]
            [lt.util.dom :as dom])
  (:require-macros [lt.macros :refer [behavior]]))

(def atom-shell true)

(def fs (js/require "fs"))
(def clipboard (js/require "clipboard"))
(def shell (js/require "shell"))

(defn get-data-path []
  (.getDataPath (.require (js/require "remote") "app")))

(defn normalize [plat]
  (condp = plat
    "win32" :windows
    "linux" :linux
    "darwin" :mac))

(defn open-url [path]
  (.openExternal shell path))

(defn open
  "If the given path exists, open it with the desktop's default manner.
  Otherwise, open it as an external protocol e.g. a url."
  [path]
  (if (.existsSync fs path)
    (.openItem shell path)
    (open-url path)))

(defn show-item [path]
  (.showItemInFolder shell path))

(defn copy
  "Copies given text to platform's clipboard"
  [text]
  (.writeText clipboard text))

(defn paste
  "Returns text of last copy to platform's clipboard"
  []
  (.readText clipboard))

(def platform (normalize (.-platform js/process)))

(defn mac? []
  (= platform :mac))

(defn win? []
  (= platform :windows))

(defn linux? []
  (= platform :linux))

Update open to be backwards compatible for urls

A number of plugins rely on platform/open to open urls -
https://github.com/search?p=3&q=objs.platform+open+language%3Aclojure&ref=searchresults&type=Code&utf8=%E2%9C%93.
Also couldn't use files in platform for exists check since that created
a circular dependency


{
 :name "mailp2",
 :path "",
 :func (fn [recipient subject intro result-maps]
         (cond
           (pg/eoi? result-maps) (pg/done)

           (every? map? result-maps)
           (let [base (->> result-maps first :value second fs/dirname)
                 msgs (for [retmap result-maps]
                        (let [name (retmap :name)
                              [bams csv] (retmap :value)
                              bams (map fs/basename bams)
                              csv (fs/basename csv)
                              exit (retmap :exit)
                              err (retmap :err)]
                          (if (= exit :success)
                            [exit csv]
                            [exit err [bams csv]])))
                 overall (reduce (fn[R x]
                                   (cond (= x R :success) R
                                         (= x R :fail) R
                                         :else :mixed))
                                 (map first msgs))
                 msg (->> msgs
                          (cons (str "Base '" base "'"))
                          (cons (str "Overall " overall))
                          (cons intro)
                          (map str) (str/join "\n"))]
             (pg/send-msg [recipient] subject msg))

           :else
           (let [msg (->> result-maps (cons intro) (map str) (str/join "\n"))]
             (pg/send-msg [recipient] subject msg))))

 :description "Mailer function node for phase2/gen-feature-counts. recipient is user account that requested the associated job this node is final pt of DAG, subject is type of job, msg is job finish details."
}

{
 :name "mailp2",
 :path "",
 :func (fn [recipient subject intro result-maps]
         (cond
           (pg/eoi? result-maps) (pg/done)

           (every? map? result-maps)
           (let [base (->> result-maps first :value second fs/dirname)
                 msgs (for [retmap result-maps]
                        (let [name (retmap :name)
                              [bams csv] (retmap :value)
                              bams (if (coll? bams)
                                     (map fs/basename bams)
                                     (fs/basename bams))
                              csv (if (coll? bams)
                                    (map fs/basename csv)
                                    (fs/basename csv))
                              exit (retmap :exit)
                              err (retmap :err)]
                          (if (= exit :success)
                            [exit csv]
                            [exit err [bams csv]])))
                 overall (reduce (fn[R x]
                                   (cond (= x R :success) R
                                         (= x R :fail) R
                                         :else :mixed))
                                 (map first msgs))
                 msg (->> msgs
                          (cons (str "Base '" base "'"))
                          (cons (str "Overall " overall))
                          (cons intro)
                          (map str) (str/join "\n"))]
             (pg/send-msg [recipient] subject msg))

           :else
           (let [msg (->> result-maps (cons intro) (map str) (str/join "\n"))]
             (pg/send-msg [recipient] subject msg))))

 :description "Mailer function node for phase2/gen-feature-counts. recipient is user account that requested the associated job this node is final pt of DAG, subject is type of job, msg is job finish details."
}

Test for coll? on input values

Test for coll? on input values


(ns clj-record.test.model.config)

(comment
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
         :subprotocol "derby"
         :subname "/tmp/clj-record.test.db"
         :create true})
)

(def db {:classname "org.postgresql.Driver"
         :subprotocol "postgresql"
         :subname "//localhost:5433/coffeemug"
         :user "enter-user-name-here"
         :password ""})

(ns clj-record.test.model.config)

(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
         :subprotocol "derby"
         :subname "/tmp/clj-record.test.db"
         :create true})

(comment
(def db {:classname "org.postgresql.Driver"
         :subprotocol "postgresql"
         :subname "//localhost:5433/coffeemug"
         :user "enter-user-name-here"
         :password ""})
)

Switch back to using Derby in tests.

Switch back to using Derby in tests.


(ns cavm.query.expression
  (:require [clojure.edn :as edn])
  (:refer-clojure :exclude  [eval]))

(def eval)

(defn lambdafn [node scope]
  (let [[_ argnames body] node]
    (fn [& args]
      (eval body (cons (zipmap argnames args) scope)))))

(defn iffn [node scope]
  (let [[_ test then else] node]
    (cond
      (eval test scope) (eval then scope)
      :else (eval else scope))))

(def specials
  {'fn lambdafn
   'quote (fn [n s] (second n))
   'if iffn })

(def specialfns (set (vals specials)))

(defn fn-node [node scope]
  (let [func (eval (first node) scope)]
    (cond
      (contains? specialfns func) (func node scope)
      :else (apply func (map #(eval % scope) (rest node))))))

(defn eval [node scope]
  (cond
    (symbol? node) ((first (filter #(contains? % node) scope)) node)
    (list? node) (fn-node node scope)
    (instance? Number node) (double node)
    :else node))

(defn expression [exp & globals]
  (eval (edn/read-string exp) (cons specials globals)))

(ns cavm.query.expression
  (:require [clojure.edn :as edn])
  (:require [honeysql.types :as hsqltypes])
  (:refer-clojure :exclude  [eval]))

(def eval)

(defn lambdafn [node scope]
  (let [[_ argnames body] node]
    (fn [& args]
      (eval body (cons (zipmap argnames args) scope)))))

(defn iffn [node scope]
  (let [[_ test then else] node]
    (cond
      (eval test scope) (eval then scope)
      :else (eval else scope))))

(def specials
  {'fn lambdafn
   'quote (fn [n s] (second n))
   'if iffn })

(def specialfns (set (vals specials)))

(defn fn-node [node scope]
  (let [func (eval (first node) scope)]
    (cond
      (contains? specialfns func) (func node scope)
      :else (apply func (map #(eval % scope) (rest node))))))

(defn eval [node scope]
  (cond
    (symbol? node) ((first (filter #(contains? % node) scope)) node)
    (list? node) (fn-node node scope)
    (instance? Number node) (double node)
    :else node))

(defn expression [exp & globals]
  (eval (edn/read-string {:readers {'sql/call hsqltypes/read-sql-call}} exp) (cons specials globals)))

Enable honeysql handlers in web API.

Enable honeysql handlers in web API.


(def orig (first *command-line-args*))

(def input (seq (char-array (first *command-line-args*))))

(defn palindrome? [s] (= s (reverse s)))

(def occurrences-map (frequencies input))

(def evens-map (filter (fn [[_, v]] (even? v)) occurrences-map))

(def odds-map (filter (fn [[_, v]] (odd? v)) occurrences-map))

(if (palindrome? input)
  (printf "%s is a palindrome%n" orig)
  (if (> (count (keys odds-map)) 1)
    (printf "%s cannot be made into a palindrome%n" orig)
    (println "dingo"))
)

(def orig (first *command-line-args*))
(def input (seq (char-array (first *command-line-args*))))
(defn palindrome? [s] (= s (reverse s)))
(def occurrences-map (frequencies input))
(def evens-map (filter (fn [[_, v]] (even? v)) occurrences-map))
(def odds-map (filter (fn [[_, v]] (odd? v)) occurrences-map))

(defn string-from-map [k, v] (apply str (take (quot v 2) (repeat k))))

(defn get-single [k, _] k)

; build full string with (apply str 1 2 3)
; iterate through pairs with (doseq [[k, v] map-name] ())
; final print = (printf "A palindromic form of %s is %s%n" orig (build-string s-evens s-odds single))

(if (palindrome? input)
  (printf "%s is a palindrome%n" orig)
  (if (> (count (keys odds-map)) 1)
    (printf "%s cannot be made into a palindrome%n" orig)
    (printf "A palindromic form of %s is %s%n" orig orig)
  )
)

Sort of getting somewhere on Clojure part 3


(ns immutant.web-test
  (:require [clojure.test :refer :all]
            [immutant.web :refer :all]
            [testing.web  :refer [get-body hello handler]]
            [testing.hello.service :as pedestal]))

(def url "http://localhost:8080/")

(deftest run-should-var-quote
  (run hello)
  (is (= "hello" (get-body url)))
  (with-redefs [hello (handler "howdy")]
    (is (= "howdy" (get-body url)))))

(deftest mount-unquoted-handler
  (mount (server) hello)
  (is (= "hello") (get-body url))
  (with-redefs [hello (handler "hi")]
    (is (= "hello" (get-body url)))))

(deftest mount-quoted-handler
  (mount (server) #'hello)
  (is (= "hello") (get-body url))
  (with-redefs [hello (handler "hi")]
    (is (= "hi" (get-body url)))))

(deftest mount-pedestal-service
  (mount-servlet (server) pedestal/servlet)
  (is (= "Hello World!" (get-body url))))

(ns immutant.web-test
  (:require [clojure.test :refer :all]
            [immutant.web :refer :all]
            [testing.web  :refer [get-body hello handler]]
            [testing.hello.service :as pedestal])
  (import clojure.lang.ExceptionInfo))

(def url "http://localhost:8080/")

(deftest run-should-var-quote
  (run hello)
  (is (= "hello" (get-body url)))
  (with-redefs [hello (handler "howdy")]
    (is (= "howdy" (get-body url)))))

(deftest mount-unquoted-handler
  (mount (server) hello)
  (is (= "hello") (get-body url))
  (with-redefs [hello (handler "hi")]
    (is (= "hello" (get-body url)))))

(deftest mount-quoted-handler
  (mount (server) #'hello)
  (is (= "hello") (get-body url))
  (with-redefs [hello (handler "hi")]
    (is (= "hi" (get-body url)))))

(deftest mount-pedestal-service
  (mount-servlet (server) pedestal/servlet)
  (is (= "Hello World!" (get-body url))))

(deftest unmount-yields-404
  (run hello)
  (is (= "hello" (get-body url)))
  (unmount)
  (let [result (is (thrown? ExceptionInfo (get-body url)))]
    (is (= 404 (-> result ex-data :object :status)))))

(deftest mount-should-call-init
  (let [p (promise)]
    (run hello :init #(deliver p 'init))
    (is (= 'init @p))))

(deftest unmount-should-call-destroy
  (let [p (promise)]
    (run hello :destroy #(deliver p 'destroy))
    (is (not (realized? p)))
    (unmount)
    (is (= 'destroy @p))))

Test for unmount, init and destroy

Test for unmount, init and destroy


(defproject noir-app "0.1.0-SNAPSHOT"
            :description "FIXME: write this!"
            :dependencies [[org.clojure/clojure "1.3.0"]
                           [noir "1.2.1"]]
            :main noir-app.server)

(defproject noir-app "0.1.0-SNAPSHOT"
            :description "FIXME: write this!"
            :dependencies [[org.clojure/clojure "1.3.0"]
                           [noir "1.3.0-alpha5"]]
            :main noir-app.server)

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.


(ns lazytest.testable)

(defprotocol Testable
  (get-tests [this]
"Returns a seq of RunnableTest objects. Processes the :focus metadata flag.
 Default implementation recurses on all Vars in a namespace, unless
 that namespace has :get-tests metadata."))

(defn focused?
  "True if x has :focus metadata set to true."
  [x]
  (boolean (:focused (meta x))))

(defn filter-focused
  "If any items in sequence s are focused, return them; else return s."
  [s]
  (or (seq (filter focused? s)) s))

(extend-protocol Testable
  clojure.lang.Namespace
  (get-tests [this-ns]
    (if-let [f (:get-tests (meta this-ns))]
      (do (assert (fn? f)) (f))
      (filter-focused
       (mapcat get-tests (vals (ns-interns this-ns))))))

  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)))))))

(ns lazytest.testable)

(defprotocol Testable
  (get-tests [this]
"Returns a seq of RunnableTest objects. Processes the :focus metadata flag.
 Default implementation recurses on all Vars in a namespace, unless
 that namespace has :get-tests metadata."))

(defn focused?
  "True if x has :focus metadata set to true."
  [x]
  (boolean (:focused (meta x))))

(defn filter-focused
  "If any items in sequence s are focused, return them; else return s."
  [s]
  (or (seq (filter focused? s)) s))

(extend-protocol Testable
  clojure.lang.Namespace
  (get-tests [this-ns]
    (if-let [f (:get-tests (meta this-ns))]
      (do (assert (fn? f)) (f))
      (filter-focused
       (mapcat get-tests (vals (ns-interns this-ns))))))

  clojure.lang.Var
  (get-tests [this-var]
    (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 support for :get-tests metadata on Vars


(ns tenor.entities)

(defrecord Note [note-value pitch-letter octave])

(defn make-note [notation]
  (let [notation-re #"^(1|2|4|8|16)([A-G])([#b]?)([1-9])$"
        components (re-matches notation-re notation)]
    (if components
      (->Note
        (Integer. (nth components 1))
        (str (nth components 2) (nth components 3))
        (Integer. (nth components 4)))
      "Invalid notation")))

(defn time-signature [beat-count & [sig]]
  (cond
    (> beat-count 3)
    (let [beats (rand-nth [2 3 4])
          sig (concat (or sig '()) (range 1 (inc beats)))]
      (time-signature (- beat-count beats) sig))
    (and (<= beat-count 3) (> beat-count 0))
    (let [sig (concat (or sig '()) (range 1 (inc beat-count)))]
      (time-signature 0 sig))
    :else sig))

(ns tenor.entities)

(defrecord Note [note-value pitch-letter octave])

(defn make-note [notation]
  (let [notation-re #"^(1|2|4|8|16)([A-G])([#b]?)([1-9])$"
        components (re-matches notation-re notation)]
    (if components
      (->Note
        (Integer. (nth components 1))
        (str (nth components 2) (nth components 3))
        (Integer. (nth components 4)))
      (throw (Exception. "Invalid notation")))))

(defn time-signature [beat-count & [sig]]
  (cond
    (> beat-count 3)
    (let [beats (rand-nth [2 3 4])
          sig (concat (or sig '()) (range 1 (inc beats)))]
      (time-signature (- beat-count beats) sig))
    (and (<= beat-count 3) (> beat-count 0))
    (let [sig (concat (or sig '()) (range 1 (inc beat-count)))]
      (time-signature 0 sig))
    :else sig))

Use exception instead of string

Use exception instead of string


(ns whitman.core
  (:require [whitman.config :as config])
  (:gen-class))

(defn exit [code msg]
  (binding [*out* *err*]
    (do (println msg)
        (System/exit code))))

(defn -main [& args]
  (if (< (count args) 1)
      (exit 1 "No configuration file specified")
      (let [cfg (-> (nth args 0)
                    config/read-config)
            user-agent (get cfg "user-agent")]
        (println cfg))))

(ns whitman.core
  (:require [whitman.config :as config])
  (:gen-class))

(defn exit [code msg]
  (binding [*out* *err*]
    (do (println msg)
        (System/exit code))))

(defn -main [& args]
  (if (< (count args) 1)
      (exit 1 "No configuration file specified")
      (-> (nth args 0)
          config/read-config
          println)))

Use -> to simply main function...again

Use -> to simply main function...again


(ns puppetlabs.cthun.meshing.hazelcast-test
  (require [clojure.test :refer :all]
           [puppetlabs.cthun.meshing.hazelcast :refer :all]))

(deftest broker-for-endpoint-test
  (with-redefs [flatten-location-map (fn [_] [{:broker "bill" :endpoint "cth://localhost/agent"}
                                              {:broker "ted"  :endpoint "cth://localhost/agent"}
                                              {:broker "bill" :endpoint "cth://localhost/controller"}])]
    (testing "it finds the controller"
      (is (= "bill" (broker-for-endpoint nil "cth://localhost/controller"))))
    (testing "it finds the agent"
      (is (= "bill" (broker-for-endpoint nil "cth://localhost/agent"))))
    (testing "it won't find something absent"
      (is (not (broker-for-endpoint nil "cth://localhost/no-suchagent"))))))

Add partial testing to the hazelcast mesh


{:user
 {:plugins [[lein-vanity "0.2.0"]
            [jonase/eastwood "0.0.2"]
            [cider/cider-nrepl "0.7.0-SNAPSHOT"]
            ;[lein-ritz "0.7.0"]
            [com.palletops/pallet-lein "0.8.0-alpha.1"]]
  :dependencies [;[ritz/ritz-nrepl-middleware "0.7.0"]
                 [org.clojure/tools.trace "0.7.6"]
                 [slamhound "1.5.0"]]
  ;; :repl-options {:nrepl-middleware
  ;;                [ritz.nrepl.middleware.javadoc/wrap-javadoc
  ;;                 ritz.nrepl.middleware.simple-complete/wrap-simple-complete]}
  :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}

{:user
 {:plugins [[lein-vanity "0.2.0"]
            [jonase/eastwood "0.1.2"]
            [cider/cider-nrepl "0.7.0-SNAPSHOT"]
            [com.palletops/pallet-lein "0.8.0-alpha.1"]]
  :dependencies [[slamhound "1.5.0"]]
  :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}

Drop ritz and upgrade eastwood

Drop ritz and upgrade eastwood


(ns hu.ssh.github-changelog.dependencies.bundler
  (:require
    [clojure.string :refer [split-lines]]
    [clojure.java.io :refer [reader]]))

(defn- get-specs [reader]
  (->> (doall (line-seq reader))
       (drop-while #(not= % "  specs:"))
       (drop 1)
       (take-while seq)))

(defn- parse-spec [spec]
  {:name (second spec) :version (nth spec 2)})

(defn- parse-specs [specs]
  (->> (map #(re-matches #"^\s{4}(\S+) \((.*)\)$" %) specs)
       (remove empty?)
       (map parse-spec)))

(defn parse [file]
  (with-open [rdr (reader file)]
    (parse-specs (get-specs rdr))))

(ns hu.ssh.github-changelog.dependencies.bundler
  (:require
    [clojure.string :refer [split-lines]]
    [clojure.java.io :as io]))

(defn- get-specs [reader]
  (->> (doall (line-seq reader))
       (drop-while #(not= % "  specs:"))
       (drop 1)
       (take-while seq)))

(defn- parse-spec [spec]
  {:name (second spec) :version (nth spec 2)})

(defn- parse-specs [specs]
  (->> (map #(re-matches #"^\s{4}(\S+) \((.*)\)$" %) specs)
       (remove empty?)
       (map parse-spec)))

(defn parse [file]
  (with-open [reader (io/reader file)]
    (parse-specs (get-specs reader))))

Rename reader variable to reader

Rename reader variable to reader


(ns engulf.core
  (:gen-class)
  (:require [engulf.benchmark :as benchmark]
            [noir.server :as nr-server])
  (:use aleph.http
        noir.core
        lamina.core))

(defn start-webserver [args]
  (nr-server/load-views "src/engulf/views")

  (let [mode (keyword (or (first args) :prod))
          port (Integer. (or (System/getenv "PORT") "3000"))
          noir-handler (nr-server/gen-handler {:mode mode})]
      (start-http-server
        (wrap-ring-handler noir-handler)
        {:port port :websocket true})))

(defn -main [& args]
  (start-webserver args)
  (println "Engulf Started!"))

(ns engulf.core
  (:gen-class)
  (:require [engulf.benchmark :as benchmark]
            engulf.views.benchmarker
            engulf.views.common
            engulf.views.index
            [noir.server :as nr-server])
  (:use aleph.http
        noir.core
        lamina.core))

(defn start-webserver [args]
  (let [mode (keyword (or (first args) :prod))
          port (Integer. (or (System/getenv "PORT") "3000"))
          noir-handler (nr-server/gen-handler {:mode mode})]
      (start-http-server
        (wrap-ring-handler noir-handler)
        {:port port :websocket true})))

(defn -main [& args]
  (start-webserver args)
  (println "Engulf Started!"))

Use requires to include views for uberjar


(ns user
  (:use
    clojure.repl
    io.aviso.repl
    speclj.config))

(install-pretty-exceptions)

(alter-var-root #'default-config assoc :color true :reporters ["documentation"])

(ns user
  (:use
    clojure.repl
    io.aviso.repl
    speclj.config)
  (:require
    ;; If not present, then test suite fails loading schema-validation with a ClassNotFound on EnumSchema
    ;; Leaky abstractions ...
    schema.core))

(install-pretty-exceptions)

(alter-var-root #'default-config assoc :color true :reporters ["documentation"])

Load schema.core early, to ensure that class EnumSchema exists


(ns cljs-workers.core
  (:require [cljs.core.async :refer [chan]])
  (:require-macros [cljs.core.async.macros :refer [go]]))

(defn supported?
  []
  (-> js/Worker
      undefined?
      not))

(defn create-one
  [script]
  (js/Worker. script))

(defn create-pool
  ([]
   (pool 5))

  ([count]
   (pool count "js/compiled/workers.js"))

  ([count script]
   (let [workers (chan count)]
     (go
       (dotimes [_ count]
         (>! workers (create-one script))))
     workers)))

(defn- do-request!
  [worker {:keys [handler arguments transfer] :as request}]
  (let [message
        (-> {:handler handler, :arguments arguments}
            clj->js)

        transfer
        (->> transfer
             (select-keys arguments)
             vals)]

    (if (seq transfer)
      (.postMessage worker message (clj->js transfer))
      (.postMessage worker message))))

(defn- handle-response!
  [event]
  (-> (.-data event)
      (js->clj :keywordize-keys true)))

(defn do-with-worker!
  ([worker request]
   (do-with-worker! worker request nil))

  ([worker {:keys [handler arguments transfer] :as request} fun]
   (when fun
     (->> (comp fun handle-response!)
          (aset worker "onmessage")))
   (try
     (do-request! worker request)
     (catch js/Object e
       (when fun
         (fun {:state :error, :error e}))))))

Call handler with one worker

Call handler with one worker


(ns timetracker.models
  (:require [monger.core :as mg]
            [monger.collection :as mc]
            [monger.operators :refer :all])
  (:import [org.bson.types ObjectId]
           [com.mongodb DB WriteConcern]))

(defn now [] (new java.util.Date))

(defn create [task]
  (println (str "Added " task " at " (now) ))
  (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
        (mc/insert db coll {:task task, :time (now), :project_id "N/A"})))

(defn find_all []
  (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
        (mc/find-maps db coll )))

(defn process []
   (println "start post process ...")
   (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
        (mc/update db coll {} {$set {:project_id "Processed"}} {:multi true})))

(ns timetracker.models
  (:refer-clojure :exclude [sort find])
  (:require [monger.core :as mg]
            [monger.collection :as mc]
            [monger.operators :refer :all]
            [monger.query :refer :all])
  (:import [org.bson.types ObjectId]
           [com.mongodb DB WriteConcern]))

(defn now [] (new java.util.Date))

(defn create [task]
  (println (str "Added " task " at " (now) ))
  (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
        (mc/insert db coll {:task task, :time (now), :project_id "N/A"})))

(defn find_all []
  (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
   (with-collection db coll
        (find {})
         (fields [:task :time :project_id])
         (sort (array-map :time 1)))))

(defn process []
   (println "start post process ...")
   (let [conn (mg/connect)
        db   (mg/get-db conn "tasktracker")
        coll "tasks"]
        (mc/update db coll {} {$set {:project_id "Processed"}} {:multi true})))

Sort the documents oldest to newest when queried


(ns open-company.lib.email
  (:require [amazonica.aws.sqs :as sqs]
            [taoensso.timbre :as timbre]
            [schema.core :as schema]
            [open-company.config :as c]))

(def EmailTrigger
  {:to schema/Str
   :subject schema/Str
   :note schema/Str
   :reply-to (schema/maybe schema/Str)
   :company-slug schema/Str
   :snapshot {schema/Keyword schema/Any}})

(defn ctx->trigger [post-data {company :company user :user su :stakeholder-update}]
  {:pre [
    (string? (:to post-data))
    (string? (:subject post-data))
    (string? (:note post-data))
    (map? company)
    (map? user)
    (map? su)]}
  {:to (:to post-data)
   :subject (:subject post-data)
   :note (:note post-data)
   :reply-to (:email user)
   :company-slug (:slug company)
   :snapshot su})

(defn send-trigger! [trigger]
  (timbre/info "Request to send msg to " c/aws-sqs-email-queue "\n" (dissoc trigger :snapshot))
  (schema/validate EmailTrigger trigger)
  (timbre/info "Sending")
  (sqs/send-message
   {:access-key c/aws-access-key-id
    :secret-key c/aws-secret-access-key}
   c/aws-sqs-email-queue
   trigger))

(ns open-company.lib.email
  (:require [amazonica.aws.sqs :as sqs]
            [taoensso.timbre :as timbre]
            [schema.core :as schema]
            [open-company.config :as c]))

(def EmailTrigger
  {:to [schema/Str]
   :subject schema/Str
   :note schema/Str
   :reply-to (schema/maybe schema/Str)
   :company-slug schema/Str
   :snapshot {schema/Keyword schema/Any}})

(defn ctx->trigger [post-data {company :company user :user su :stakeholder-update}]
  {:pre [
    (sequential? (:to post-data))
    (string? (:subject post-data))
    (string? (:note post-data))
    (map? company)
    (map? user)
    (map? su)]}
  {:to (:to post-data)
   :subject (:subject post-data)
   :note (:note post-data)
   :reply-to (:email user)
   :company-slug (:slug company)
   :snapshot su})

(defn send-trigger! [trigger]
  (timbre/info "Request to send msg to " c/aws-sqs-email-queue "\n" (dissoc trigger :snapshot))
  (schema/validate EmailTrigger trigger)
  (timbre/info "Sending")
  (sqs/send-message
   {:access-key c/aws-access-key-id
    :secret-key c/aws-secret-access-key}
   c/aws-sqs-email-queue
   trigger))

Update to field to be sequence rather than comma delimitted.


(ns obb-rules-api.reply
  (:require [compojure.handler :as handler]
            [clojure.data.json :as json]
            [obb-rules.result :as result]
            [obb-rules-api.parser :as parser]
            [compojure.route :as route]))

(defn- make-response
  "Builds a response"
  [status-code obj]
  {:status status-code
   :headers {"Content-Type" "text/json; charset=utf-8"}
   :body (parser/dump obj)})

(defn ok
  "Returns HTTP 200 response"
  [obj]
  (make-response 200 obj))

(defn exception
  "Returns an exception"
  [exception]
  (make-response 500 {:exception (.getMessage exception)}))

(defn not-found
  "Returns HTTP 404 response"
  []
  (make-response 404 {:error "Resource not found"}))

(defn precondition-failed
  "Returns HTTP 412 response"
  [error-description]
  (make-response 412 {:error error-description}))

(defn result
  "Returns based on the given result"
  [result]
  (if (result/succeeded? result)
    (ok result)
    (make-response 412 result)))

(ns obb-rules-api.reply
  (:require [compojure.handler :as handler]
            [clojure.data.json :as json]
            [obb-rules.result :as result]
            [obb-rules-api.parser :as parser]
            [compojure.route :as route]))

(defn- make-response
  "Builds a response"
  [status-code obj]
  {:status status-code
   :headers {"Content-Type" "application/json; charset=utf-8"}
   :body (parser/dump obj)})

(defn ok
  "Returns HTTP 200 response"
  [obj]
  (make-response 200 obj))

(defn exception
  "Returns an exception"
  [exception]
  (make-response 500 {:exception (.getMessage exception)}))

(defn not-found
  "Returns HTTP 404 response"
  []
  (make-response 404 {:error "Resource not found"}))

(defn precondition-failed
  "Returns HTTP 412 response"
  [error-description]
  (make-response 412 {:error error-description}))

(defn result
  "Returns based on the given result"
  [result]
  (if (result/succeeded? result)
    (ok result)
    (make-response 412 result)))

Change response content type to application/json


(def start-t (System/currentTimeMillis))

(defsensor sine {:poll-interval (seconds 10)}
  (Math/sin (/ (- (System/currentTimeMillis) start-t) 60000.0)))

(defsensor cosine {:poll-interval (seconds 10)}
  (Math/cos (/ (- (System/currentTimeMillis) start-t) 60000.0)))

(defsensor cosine-2 {:poll-interval (seconds 5)}
  (Math/cos (/ (- (System/currentTimeMillis) start-t) 30000.0)))

(def start-t (System/currentTimeMillis))

(defsensor sine {:poll-interval (seconds 10)}
  (Math/sin (/ (- (System/currentTimeMillis) start-t) (minutes 1))))

(defsensor cosine {:poll-interval (seconds 10)}
  (Math/cos (/ (- (System/currentTimeMillis) start-t) (minutes 1))))

(defsensor steps-ascending {:poll-interval (seconds 5)}
  (mod (/ (- (System/currentTimeMillis) start-t) (minutes 2))
       3))

Remove the cosine-2 test series and replace with a sawtooth series for identiying sign issues.


(ns cglossa.models.core
  (:require [datomic.api :as d]
            [datomic-schema.schema :refer [part schema fields]]))

(def db-uri "datomic:free://localhost:4334/glossa")

(defn dbparts []
  [(part "glossa")])

(defn dbschema []
  [(schema corpus
           (fields
             [name :string]
             [short-name :string :unique-identity]
             [metadata-categories :ref :many]))

   (schema metadata-category
           (fields
             [short-nane :string]
             [widget-type :enum [:list :range]]
             [values :ref :many "One or more text-values, bool-values or numeric-values"]
             [text-value :string]
             [bool-value :boolean]
             [numeric-value :long]))

   (schema search
           (fields
             [corpus :ref :one]
             [queries :string :many]))])

(defn current-db []
  (d/db (d/connect db-uri)))

(defn find-by
  "Finds the first entity with the given value for the given Datomic attribute
  (e.g. :person/name) in the given (or by default the current) database."
  ([attr value]
   (find-by attr value (current-db)))
  ([attr value db]
   (let [ids (d/q '[:find ?e :in $ ?a ?v :where [?e ?a ?v]] db attr value)]
     (d/entity db (ffirst ids)))))

(ns cglossa.models.core
  (:require [datomic.api :as d]
            [datomic-schema.schema :refer [part schema fields]]))

(def db-uri "datomic:free://localhost:4334/glossa")

(defn dbparts []
  [(part "glossa")])

(defn dbschema []
  [(schema corpus
           (fields
             [name :string]
             [short-name :string :unique-identity]
             [metadata-categories :ref :many]))

   (schema metadata-category
           (fields
             [short-nane :string]
             [name :string]
             [widget-type :enum [:list :range]]
             [values :ref :many "One or more text-values, bool-values or numeric-values"]
             [text-value :string]
             [bool-value :boolean]
             [numeric-value :long]))

   (schema search
           (fields
             [corpus :ref :one]
             [queries :string :many]))])

(defn current-db []
  (d/db (d/connect db-uri)))

(defn find-by
  "Finds the first entity with the given value for the given Datomic attribute
  (e.g. :person/name) in the given (or by default the current) database."
  ([attr value]
   (find-by attr value (current-db)))
  ([attr value db]
   (let [ids (d/q '[:find ?e :in $ ?a ?v :where [?e ?a ?v]] db attr value)]
     (d/entity db (ffirst ids)))))

Add name attribute to metadata categories


(defproject buddy/buddy-hashers "0.4.2"
  :description "A collection of secure password hashers for Clojure"
  :url "https://github.com/funcool/buddy-hashers"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [buddy/buddy-core "0.5.0"]
                 [clojurewerkz/scrypt "1.2.0"]]
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"])

(defproject buddy/buddy-hashers "0.4.2"
  :description "A collection of secure password hashers for Clojure"
  :url "https://github.com/funcool/buddy-hashers"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"]
                 [buddy/buddy-core "0.5.0"]
                 [clojurewerkz/scrypt "1.2.0"]]
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"]
  :profiles {:dev {:plugins [[lein-ancient "0.6.7"]]}})

Add lein-ancient plugin and set "provided" scope for clojure.


(ns braid.base.conf
  (:require
   [braid.base.conf-extra :refer [ports-config]]
   [braid.core.hooks :as hooks]
   [mount.core :as mount :refer [defstate]]))

(defonce config-vars
  (hooks/register! (atom []) [keyword?]))

(defstate config
  :start
  (merge ;; temp defaults
    ;; TODO don't special case these here
    ;; ports should come from config
    {:db-url "datomic:mem://braid"
     :api-domain (str "localhost:" (:port (mount/args)))
     :site-url (str "http://localhost:" (:port (mount/args)))
     :hmac-secret "secret"}
    @ports-config ; overrides api-domain & site url when port is automatically found
    (select-keys (mount/args) @config-vars)))

(ns braid.base.conf
  (:require
   [braid.base.conf-extra :refer [ports-config]]
   [braid.core.hooks :as hooks]
   [mount.core :as mount :refer [defstate]]))

(defonce config-vars
  (hooks/register! (atom []) [keyword?]))

(defstate config
  :start
  (merge ;; temp defaults
    ;; TODO don't special case these here
    ;; ports should come from config
    {:db-url "datomic:mem://braid"
     :api-domain (str "localhost:" (inc (:port (mount/args))))
     :site-url (str "http://localhost:" (:port (mount/args)))
     :hmac-secret "secret"}
    @ports-config ; overrides api-domain & site url when port is automatically found
    (select-keys (mount/args) @config-vars)))

Fix api port number after removing mobile server


(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0-SNAPSHOT" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 jar {:file "server.jar"}
 junit {:packages '#{net.zephyrizing.http_server}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 jar {:file "server.jar"}
 junit {:packages '#{net.zephyrizing.http_server}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

Use the 0.1.0 release of boot-junit

Use the 0.1.0 release of boot-junit


(set-env!
  :source-paths #{"src" "src-java"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/test.check "0.9.0" :scope "test"]
                  ; project deps
                  [org.clojure/clojure "1.9.0-alpha7"]
                  [leiningen "2.6.1" :exclusions [leiningen.search]]
                  [ring "1.4.0"]
                  [clojail "1.0.6"]])

(task-options!
  pom {:project 'nightcode
       :version "2.0.0-SNAPSHOT"}
  aot {:namespace '#{net.sekao.nightcode.core
                     net.sekao.nightcode.controller
                     net.sekao.nightcode.lein}}
  jar {:main 'net.sekao.nightcode.core
       :manifest {"Description" "An IDE for Clojure and ClojureScript"
                  "Url" "https://github.com/oakes/Nightcode"}})

(deftask run []
  (comp
    (javac)
    (aot)
    (with-pre-wrap fileset
      (require '[net.sekao.nightcode.core :refer [dev-main]])
      ((resolve 'dev-main))
      fileset)))

(deftask run-repl []
  (comp
    (javac)
    (aot)
    (repl :init-ns 'net.sekao.nightcode.core)))

(deftask build []
  (comp (javac) (aot) (pom) (uber) (jar) (target)))

(set-env!
  :source-paths #{"src" "src-java"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/test.check "0.9.0" :scope "test"]
                  ; project deps
                  [org.clojure/clojure "1.9.0-alpha7"]
                  [leiningen "2.6.1" :exclusions [leiningen.search]]
                  [ring "1.4.0"]
                  [clojail "1.0.6"]])

(task-options!
  pom {:project 'nightcode
       :version "2.0.0-SNAPSHOT"}
  aot {:namespace '#{net.sekao.nightcode.core
                     net.sekao.nightcode.lein}}
  jar {:main 'net.sekao.nightcode.core
       :manifest {"Description" "An IDE for Clojure and ClojureScript"
                  "Url" "https://github.com/oakes/Nightcode"}})

(deftask run []
  (comp
    (javac)
    (aot)
    (with-pre-wrap fileset
      (require '[net.sekao.nightcode.core :refer [dev-main]])
      ((resolve 'dev-main))
      fileset)))

(deftask run-repl []
  (comp
    (javac)
    (aot)
    (repl :init-ns 'net.sekao.nightcode.core)))

(deftask build []
  (comp (javac) (aot) (pom) (uber) (jar) (target)))

Remove controller ns from namespace list


(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require '[[boot.core :as core]])
  (:import org.junit.runner.JUnitCore))

(deftask junit
  "Run the jUnit test runner."
  []
  (with-pre-wrap fileset
    (let [result (JUnitCore/runClasses
                  (into-array [#_ (magic goes here to find all test classes)]))]
      (when (> (.getFailureCount result) 0)
        (throw (ex-info "There were some test failures." {:result result}))))
    fileset))

(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require '[[boot.core :as core]])
  (:import org.junit.runner.JUnitCore))

(deftask junit
  "Run the jUnit test runner."
  [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
  (with-pre-wrap fileset
    (let [result (JUnitCore/runClasses
                  (into-array [#_ (magic goes here to find all test classes)]))]
      (when (> (.getFailureCount result) 0)
        (throw (ex-info "There were some test failures." {:result result}))))
    fileset))

Add a packages set parameter to the task

I'm going to follow the lead of adzerk's clojure.test runner and require
the user to specify where to run tests from. The nice thing here is that
they can just specify their base package and then we'll do reflection to
find all of the tests.


(set-env!
 :source-paths #{"src"}
 :resource-paths #{"src"}
 :dependencies '[[org.clojure/clojure         "1.6.0"  :scope "provided"]
                 [boot/core                   "2.1.0"  :scope "provided"]
                 [junit                       "4.12"   :scope "test"]
                 [org.reflections/reflections "0.9.10" :scope "test"]
                 [org.glassfish/javax.servlet "3.0"    :scope "test"]
                 [radicalzephyr/clansi        "1.2.0"  :scope "test"]])

(require '[radicalzephyr.boot-junit :refer [junit]])

(def +version+ "0.1.0")

(task-options!
 pom  {:project     'radicalzephyr/boot-junit
       :version     +version+
       :description "Run some jUnit tests in boot!"
       :url         "https://github.com/radicalzephyr/boot-junit"
       :scm         {:url "https://github.com/radicalzephyr/boot-junit"}
       :license     {"Eclipse Public License"
                     "http://www.eclipse.org/legal/epl-v10.html"}}
 junit {:packages '#{radicalzephyr.boot_junit.test}})

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"src"}
 :dependencies '[[org.clojure/clojure         "1.6.0"  :scope "provided"]
                 [boot/core                   "2.1.0"  :scope "provided"]
                 [junit                       "4.12"  ]
                 [org.reflections/reflections "0.9.10"]
                 [org.glassfish/javax.servlet "3.0"   ]
                 [radicalzephyr/clansi        "1.2.0" ]])

(require '[radicalzephyr.boot-junit :refer [junit]])

(def +version+ "0.1.0")

(task-options!
 pom  {:project     'radicalzephyr/boot-junit
       :version     +version+
       :description "Run some jUnit tests in boot!"
       :url         "https://github.com/radicalzephyr/boot-junit"
       :scm         {:url "https://github.com/radicalzephyr/boot-junit"}
       :license     {"Eclipse Public License"
                     "http://www.eclipse.org/legal/epl-v10.html"}}
 junit {:packages '#{radicalzephyr.boot_junit.test}})

Remove test scoping on dependencies

Remove test scoping on dependencies

They're not actually test scope on the boot task since that should
boot-junit should itself be test scoped.


(ns sicp.chapter3.5-1)

;;;; 3.5  Streams

;;; 3.5.1  Streams Are Delayed Lists

;; Exercise 3.50
(defn stream-map [proc & argstreams]
  (lazy-seq
   (if (empty? (first argstreams))
     nil
     (cons
      (apply proc (map first argstreams))
      (apply stream-map
             (cons proc (map rest argstreams)))))))

;; Exercise 3.51
(defn show [x]
  (println x)
  x)

(def x (map show (range 0 (inc 10))))
#_(nth x 5)
#_(nth x 7)

;; Exercise 3.52
(defn display-stream [s]
  (run! println s))

(def sum (atom 0))
#_@sum
(defn accum [x]
  (swap! sum + x))
#_@sum
(def seq' (map accum (range 1 (inc 20))))
#_@sum
(def y (filter even? seq'))
#_@sum
(def z (filter #(zero? (rem % 5)) seq'))
#_@sum
#_(nth y 7)
#_@sum
#_(display-stream z)
#_@sum

(ns sicp.chapter3.5-1)

;;;; 3.5  Streams

;;; 3.5.1  Streams Are Delayed Lists

;; Exercise 3.50
(defn stream-map [proc & argstreams]
  (lazy-seq
   (if (empty? (first argstreams))
     nil
     (cons
      (apply proc (map first argstreams))
      (apply stream-map
             (cons proc (map rest argstreams)))))))

(defn stream-map' [proc & argstreams]
  (lazy-seq
   (when (seq (first argstreams))
     (cons (apply proc (map first argstreams))
           (apply stream-map' proc (map rest argstreams))))))

;; Exercise 3.51
(defn show [x]
  (println x)
  x)

(def x (map show (range 0 (inc 10))))
#_(nth x 5)
#_(nth x 7)

;; Exercise 3.52
(defn display-stream [s]
  (run! println s))

(def sum (atom 0))
#_@sum
(defn accum [x]
  (swap! sum + x))
#_@sum
(def seq' (map accum (range 1 (inc 20))))
#_@sum
(def y (filter even? seq'))
#_@sum
(def z (filter #(zero? (rem % 5)) seq'))
#_@sum
#_(nth y 7)
#_@sum
#_(display-stream z)
#_@sum

Add another implementation to Exercise 3.50


(ns less4clj.webjars
  (:import [java.io File]
           [org.webjars WebJarAssetLocator]))

(def ^:private webjars-pattern
  #"META-INF/resources/webjars/([^/]+)/([^/]+)/(.*)")

(defn- asset-path [resource]
  (let [[_ name version path] (re-matches webjars-pattern resource)]
    (str name File/separator path)))

(defn asset-map
  "Create map of asset path to classpath resource url. Asset path is
  the resource url without webjars part."
  []
  (->> (.listAssets (WebJarAssetLocator.) "")
       (map (juxt asset-path identity))
       (into {})))

(comment
  (time (asset-map)))

(ns less4clj.webjars
  (:import [java.io File]
           [org.webjars WebJarAssetLocator]))

(def ^:private webjars-pattern
  #"META-INF/resources/webjars/([^/]+)/([^/]+)/(.*)")

(defn- asset-path [resource]
  (let [[_ name version path] (re-matches webjars-pattern resource)]
    (str name File/separator path)))

(defn asset-map
  "Create map of asset path to classpath resource url. Asset path is
  the resource url without webjars part."
  []
  (->> (vals (.getFullPathIndex (WebJarAssetLocator.)))
       (map (juxt asset-path identity))
       (into {})))

(comment
  (time (asset-map)))

Use getFullPathIndex to list wejars assets

listAssets calls getFullPathIndex and filters the values. Calling
getFullPathIndex directly avoids filtering.


(ns whitman.core
  (:require [whitman.config :as config]
            [whitman.crawler :as crawler]
            [whitman.db :as db]
            [whitman.writer :as writer])
  (:gen-class))

(defn exit [code msg]
  (binding [*out* *err*]
    (do (println msg)
        (System/exit code))))

(defn do-crawl [cfg writer]
  (let [users (crawler/records cfg)
        docs (map #(crawler/sample-docs cfg %) users)]
    (doseq [d docs] (writer/write writer cfg (:query d) (:insert d)))))

(defn -main [& args]
  (if (< (count args) 1)
    (exit 1 "No configuration file specified")
    (do-crawl (config/read-config (last args)) :db)))

(ns whitman.core
  (:require [whitman.config :as config]
            [whitman.crawler :as crawler]
            [whitman.db :as db]
            [whitman.writer :as writer])
  (:gen-class))

(defn exit [code msg]
  (binding [*out* *err*]
    (do (println msg)
        (System/exit code))))

(defn do-crawl [cfg writer]
  (let [users (crawler/records cfg)
        docs (map #(crawler/sample-docs cfg %) users)]
    (doseq [d docs] (writer/write writer cfg (:query d) (:insert d)))))

(defn writer [args]
  :db)

(defn -main [& args]
  (if (< (count args) 1)
    (exit 1 "No configuration file specified")
    (do-crawl (config/read-config (last args)) (writer args))))

Read writer type from arguments

Read writer type from arguments


(defproject uxbox-backend "0.1.0-SNAPSHOT"
  :description "UXBox backend + api"
  :url "http://uxbox.github.io"
  :license {:name "" :url ""}
  :source-paths ["src"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
  :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                 [org.slf4j/slf4j-simple "1.7.16"]
                 [bouncer "1.0.0"]
                 [mount "0.1.9"]
                 [environ "1.0.2"]
                 [com.github.spullara.mustache.java/compiler "0.9.1"]
                 [niwinz/migrante "0.1.0-SNAPSHOT"]
                 [funcool/suricatta "0.8.1"]
                 [funcool/promesa "0.8.1"]
                 [hikari-cp "1.5.0"]
                 [funcool/catacumba "0.11.2-SNAPSHOT"]]
  :main ^:skip-aot uxbox.main
  :plugins [[lein-ancient "0.6.7"]])

(defproject uxbox-backend "0.1.0-SNAPSHOT"
  :description "UXBox backend."
  :url "http://uxbox.github.io"
  :license {:name "" :url ""}
  :source-paths ["src"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
  :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                 [org.slf4j/slf4j-simple "1.7.16"]
                 [bouncer "1.0.0"]
                 [mount "0.1.9"]
                 [environ "1.0.2"]
                 [buddy/buddy-sign "0.9.0"]
                 [buddy/buddy-hashers "0.11.0"]
                 [com.github.spullara.mustache.java/compiler "0.9.1"]
                 [niwinz/migrante "0.1.0-SNAPSHOT"]
                 [funcool/suricatta "0.8.1"]
                 [funcool/promesa "0.8.1"]
                 [hikari-cp "1.5.0"]
                 [funcool/catacumba "0.11.2-SNAPSHOT"]]
  :main ^:skip-aot uxbox.main
  :plugins [[lein-ancient "0.6.7"]])

Add buddy-sign and buddy-hashers dependencies.


(ns silly-image-store.store
  (:require [clojure.java.io :as io]))

(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))

(defn load-image [& paths]
  (let [file (apply io/file paths)]
    (if (exists? file) file)))

(defn list-images [& paths]
  (let [image-directory (apply load-image paths)]
    (if (exists? image-directory)
      (->> image-directory
       .listFiles
       (filter file?)
       (map filename)))))

(defn list-image-dirs [& paths]
  (let [image-directory (apply load-image paths)]
    (if (exists? image-directory)
      (->> image-directory
       .listFiles
       (filter (complement file?))
       (map filename)))))

(defn random-image [basedir]
  (let [random-image-name (rand-nth (list-images basedir))]
    (load-image basedir random-image-name)))

(ns silly-image-store.store
  (:require [clojure.java.io :as io]))

(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))

(defn load-image [& paths]
  (let [file (apply io/file paths)]
    (if (exists? file) file)))

(defn- filtered-file-names [filter-fn paths]
  (let [image-directory (apply load-image paths)]
    (if (exists? image-directory)
      (->> image-directory
       .listFiles
       (filter filter-fn)
       (map filename)))))

(defn list-images [& paths]
  (filtered-file-names file? paths))

(defn list-image-dirs [& paths]
  (filtered-file-names (complement file?) paths))

(defn random-image [basedir]
  (let [random-image-name (rand-nth (list-images basedir))]
    (load-image basedir random-image-name)))

Remove duplication of listing files

Remove duplication of listing files


(ns quotes.routes
  (:gen-class)
  (:use [quotes.api :only [api-routes]])
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [common-utils.core :as utils]
            [common-utils.middleware :refer [correlation-id-middleware]]
            [clojure.tools.logging :as log]
            [ring.adapter.jetty :as jetty]))

(defroutes app-routes
  (context "/api" []
           (api-routes)))

(def app
  (-> app-routes
      correlation-id-middleware))

(defn -main []
  (let [port (Integer/parseInt (utils/config "APP_PORT" 8080))]
    (log/info "Running quotes on port" port)
    (future (jetty/run-jetty (var app) {:host "0.0.0.0"
                                        :port port}))))

(ns quotes.routes
  (:gen-class)
  (:use [quotes.api :only [api-routes]])
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [common-utils.core :as utils]
            [common-utils.middleware :refer [correlation-id-middleware]]
            [clojure.tools.logging :as log]
            [ring.adapter.jetty :as jetty]))

(defroutes app-routes
  (context "/api" []
           (api-routes)))

(def app
  (-> app-routes
      correlation-id-middleware))

(defn -main []
  (let [port (Integer/parseInt (utils/config "APP_PORT" "8080"))]
    (log/info "Running quotes on port" port)
    (future (jetty/run-jetty (var app) {:host "0.0.0.0"
                                        :port port}))))

Make default port work in quotes app

Make default port work in quotes app


(ns rna-transcription.test (:require [clojure.test :refer :all]))
(load-file "rna_transcription.clj")

(deftest transcribes-guanine-to-cytosine
  (is (= "G" (rna-transcription/to-rna "C"))))

(deftest transcribes-cytosine-to-guanine
  (is (= "C" (rna-transcription/to-rna "G"))))

(deftest transcribes-uracil-to-adenine
  (is (= "U" (rna-transcription/to-rna "A"))))

(deftest it-transcribes-thymine-to-uracil
  (is (= "A" (rna-transcription/to-rna "T"))))

(deftest it-transcribes-all-nucleotides
  (is (= "UGCACCAGAAUU" (rna-transcription/to-rna "ACGTGGTCTTAA"))))

(deftest it-validates-dna-strands
  (is (thrown? AssertionError (rna-transcription/to-rna "XCGFGGTDTTAA"))))

(run-tests)

(ns rna-transcription.test (:require [clojure.test :refer :all]))
(load-file "rna_transcription.clj")

(deftest transcribes-cytosine-to-guanine
  (is (= "G" (rna-transcription/to-rna "C"))))

(deftest transcribes-guanine-to-cytosine
  (is (= "C" (rna-transcription/to-rna "G"))))

(deftest transcribes-adenine-to-uracil
  (is (= "U" (rna-transcription/to-rna "A"))))

(deftest it-transcribes-thymine-to-adenine
  (is (= "A" (rna-transcription/to-rna "T"))))

(deftest it-transcribes-all-nucleotides
  (is (= "UGCACCAGAAUU" (rna-transcription/to-rna "ACGTGGTCTTAA"))))

(deftest it-validates-dna-strands
  (is (thrown? AssertionError (rna-transcription/to-rna "XCGFGGTDTTAA"))))

(run-tests)

Make test names match assertions

Make test names match assertions

First it looked like each test name was backwards. Giving the function "C" and transcribing to "G" was named `transcribes-guanine-to-cytosine` rather than `transcribes-cytosine-to-guanine`.

Second, the assertion for "T" -> "A" appeared to be in the right order but it mentioned the wrong nucleotide.


(ns clojars.test.unit.middleware
  (:require [clojars.middleware :as middleware]
            [clojure.test :refer :all]))

(def trailing-slash (middleware/wrap-ignore-trailing-slash (fn [x] (get x :uri))))

(deftest trailing-slash-doesnt-modify-root
  (is (= "/" (trailing-slash {:uri "/"}))))

(deftest trailing-slash-doesnt-modify-sub-routes
  (is (= "/artifact/project") (trailing-slash {:uri "/artifact/project"})))

(deftest trailing-slash-removes-trailing-slash
  (is (= "/artifact/project") (trailing-slash {:uri "/artifact/project/"})))

(deftest trailing-slash-doesnt-remove-redundant-trailing-slash
  (is (= "/artifact/project/") (trailing-slash {:uri "/artifact/project//"})))

(ns clojars.test.unit.middleware
  (:require [clojars.middleware :as middleware]
            [clojure.test :refer :all]))

(def trailing-slash (middleware/wrap-ignore-trailing-slash (fn [x] (get x :uri))))

(deftest trailing-slash-doesnt-modify-root
  (is (= "/" (trailing-slash {:uri "/"}))))

(deftest trailing-slash-doesnt-modify-sub-routes
  (is (= "/artifact/project" (trailing-slash {:uri "/artifact/project"}))))

(deftest trailing-slash-removes-trailing-slash
  (is (= "/artifact/project" (trailing-slash {:uri "/artifact/project/"}))))

(deftest trailing-slash-doesnt-remove-redundant-trailing-slash
  (is (= "/artifact/project/" (trailing-slash {:uri "/artifact/project//"}))))

Fix these tests to actually test

Fix these tests to actually test


(ns {{name}}.core
    (:require-macros [rum.core :refer [defc]])
    (:require [re-natal.support :as support]
              [rum.core :as rum]
              [cljs-exponent.components :refer [text view image touchable-highlight] :as rn]))

(def logo-img (js/require "./assets/images/cljs.png"))

(defn alert [title]
  (.alert rn/alert title))

(defonce app-state (atom {:greeting "Hello Clojure in iOS and Android!"}))

(defc AppRoot < rum/reactive [state]
  (view {:style {:flexDirection "column" :margin 40 :alignItems "center"}}
        (text {:style {:fontSize 30 :fontWeight "100" :marginBottom 20 :textAlign "center"}} (:greeting @state))
        (image {:source logo-img
                :style  {:width 80 :height 80 :marginBottom 30}})
        (touchable-highlight {:style   {:backgroundColor "#999" :padding 10 :borderRadius 5}
                              :onPress #(alert "HELLO!")}
                             (text {:style {:color "white" :textAlign "center" :fontWeight "bold"}} "press me"))))

(defonce root-component-factory (support/make-root-component-factory))

(defn mount-app [] (support/mount (AppRoot app-state)))

(defn init []
  (mount-app)
  (.registerComponent rn/app-registry "main" (fn [] root-component-factory)))

(ns {{name}}.core
    (:require-macros [rum.core :refer [defc]])
    (:require [re-natal.support :as support]
              [rum.core :as rum]
              [cljs-exponent.components :refer [text view image touchable-highlight] :as rn]))

(def logo-img (js/require "./assets/images/cljs.png"))

(defn alert [title]
  (.alert rn/alert title))

(defonce app-state (atom {:greeting "Hello Clojure in iOS and Android!"}))

(defc AppRoot < rum/reactive [state]
  (view {:style {:flexDirection "column" :margin 40 :alignItems "center"}}
        (text {:style {:fontSize 30 :fontWeight "100" :marginBottom 20 :textAlign "center"}} (:greeting (rum/react state)))
        (image {:source logo-img
                :style  {:width 80 :height 80 :marginBottom 30}})
        (touchable-highlight {:style   {:backgroundColor "#999" :padding 10 :borderRadius 5}
                              :onPress #(alert "HELLO!")}
                             (text {:style {:color "white" :textAlign "center" :fontWeight "bold"}} "press me"))))

(defonce root-component-factory (support/make-root-component-factory))

(defn mount-app [] (support/mount (AppRoot app-state)))

(defn init []
  (mount-app)
  (.registerComponent rn/app-registry "main" (fn [] root-component-factory)))

Use rum/react to access atom

Use rum/react to access atom

This wasn't working for me, the view wasn't updating when the atom changed, until I derefed the atom using `rum/react`. I believe this is the way to do [Reactive Components](https://github.com/tonsky/rum#reactive-components) in Rum?


(ns uxbox.shapes
  (:require [sablono.core :refer-macros [html]]))

(defmulti render
  (fn [shape & params]
    (:type shape)))

(defmethod render :builtin/icon
  [shape & [{:keys [width height] :or {width "500" height "500"}}]]
  (let [content (:svg shape)]
    (html
     [:svg {:width width :height height} content])))

(ns uxbox.shapes
  (:require [sablono.core :refer-macros [html]]))

(defmulti render
  (fn [shape & params]
    (:type shape)))

(defmethod render :builtin/icon
  [{:keys [data width height view-box]} & [attrs]]
  (let [attrs (merge
               (when width {:width width})
               (when height {:height height})
               (when view-box {:viewBox (apply str (interpose " " view-box))})
               attrs)]

    (html
     [:svg attrs data])))

Improve render function for builtin icons.


(defproject processing-core/processing.core "0.1.0-SNAPSHOT"
  :description "A wrapper for Processing in Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojars.processing-core/org.processing.core "1.5.1"]
                 [org.clojars.processing-core/org.processing.gluegen-rt "1.5.1"]
                 [org.clojars.processing-core/org.processing.jogl "1.5.1"]
                 [org.clojars.processing-core/org.processing.opengl "1.5.1"]])

(defproject processing-core/processing.core "1.0.0-SNAPSHOT"
  :description "A wrapper for Processing in Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojars.processing-core/org.processing.core "1.5.1"]
                 [org.clojars.processing-core/org.processing.gluegen-rt "1.5.1"]
                 [org.clojars.processing-core/org.processing.jogl "1.5.1"]
                 [org.clojars.processing-core/org.processing.opengl "1.5.1"]
                 [org.clojars.processing-core/org.processing.itext "1.5.1"]
                 [org.clojars.processing-core/org.processing.pdf "1.5.1"]])

Add deps required for PDF support

Add deps required for PDF support


(defproject strava-activity-graphs "0.1.0-SNAPSHOT"
  :description "Generate statistical charts for Strava activities"
  :url "https://github.com/nicokosi/strava-activity-graphs"
  :license {:name "Creative Commons Attribution 4.0"
            :url  "https://creativecommons.org/licenses/by/4.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [incanter/incanter-core "1.9.3"]
                 [incanter/incanter-charts "1.9.3"]
                 [incanter/incanter-io "1.9.3"]
                 [org.clojure/data.json "1.0.0"]
                 [clj-http "3.10.2"]
                 [slingshot "0.12.2"]]
  :plugins [[lein-cljfmt "0.6.8"]]
  :main ^:skip-aot strava-activity-graphs.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

(defproject strava-activity-graphs "0.1.0-SNAPSHOT"
  :description "Generate statistical charts for Strava activities"
  :url "https://github.com/nicokosi/strava-activity-graphs"
  :license {:name "Creative Commons Attribution 4.0"
            :url  "https://creativecommons.org/licenses/by/4.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [incanter/incanter-core "1.9.3"]
                 [incanter/incanter-charts "1.9.3"]
                 [incanter/incanter-io "1.9.3"]
                 [org.clojure/data.json "1.0.0"]
                 [clj-http "3.10.2"]
                 [slingshot "0.12.2"]]
  :plugins [[lein-cljfmt "0.7.0"]]
  :main ^:skip-aot strava-activity-graphs.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Update dependency lein-cljfmt:lein-cljfmt to v0.7.0


(ns faceboard.css.tabs
  (:use [faceboard.lib.constants])
  (:require [faceboard.lib.helpers :refer [>> mv px]]
            [garden.color :as color]))

(def styles
  [(>> tab-area
     (>> [> *]
       [:display :inline-block])
     (>> tab
       [:padding (px 0 4)
        :font-weight :bold
        :margin (px 2)
        :margin-left (px 8)
        :margin-bottom (px 0)
        :min-width (px 60)
        :cursor :pointer
        :position :relative
        :border-top-right-radius (px 2)
        :border-top-left-radius (px 2)
        :top (px 1)
        :text-align :center
        :background (color/darken signature-color 10)
        :color "#fff"]
       (>> &.selected
         [:color "#000"
          :background selected-tab-color
          :border-bottom (str "1px solid " selected-tab-color)])))
   (>> tab-contents
     [:position :relative
      :z-index 0
      :height "100%"]
     (>> tab-view
       [:height "100%"]
       (>> [> *]
         [:height "100%"])
       (>> &.dual-mode
         (>> [> *]
           [:width "50%"
            :display :inline-block])
         (>> left-side
           [:float :left])
         (>> right-side
           [:float :right]))))])

(ns faceboard.css.tabs
  (:use [faceboard.lib.constants])
  (:require [faceboard.lib.helpers :refer [>> mv px]]
            [garden.color :as color]))

(def styles
  [(>> tab-area
     (>> [> *]
       [:display :inline-block])
     (>> tab
       [:padding (px 0 4)
        :font-weight :bold
        :margin (px 2)
        :margin-left (px 8)
        :margin-bottom (px 0)
        :min-width (px 60)
        :cursor :pointer
        :position :relative
        :border-top-right-radius (px 2)
        :border-top-left-radius (px 2)
        :top (px 1)
        :text-align :center
        :background (color/darken signature-color 10)
        :color "#fff"]
       (>> &.selected
         [:color "#000"
          :background selected-tab-color])))
   (>> tab-contents
     [:position :relative
      :z-index 0
      :height "100%"]
     (>> tab-view
       [:height "100%"]
       (>> [> *]
         [:height "100%"])
       (>> &.dual-mode
         (>> [> *]
           [:width "50%"
            :display :inline-block])
         (>> left-side
           [:float :left])
         (>> right-side
           [:float :right]))))])

Remove border on selected tab

Remove border on selected tab


;; This is the default test configuration file.  If you would like to override
;; some of the settings herein, simply make a copy of this file and name it
;; `local.clj`.  It will be loaded instead of this one.  (`local.clj` is
;; included in the `.gitignore` file, so you don't have to worry about
;; accidentally committing your local changes.)

(defn test-db-config
  "Return a map of connection attrs for the test database"
  []
  {:classname   "org.hsqldb.jdbcDriver"
   :subprotocol "hsqldb"
   :subname     (str "mem:"
                  (java.util.UUID/randomUUID)
                  ";shutdown=true;hsqldb.tx=mvcc;sql.syntax_pgs=true")})

;; here is a sample test-db-config function for use with postgres
;(defn test-db-config
;  "Return a map of connection attrs for the test database"
;  []
;  {:classname   "org.postgresql.Driver"
;   :subprotocol "postgresql"
;   :subname     "//localhost:5432/puppetdb_test"
;   :user        "puppetdb"
;   :password    "puppet"
;   })

;; This is the default test configuration file.  If you would like to override
;; some of the settings herein, simply make a copy of this file and name it
;; `local.clj`.  It will be loaded instead of this one.  (`local.clj` is
;; included in the `.gitignore` file, so you don't have to worry about
;; accidentally committing your local changes.)

(defn test-db-config
  "Return a map of connection attrs for the test database"
  []
  (let [dbtype     (System/getenv "PUPPETDB_DBTYPE")
        dbsubname  (System/getenv "PUPPETDB_DBSUBNAME")
        dbuser     (System/getenv "PUPPETDB_DBUSER")
        dbpassword (System/getenv "PUPPETDB_DBPASSWORD")]
    (if (= dbtype "postgres")
      (if (some nil? [dbsubname dbuser dbpassword])
        (do
          (println "Ensure environment variables PUPPETDB_DBSUBNAME, PUPPETDB_DBUSER and PUPPETDB_DBPASSWORD are set")
          (System/exit 1))
        {:classname   "org.postgresql.Driver"
         :subprotocol "postgresql"
         :subname     dbsubname
         :user        dbuser
         :password    dbpassword})
      {:classname   "org.hsqldb.jdbcDriver"
       :subprotocol "hsqldb"
       :subname     (str "mem:"
                      (java.util.UUID/randomUUID)
                      ";shutdown=true;hsqldb.tx=mvcc;sql.syntax_pgs=true")})))

;; here is a sample test-db-config function for use with postgres
;(defn test-db-config
;  "Return a map of connection attrs for the test database"
;  []
;  {:classname   "org.postgresql.Driver"
;   :subprotocol "postgresql"
;   :subname     "//localhost:5432/puppetdb_test"
;   :user        "puppetdb"
;   :password    "puppet"
;   })

Define postgres settings using environment vars

In the past we were copying a magic from from tb-driver: local.clj that
contained all the information needed to connect to our test Postgres
database. tb-driver is being decommissioned, and its felt we need a better
way to manage this going forward.

This patch allows us to parameterize database tests, in particular the postgres
specific settings using environment variables. This way we can pass the
settings in from Jenkins using its special 'passwords as environment vars'
feature.

The default HSQLDB behaviour is kept if DBTEST_TYPE is not set, and local.clj
support is kept.

Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>


(ns overtunes.songs.at-all
  (:use
    [overtone.live :exclude [scale octave sharp flat sixth unison play]]
    [overtone.inst.sampled-piano :only [sampled-piano]]))

(def scale 66)
(defn ground [note] (+ scale note))

(def note# (comp sampled-piano ground))
(defn chord# [chord] (doseq [note (vals chord)] (note# note)))

(def ionian {:i 0, :ii 2, :iii 4, :iv 5, :v 7, :vi 9, :vii 11, :viii 12})
(def i (select-keys ionian [:i :iii :v]))
(def ii (select-keys ionian [:ii :iv :vi]))

(chord# ii)

(ns overtunes.songs.at-all
  (:use
    [overtone.live :only [at now]]
    [overtone.inst.sampled-piano :only [sampled-piano]]))

(defn bpm [beats-per-minute]
  (let [start (now)
        ms-per-minute (* 60 1000)
        ms-per-beat (/ ms-per-minute beats-per-minute)]
    #(+ start (* ms-per-beat %))))

(defn from [timing offset] #(timing (+ offset %)))

(def scale 56)
(defn ground [note] (+ scale note))

(def note# (comp sampled-piano ground))
(defn chord# [chord] (doseq [note (vals chord)] (note# note)))

(def ionian {:i 0, :ii 2, :iii 4, :iv 5, :v 7, :vi 9, :vii 11, :viii 12})
(def I (select-keys ionian [:i :iii :v]))
(def II (select-keys ionian [:ii :iv :vi]))
(def V (select-keys ionian [:v :vii :ii]))

(def progression [I {} II {} II V I V])

(defn rythm-n-bass# [timing chords]
  (do
    (at (timing 0) (chord# (first chords)))
    (rythm-n-bass# (from timing 4) (rest chords))))

; (rythm-n-bass# (bpm 130) (cycle progression))

Set up a chord loop.

Set up a chord loop.


(defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
  :description "Parent for hyde-pallet"
  :url "https://github.com/paleltops/hyde-pallet"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[com.palletops/hyde-pallet "0.1.0-SNAPSHOT"]]
  :plugins [[lein-modules "0.3.1"]]
  :aliases {"install" ["modules" "install"]
            "deploy" ["modules" "deploy"]
            "clean" ["modules" "clean"]}
  :profiles {:travis {:module {:subprocess "lein2"}}})

(defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
  :description "Parent for hyde-pallet"
  :url "https://github.com/paleltops/hyde-pallet"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[com.palletops/hyde-pallet "0.1.0-SNAPSHOT"]]
  :plugins [[lein-modules "0.3.1"]]
  :aliases {"install" ["modules" "install"]
            "deploy" ["modules" "deploy"]
            "clean" ["modules" "clean"]}
  :profiles {:travis {:modules {:subprocess "lein2"}}})

Fix modules config in travis profile

Fix modules config in travis profile


(defproject io.aviso/twixt "0.1.13-SNAPSHOT"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [io.aviso/pretty "0.1.10"]
                 [io.aviso/tracker "0.1.0"]
                 [ring/ring-core "1.2.2"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.5.3"]
                 [de.neuland-bfi/jade4j "0.4.0"]
                 [hiccup "1.0.4"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"
          :defaults                  {:doc/format :markdown}}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

(defproject io.aviso/twixt "0.1.13-SNAPSHOT"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [io.aviso/pretty "0.1.11"]
                 [io.aviso/tracker "0.1.0"]
                 [ring/ring-core "1.2.2"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.5.3"]
                 [de.neuland-bfi/jade4j "0.4.0"]
                 [hiccup "1.0.4"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"
          :defaults                  {:doc/format :markdown}}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

Update dependency to latest io.aviso:pretty, which includes stack frame filtering


(defproject clojurewerkz/statistiker "0.1.0-SNAPSHOT"
  :description "FIXME: write description"

  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.apache.commons/commons-math3 "3.2"]
                 [net.mikera/core.matrix "0.20.0"]]
  :source-paths       ["src/clj"]
  :java-source-paths  ["src/java"]
  :test-paths         ["test/clj"])

(defproject clojurewerkz/statistiker "0.1.0-SNAPSHOT"
  :description "FIXME: write description"

  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/math.combinatorics "0.0.7"]
                 [org.apache.commons/commons-math3 "3.2"]
                 [net.mikera/core.matrix "0.20.0"]
                 [org.jblas/jblas "1.2.3"]]
  :source-paths       ["src/clj"]
  :java-source-paths  ["src/java"]
  :test-paths         ["test/clj"])

Add combinatorics and matrix libs

Add combinatorics and matrix libs