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 extended.sql | |
"Extensions to clojure.contrib.sql that handle autogenerated ids." | |
(:use clojure.contrib.sql) | |
;; TODO: change to clojure.contrib.string for 1.2 | |
(:use [clojure.contrib.java-utils :only [as-str]])) | |
;;==== Internal functions ====================================================== | |
(defn- join |
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 shell | |
"Run OS commands" | |
(:import [java.io BufferedReader InputStreamReader])) | |
(defn run | |
"Executes the given command" | |
[cmd] | |
(.. Runtime getRuntime (exec (str cmd)))) | |
(defn pipe-to |
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
pwd | |
echo "Hello world" | |
sleep 1 | |
echo "Goodbye world" | |
exit 3 |
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
trait Builder { | |
type Config : Default; | |
fn build(v: &[BuilderFn<Self::Config>]) -> Self::Config { | |
let mut ret = Default::default(); | |
for c in v { | |
c(&mut ret) | |
} | |
ret |
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
final case class Matrix(s: String) { | |
private val matrix = fromString3(s) | |
def row(r: Int): Vector[Int] = { | |
matrix(r) | |
} | |
def column(c: Int): Vector[Int] = { | |
matrix.map(_(c)) |