(maybe-install-and-require 'gist)
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 battleships.demo) | |
;; This is an example of how to create a player to submit to the server. | |
;; The entire namespace is submitted to the server. | |
;; You submit the file using the submit function in the client namespace. | |
(defn- random-coord | |
"Generates a random valid coordinate." | |
[] | |
(let [rows ["A" "B" "C" "D" "E" "F" "G" "H" "I" "J"] |
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
[ch.qos.logback/logback-classic "1.0.0" :exclusions [[org.cloudhoist/pallet] [org.jclouds/jclouds-allblobstore] [org.jclouds/jclouds-allcompute] [org.jclouds/jclouds-compute] [org.jclouds/jclouds-blobstore] [org.jclouds.driver/jclouds-slf4j] [org.jclouds.driver/jclouds-jsch] [org.jclouds.labs/greenqloud-compute]]] | |
[ch.qos.logback/logback-core "1.0.0" :exclusions [[org.cloudhoist/pallet] [org.jclouds/jclouds-allblobstore] [org.jclouds/jclouds-allcompute] [org.jclouds/jclouds-compute] [org.jclouds/jclouds-blobstore] [org.jclouds.driver/jclouds-slf4j] [org.jclouds.driver/jclouds-jsch] [org.jclouds.labs/greenqloud-compute]]] | |
[org.clojure/clojure "1.4.0" :exclusions [[org.cloudhoist/pallet] [org.jclouds/jclouds-allblobstore] [org.jclouds/jclouds-allcompute] [org.jclouds/jclouds-compute] [org.jclouds/jclouds-blobstore] [org.jclouds.driver/jclouds-slf4j] [org.jclouds.driver/jclouds-jsch] [org.jclouds.labs/greenqloud-compute]]] | |
[org.clojure/data.xml "0.0.6" :exclusions [[org.cloudhoist/pallet] [org.jclouds/jclouds |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
"property" "annual_emissions" "normalised_cost" "monthly_cost" "Gas" "Electrical" | |
"foo" 9.48120598985868 3.32516229028219 23.4645618950913 0 9.48120598985868 | |
"bar" 13.9329659660887 4.7563711817271 32.8744521510371 1.06302263189102 12.8699433341977 | |
"baz" 14.8021361709446 5.19127050544977 30.8015383323353 0 14.8021361709446 |
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
(require 'package) | |
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") | |
("marmalade" . "http://marmalade-repo.org/packages/") | |
("melpa" . "http://melpa.milkbox.net/packages/"))) | |
;; This means we prefer things from ~/.emacs.d/elpa over the standard packages. | |
(package-initialize) | |
;; This bootstraps us if we don't have anything | |
(when (not package-archive-contents) |
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
;; as opposed to https://github.com/clj-time/clj-time/blob/master/src/clj_time/format.clj#L149-L158 | |
(defn parse-exception-flow-control | |
"Returns a DateTime instance in the UTC time zone obtained by parsing the | |
given string according to the given formatter." | |
([^String s] | |
(first | |
(for [f (vals formatters) | |
:let [d (try (parse f s) (catch Exception _ nil))] | |
:when d] d)))) |
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
----------- DATASETS ------------- | |
-- Divide-- | |
curl -v -H 'Content-Type: application/json' -u <username>:<password> -X POST --data "{\"entity_id\":\"9ac7f5635832d843dda594f58525239263ffdd37\",\"operation\":\"divide\", \"name\": \"systemEfficiencyOverall\", \"members\": [\"interpolatedHeatConsumption-b4f0c7e2b15ba9636f3fb08379cc4b3798a226bb\", \"interpolatedElectricityConsumption-268e93a5249c24482ac1519b77f6a45f36a6231d\"]}" http://www.getembed.com/4/entities/9ac7f5635832d843dda594f58525239263ffdd37/datasets/ | |
-- Subtract -- | |
curl -v -H 'Content-Type: application/json' -u <username>:<password> -X POST --data "{\"entity_id\":\"9ac7f5635832d843dda594f58525239263ffdd37\",\"operation\":\"subtract\", \"name\": \"cop-subtraction\", \"members\": [\"interpolatedElectricityConsumption-268e93a5249c24482ac1519b77f6a45f36a6231d\", \"interpolatedElectricityConsumption-3aae0fe7ddaa5e400a2cf9580a5e548d9255c70a\", \"interpolatedElectricityConsumption-122b4bf8dfa66cbf8f321f2d03c4d73f924bb719\"]}" http://www.getembed.com/4/enti |
This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.
I hereby claim:
- I am otfrom on github.
- I am otfrom (https://keybase.io/otfrom) on keybase.
- I have a public key whose fingerprint is 530E 1B82 4511 B1F9 B7A5 D21E 4458 A97B 2FE3 EE19
To claim this, I am signing this object:
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 otfrom.copper | |
(:require [clojure.core.async :as a])) | |
(def tenner (a/chan)) | |
(def mten (a/mult tenner)) | |
(def t1 (a/tap mten (a/chan))) | |
(def t2 (a/tap mten (a/chan))) |
OlderNewer