 (defn- insert-join [pid i sid]
   (insert joins (values {:pid pid :i i :sid sid})))
 
+;
+; Binary buffer manipulation.
+;
+
 (def codec-length (memoize (fn [len]
                              (binary/repeated :float-le :length len))))
 

  (let [baos (java.io.ByteArrayOutputStream.)]
    (binary/encode (codec-length (count slist)) baos slist)
    (.toByteArray baos)))

(defn- load-probe [exp prow]
  (let [pid (insert-probe exp (:probe (meta prow)))

  (:require [org.clojars.smee.binary.core :as binary])
  (:require [clojure.java.io :as io])
  (:use [clj-time.format :only (formatter unparse)])
  (:use korma.core))

;(def db {:classname "org.h2.Driver"
;         :subprotocol "h2"
;         :subname "file:///data/TCGA/craft/h2/cavm.h2"})

;
; Table definitions.
;

(def float-size 4)
(def bin-size 100)
(def score-size (* float-size bin-size))

; Note H2 has one int type: signed, 4 byte. Max is approximately 2 billion.
(def probes-table ["CREATE TABLE IF NOT EXISTS `probes` (
                   `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
                   `eid` INT NOT NULL,
