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 juvi-pprint-eval-to-result-buffer (form) | |
(cider-interactive-eval form | |
(nrepl-make-response-handler (cider-popup-buffer cider-result-buffer nil 'clojure-mode 'ancillary) | |
(lambda (buffer value) | |
(cider-emit-into-popup-buffer buffer value)) | |
(lambda (buffer out) | |
(cider-emit-into-popup-buffer buffer out)) | |
(lambda (buffer err) | |
(cider-emit-into-popup-buffer buffer err)) | |
'()) |
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 ansible | |
(:require | |
[clojure.java.shell :as shell] | |
[clojure.string :as string] | |
[clojure.test :refer [deftest is]])) | |
(defn- keyword-to-string [x] | |
(if (keyword? x) | |
(name x) | |
x)) |
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 experimentation.kertotaulu | |
(:require | |
[clojure.string :as string])) | |
(defn multiplications [numbers] | |
(mapcat (fn [a] | |
(for [b numbers] | |
[a b])) | |
numbers)) |
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 dynamic-varialbe-access-benchmark | |
(:require [criterium.core :as criterium])) | |
(def ^:dynamic dynamic-x 1) | |
(def nondynamic-x 1) | |
(defn add-dynamic [] | |
(+ 1 dynamic-x)) |
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 load-employees-from-db [] | |
[{:name "Mary" :salary 6000} | |
{:name "John" :salary 4000}]) | |
(let [sum (atom 0)] | |
(doseq [e (load-employees-from-db)] | |
(reset! sum (+ @sum (:salary e)))) | |
(/ @sum | |
(count (load-employees-from-db)))) |
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 parser-combinator | |
"A parser combinator library. | |
A parser is a function that takes a sequence of tokens and returns | |
all possible partial parses, or nil if the parising fails. A partial | |
parse is a pair of a parse and a sequence of remaining tokens. A | |
parse is a sequence of values or tagged values. A tagged value is a | |
vector containing a keyword followed by values. | |
A parser combinator is a function from one or more parsers to a |
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 flow-gl.swing.render-loop-test | |
(:import [java.awt Canvas Color Font] | |
java.awt.geom.Rectangle2D$Double | |
javax.swing.JFrame)) | |
(defn start [] | |
(let [last-paint-time-atom (atom (System/currentTimeMillis)) | |
frame-rates-atom (atom []) | |
j-frame (JFrame.) | |
canvas (Canvas.)] |
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 serialization | |
(:require [clojure.java.io :as io] | |
[taoensso.nippy :as nippy]) | |
(:import [java.io DataInputStream DataOutputStream EOFException] | |
clojure.lang.IReduceInit | |
clojure.lang.IReduce)) | |
(defn with-data-output-stream [file-name function] | |
(with-open [data-output-stream (DataOutputStream. (io/output-stream (io/file file-name)))] | |
(function data-output-stream))) |
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 experimentation.sähkökalusteet | |
(:require [clojure.set :as set] | |
[flow-gl.graphics.buffered-image :as buffered-image] | |
[flow-gl.gui.animation :as animation] | |
[flow-gl.gui.visuals :as visuals] | |
[fungl.application :as application] | |
[fungl.component.text-area :as text-area] | |
[fungl.dependable-atom :as dependable-atom] | |
[fungl.layouts :as layouts])) |
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
Katkaise 2640 4500 pitkästä palasta | |
palat: [] | |
Katkaise 2640 4500 pitkästä palasta | |
palat: [1860] | |
Katkaise 2520 4500 pitkästä palasta | |
palat: [1860 1860] | |
Katkaise 2520 4500 pitkästä palasta | |
palat: [1860 1860 1980] | |
Katkaise 2520 4500 pitkästä palasta | |
palat: [1860 1860 1980 1980] |
NewerOlder