This file contains hidden or 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
:- use_module(library(clpfd)). | |
peano(N,z) :- N #= 0. | |
peano(N,s(PDec)) :- | |
N #> 0, | |
N - 1 #= NDec, | |
peano(NDec, PDec). | |
% ?- peano(4, Q). | |
% Q = s(s(s(s(z)))) ; |
This file contains hidden or 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
(load "mkprelude.scm") | |
(define peanoo | |
(lambda (n out) | |
(conde | |
[(== n (build-num 0)) (== '(O) out)] | |
[(fresh (n1 res) | |
(-o n (build-num 1) n1) | |
(conso 'S res out) | |
(peanoo n1 res))]))) |
This file contains hidden or 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
The Verificationist - Donald Antrim | |
what purpose did i serve in your life - Marie Calloway | |
The Last Samurai - Helen DeWitt | |
The White Album - Joan Didion | |
The Orphan Master's Son - Adam Johnson | |
Taipei - Tao Lin | |
The Twelve Tribes of Hattie - Ayana Mathis | |
The Road - Cormac McCarthy | |
Swamplandia! - Karen Russell | |
Journalism - Joe Sacco |
This file contains hidden or 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 knossos.redis | |
(:use knossos.core)) | |
;; System state | |
(defn node | |
"A node consists of a register, a primary it replicates from, whether it is | |
isolated from all other nodes, a local replication offset, and if it is a | |
primary, a map of node names to known replication offsets." | |
[name] |
This file contains hidden or 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
module Prelude.Overture | |
( module X | |
) | |
where | |
-- Haskell 98 stuff is easier to get at through the Prelude | |
-- than through the GHC-specific modules | |
import Prelude as X ( Bounded (..) | |
, Enum (..) | |
, Floating (..) |
This file contains hidden or 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
*.hi | |
*.o | |
bin/ | |
*~ |
This file contains hidden or 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 async-test.core | |
(:require [cljs.core.async :refer [chan]] | |
[clojure.string :as string]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go alt! alts!]])) | |
(def c (chan)) | |
(def loc-div (.getElementById js/document "location")) | |
(.addEventListener js/window "mousemove" |
This file contains hidden or 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
#!/bin/bash | |
# Bandwidth throttling for OSX, | |
# http://www.macosxhints.com/article.php?story=20080119112509736 | |
case "$1" in | |
'start') | |
KB=$2 | |
echo Throttling at $KB Kbytes/s | |
sudo ipfw pipe 1 config bw "$KB"KByte/s |
This file contains hidden or 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
-define(case_inf(E, E0, FC, E1, AC, E2, A, F, E3), | |
begin | |
AInf = (E), | |
if | |
not AInf -> | |
E0; | |
is_function(AInf) -> | |
FC = AInf, | |
E1; | |
is_tuple(AInf) andalso size(AInf) == 2 andalso is_function(element(2,AInf)) -> |
This file contains hidden or 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 plai/collector | |
;; A tri-color mark and sweep algorithm. There are three sets of heap nodes: | |
;; gray, white, and black. Black nodes are known to not be garbage or hold | |
;; references to garbage, gray nodes are known to not be garbage but their | |
;; references have not been checked, and white nodes, the rest, are garbage. | |
;; * The black set begins empty | |
;; * The gray set begins with the roots | |
;; * All non root nodes begin in the white set | |
;; * Iterate over the gray set. "Blacken" each node by "graying" the nodes |
NewerOlder