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
;; nand* is not defined in terms of other gates | |
;; read the source to find out how we deal with that | |
(defgate not* [in] => [out] | |
(nand* [in in] => [out])) | |
(defgate and* [a b] => [out] | |
(nand* [a b] => [w]) | |
(not* [w] => [out])) |
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 nand* [a b] | |
(let [[out] (if (= 2 (+ a b)) [0] [1]) | |
out)) | |
(defn not* [in] | |
(let [[out] (nand* in in)] | |
out)) | |
(defn and* [a b] | |
(let [[w] (nand* a b) |
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- arrow? | |
"predicate that returns true if x is =>" | |
[x] | |
(and (symbol? x) (= (name x) "=>"))) | |
(defn- split-body | |
"splits expression into two parts, one with input | |
pins and the other with => and outputs" | |
[body] | |
(split-with (complement arrow?) body)) |
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
;; using reflex clojurescript library | |
;; works | |
(def a (atom 0)) | |
(def b (computed-observable (inc @a))) | |
(def c (computed-observable (dec @a))) | |
(def d (computed-observable (str @b))) | |
;; doesn't | |
;; maximum call stack exceeded |
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
$ znc --version | |
ZNC 0.206+deb1 - http://znc.in | |
$ which znc | |
/usr/local/bin/znc | |
$ /usr/local/bin/znc --version | |
ZNC 1.1-git-20121207-8ffab186 - http://znc.in | |
IPv6: yes, SSL: yes, DNS: threads |
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
#lang r5rs | |
;; chapter 3 minikanren | |
(define-syntax var | |
(syntax-rules () | |
((_ x) (vector x)))) | |
(define-syntax var? (syntax-rules () | |
((_ x) (vector? 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
## | |
## Arch Linux repository mirrorlist | |
## Generated on 2013-07-08 | |
## | |
## Germany | |
#Server = https://archlinux.limun.org/$repo/os/$arch | |
## Greece | |
#Server = https://foss.aueb.gr/mirrors/linux/archlinux/$repo/os/$arch |
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
# Usage: | |
# python rands.py | |
# | |
# head -n 1 output | |
# head -n 2 output | |
# etc... | |
import random | |
f = open('output', 'w') | |
lst = [0]*5 + [1]*5 |
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 flushfun.core | |
(:require [clojure.core.async :refer [chan go go-loop close! <!! timeout]] | |
[amazonica.aws.sqs :as sqs])) | |
(def queue (sqs/find-queue {:endpoint "eu-west-1"} "flushfun")) | |
(defn commit-fn [message] (fn [] (sqs/delete-message (assoc message :queue-url queue)))) | |
(defn flush-messages [{:keys [messages commits]}] | |
(println "FLUSHING" (map :body messages)) |
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
➜ finance git:(master) ✗ ./bin/distribute-cost Expenses:Misc:Buffer 150 USD 2017/02/01 28 | |
Expenses:Misc:Buffer 0.20 USD ; [=2017/02/01] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/01] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/02] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/03] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/04] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/05] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/06] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/07] | |
Expenses:Misc:Buffer 5.35 USD ; [=2017/02/08] |