This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; quel sont les parents de Bart? | |
;; | |
(run* [q] | |
(parent 'Bart q)) | |
;; => (Homer Marge) | |
(set (run* [q] | |
(fresh [c] | |
(parent c q) ))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn create-attr-map | |
[attr-code attr-type src-code] | |
{"attribute" | |
{"name" attr-code | |
"attributeType" {"href" (format "/foundation/v2/attributeTypes/%s" attr-type)} | |
"source" {"href" (format "/foundation/v2/%s" src-code)}}}) | |
(comment | |
(def att0 (create-attr-map "new-attr-code" "String" "System")) | |
(json-encode att0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.bar | |
(:use [midje.sweet] | |
[clojure | |
[pprint :only [pprint pp]] | |
[repl :only [doc find-doc apropos]]] | |
[clojure.java.javadoc :only [javadoc]] | |
[clojure.tools.trace :only [trace deftrace trace-forms trace-ns untrace-ns trace-vars]]) | |
(:require [clojure | |
[set :as set] | |
[string :as str] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun quirk-black-background () | |
(interactive) | |
(set-face-background 'default "color-16")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;Hack to get a black background in terminal mode in emacs-live | |
;; most of it shamelessly stolen from: http://stackoverflow.com/questions/5795451/how-to-detect-that-emacs-is-in-terminal-mode | |
(add-hook 'after-make-frame-functions | |
(lambda () | |
(if (not window-system) | |
(set-face-background 'default "color-16")))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns cljsta.misc.code-story-2012 | |
(:use [midje.sweet] | |
[clojure.pprint :only [pprint print-table]] | |
[clojure.string :only [split join]] | |
[clojure.repl :only [doc]] | |
[table.core :only [table]]) | |
(:require [clojure | |
[string :as str] | |
[set :as set] | |
[walk :as w] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cs2013.enonce3> (defn f [x] (* 2 x)) | |
#'cs2013.enonce3/f | |
cs2013.enonce3> (defn g [x] (* 3 x)) | |
#'cs2013.enonce3/g | |
cs2013.enonce3> (defn h [x] (* 4 x)) | |
#'cs2013.enonce3/h | |
cs2013.enonce3> (defn i [x] (* 5 x)) | |
#'cs2013.enonce3/i | |
cs2013.enonce3> (defn j [x] (* 6 x)) | |
#'cs2013.enonce3/j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns euler-denlab.doing.p26-reciprocal-cycles | |
(:refer-clojure :exclude [inc reify ==]) | |
(:use | |
[clojure.core.logic] | |
[clojure | |
[pprint :only [pprint pp print-table ]] | |
[repl :only [doc find-doc apropos ]] | |
[inspector :only [inspect-tree inspect inspect-table ]]] | |
[clojure.java.javadoc :only [javadoc ]] | |
[clojure.tools.trace :only [trace deftrace trace-forms trace-ns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(clojure.string/split (slurp "my.file") #"\e") | |
(-> "my.file" | |
slurp | |
(clojure.string/split #"\e")) | |
(-> "my.file" | |
slurp | |
(clojure.string/split #"\e") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; pure fn implem | |
(defn set-empty [] | |
nil) | |
(defn set-contains? [{:keys [inner element]:as s} e] | |
(and s |
OlderNewer