Notes and examples of Transducers and Reducers
-
Used on collections
-
Eager evaluation only. (not lazy)
CALL CSVWRITE('/home/<user>/downloads/<table_name>'.csv', 'SELECT * FROM <table_name>', 'charset=UTF-8 fieldSeparator=;'); | |
Without field delimiter " | |
CALL CSVWRITE('/home/<user>/downloads/<table_name>'.csv', 'SELECT * FROM <table_name>', 'charset=UTF-8 fieldSeparator=; fieldDelimiter='); |
{:environment :production | |
:global {:logging-config "./logback.xml"} | |
:onyx {:job-scheduler :onyx.job-scheduler/balanced | |
:task-scheduler :onyx.task-scheduler/balanced | |
:peer-config {:onyx.messaging/impl :netty | |
:onyx.messaging/peer-port-range [40200 40220] | |
:onyx.messaging/peer-ports [40199] | |
:onyx.messaging/bind-addr "localhost" | |
:onyx.messaging/backpressure-strategy :high-restart-latency} | |
:peer-count 20 |
(ns creator.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [om.core :as om :include-macros true] | |
[cljs.core.async :as async :refer [chan <! >! put!]] | |
[om-tools.core :refer-macros [defcomponent]] | |
[cljs.reader :as reader] | |
[goog.dom :as gdom] | |
[om-tools.dom :as dom :include-macros true]) | |
(:import [goog.net XhrIo])) |
(ns history | |
"Light wrappers and utils for js/history") | |
(defn back! [] (.back js/history)) | |
(defn forward! [] (.forward js/history)) | |
(defn go! [idx] (.go js/history idx)) | |
(defn replace-state! |
(ns reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
#
# Automounter master map
#
+auto_master # Use directory service
(ns logic-play.puzzle | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:require [clojure.tools.macro :as mu] | |
[clojure.set :as set] | |
[clojure.core.logic.fd :as fd])) | |
;; ----- | |
;; CLP(Set) Boilerplate | |
(defn index [xs] (->> xs (map-indexed (fn [i x] [x (inc i)])) (into {}))) |
;; Datomic example code | |
;; Demonstrates using datalog with Clojure defrecords | |
(use '[datomic.api :only [q db] :as d]) | |
;;; http://www.lshift.net/blog/2010/08/21/some-relational-algebra-with-datatypes-in-clojure-12 | |
(defrecord Supplier [number name status city]) | |
(defrecord Part [number name colour weight city]) | |
(defrecord Shipment [supplier part quantity]) | |
;; sample data |
(require '[datomic.api :as d]) | |
(require '[clojure.pprint :refer [pprint]]) | |
(def uri "datomic:free://localhost:4334/git") | |
(def conn (d/connect uri)) | |
(def db (d/db conn)) | |
;; committers | |
(d/q '[:find ?email | |
:where | |
[_ :commit/committer ?u] |