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
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
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
/* don't use this, it's just for a timing demonstration */ | |
public class ReturningException extends RuntimeException { | |
transient public final Object data; | |
transient public final Object context; | |
public ReturningException(Object o){ | |
this(null, o); | |
} | |
public ReturningException(Object c, Object o){ | |
super("Not really an exception"); |
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
;; Requires Outlet to run: https://github.com/jlongster/outlet | |
;; | |
;; Run with: `ol main.ol <input-file>` | |
;; | |
;; This is a meta-circular evaluator for a basic Lisp. It is | |
;; mostly taken from SICP 4.1*. I wanted to see if I could write a | |
;; debugger with it. Turns out if I want control over control flow I | |
;; need a register-based interpreter. | |
;; | |
;; * http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html#%_sec_4.1 |
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
(defmacro let-pipeline [decls & body] | |
(let [pairs (partition 2 decls) | |
vars (map first pairs) | |
exprs (map second pairs) | |
predecessors (map #(take % vars) (range (count vars)))] | |
`(let [~@(mapcat | |
(fn [v preds expr] | |
`[~v | |
(run-pipeline (merge-results ~@preds) | |
(fn [[~@preds]] ~expr))]) |
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 myreader.core | |
"Reader Literals Test" | |
(:require [clojure.string :as str])) | |
(defn debug-print | |
"Gauche debug print" | |
[x] | |
`(let [res# ~x] | |
(println "?=" res#) | |
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
body { | |
margin: 1em; | |
border-right: 5px solid #bbb; | |
border-bottom: 5px solid #bbb; | |
padding: 0; | |
background: #ddd none repeat scroll 0 0; | |
border: 1px solid #000; | |
margin: 0; | |
padding: 2em; | |
color: #333; |
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 Main where | |
How to write hybrid CPU/GPU programs with Haskell | |
------------------------------------------------- | |
What's better than programming a GPU with a high-level, | |
Haskell-embedded DSL (domain-specific-language)? Well, perhaps | |
writing portable CPU/GPU programs that utilize both pieces of |
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
This playbook has been removed as it is now very outdated. |
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
; Original problem here : http://www.4clojure.com/problem/144 | |
; This first solution works but is incomplete as fs needs to be repeated. | |
(defn osci-incomplete [v & fs] | |
(reduce (fn [accu elt] (conj accu (elt (last accu)))) | |
[v] fs)) | |
; Problem is that cycling fs leads to timeout. | |
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
apt-get install python-pip | |
pip install pystatsd | |
cat > /etc/default/statsd <<EOF | |
STATSD_PORT=8125 # port to run on (default: 8125) | |
PCT=90 # stats pct threshold (default: 90) | |
GRAPHITE_HOST=localhost # host to connect to graphite on (default: localhost) | |
GRAPHITE_PORT=2003 # port to connect to graphite on (default: 2003) | |
USER=nobody # user to run statsd as |