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 readyforzero) | |
(def txt1 "en3pG3+nz+A2acXKrsyDouhViP9EDQS4JQK6uJqM3rBjKEBKC3yc=AA1=LUQqRPHvQ4dopgkbb/axClP3smzVcaTkRsCqHSG5aKFQ2TbOae0t5r4nWrCVesGK1Z3yEq+dClrDwXXOiAMyW09WdCS+CaKcfu=6kv9dUFBcS4KsUIgwMiXimoBpJZSWlBzILVf4zVA=7GjRP8RXn6uKjbjAPkpFEs/mYJpeOpEnhQfPhjoscgjfL5/SQsU6+jaAf5pg9MQzZdQAEJt7Jm1541fEmnumpjmJMd/MTJ5vzBttBBA7b5rbjDX0nHdTWn8C5suYKfNyYzc6x8S6FIepoEBsMS2mKhx5BRH5jSBrYRem4iQgYARzGnCFot3jPhp3cHj7qjXBWfZZASz8YJqi2d+r393AmdGm1L9NfU2f=FJprbLwJpuE7uT7xAlQA3Ry8aHRNgNkffP29Iqb2DSoQ0PK+9LX0t37HIAhI5zvoP6b4J7yQZEQDgeNlnPQMvSjw9pLWAxQ1VUY+NMU5BLZ2Bxuma1cIsHxcx4PwHcg0u1HYPJAWM2WK=xhJP5aQSc6oNMQK4s2=6guQRVFll6rvWkXTebrdsws7m/Kpa29spUFl8XzFx0ondEMCF3byAyWj875wAI3Hn8ZY92ddTAKj0s+a4X7qSti2lA0GzePHjBjMCD5g9kZYLtB94kkbVZ6eCle/xtto4LHH8GElc5YoUi=mk3nmQ5iOL1zMWfDyRUMLq+HCXbQL9NTejNa/yTdL3sayJOlMW1T7/Jmaz1FMbfBRFzruHeMT41=Zu3nYZJ3nIP22qKrFzNkt/24RuQ+7IMVCI2ngh2Yr8qLiL7QjSThRJPxA1wIJXwR2wqGiMhOqpun4DyQ5b/fTw1eTavpbFg6+tvqS4GKOt6p=bPoTV0GHIBBlXgHF/GUss90N0mXMKKiGwHhn/kyz=FxN0j=mfQUuUQa7lrZLjr10sqflWTwskIUkp1Cd8GYU |
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 inc-sandbox.corr-demo | |
(:require [clojure.set :as set]) | |
(:use (incanter core stats charts io)) | |
(:require [clj-time.core :as time]) | |
(:use (clj-time [format :only (formatter formatters parse)] | |
[coerce :only (to-long)]))) | |
(defn sym-to-dataset | |
"returns a dataset read from a local CSV in './data/' given a Yahoo Finance symbol name" | |
[yf-symbol] |
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
(def x [1 2]) | |
(def y [4 5]) | |
(defn- tree-comp-each [root branch & leaves] | |
(apply | |
root (map branch leaves))) | |
(defn euclidean-distance | |
[a b] | |
{:pre [(= (count a) (count 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 eval-decompose | |
[coll] | |
(let [super-d (distinct coll) | |
freqs (loop [ps [] | |
d super-d] | |
(if (seq d) | |
(let [c (count (filter (partial = (first d)) coll))] | |
(recur (conj ps c) (rest d))) | |
ps))] | |
(map #(vector %1 %2) super-d freqs))) |
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 match-count | |
" Given key, k, returns number of occurrences of k in collection, coll. | |
" | |
[k coll] | |
(let [match? (fn [i x] | |
(if (= k x) ;; closure on k | |
(inc i) | |
i))] | |
(reduce match? 0 coll))) |
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
# Scrapes wunderground weather record | |
# | |
# Based on http://casoilresource.lawr.ucdavis.edu/drupal/node/991 | |
# | |
# Usage: | |
# fetch.temperature('ILONDONL8', '2012-01-01', '2012-01-30') | |
# | |
fetch.temperature <- function(station, start.date, end.date) { | |
date.range <- seq.Date(from=as.Date(start.date), to=as.Date(end.date), by='1 day') |
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
(workflow [tmp-path] | |
step-A ([:tmp-dirs stage-a] | |
(query-A input stage-a)) | |
step-B ([:deps step-A] | |
(query-B input stage-a output-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
(comment | |
;; "Usage Example" | |
(facts | |
(attrib-model [["a" "a"] | |
["b"] | |
["b" "c" "a"] | |
["b"]] | |
equal-weights) => {"a" 4/3, "b" 7/3, "c" 1/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
/* | |
RiskManager.java | |
version 1.0 | |
Copyright 2010 Quantisan.com | |
*/ | |
package jforex; | |
import java.math.*; |
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
$ more output/rain/part-00000 | |
doc_id text | |
doc01 A rain shadow is a dry area on the lee back side of a mountainous area. | |
doc02 This sinking, dry air produces a rain shadow, or area in the lee of a mountain with less rain and cloudcover. | |
doc03 A rain shadow is an area of dry land that lies on the leeward (or downwind) side of a mountain. | |
doc04 This is known as the rain shadow effect and is the primary cause of leeward deserts of mountain ranges, such as California's Death Valley. | |
doc05 Two Women. Secrets. A Broken Land. [DVD Australia] |
OlderNewer