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
(defn split-at-subsequence [mark input] | |
(when-let [sequence (seq input)] | |
(let [len (count mark) | |
mark-seq (seq mark) | |
partition (partition-all len 1 sequence) | |
step (fn step [pieces] | |
(when pieces | |
(let [[fst rst] (split-with #(not= mark-seq %) pieces) | |
tail (lazy-seq (step (nthnext rst len)))] | |
(if (empty? fst) |
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
;; Una de les formes de trobar bones solucions és trobar bones | |
;; estructures de dades de partida. | |
;; Aquí has de representar tres coses: | |
;; 1. Regles del joc (quina cosa guanya a què) | |
;; 2. Resultats d'una ronda | |
;; 3. Resulatats d'un torneig | |
;; Formes de representar 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
(defn vec-cps | |
[x y k] | |
(k [x y])) | |
(defn dec-cps | |
[x k] | |
(k (dec x))) | |
(defn *-cps | |
[x y k] |
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
(defn crazy-seq [head f] | |
(reify | |
clojure.lang.ISeq | |
(first [_] head) | |
(more [_] (crazy-seq (f head) f)) | |
(next [this] (rest this)) | |
(seq [this] this) | |
(equiv [_ _] false))) | |
(def s (crazy-seq 0 inc)) ; hold head |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;;; Updated to Clojure 1.4 by Baishampayan Ghose <[email protected]> |
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
(defn bfc | |
[program] | |
(let [allowed #{\+ \- \< \> \[ \] \.} | |
src (->> program (filter allowed) | |
(interpose \space) (apply str)) | |
fns (zipmap '(- + < > . ?) (repeatedly gensym))] | |
(letfn [(bfc* [s] | |
(if (vector? s) | |
`(while (not (~(fns '?))) ~@(map bfc* s)) | |
`(~(fns s))))] |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
path { | |
fill: none; | |
stroke: #000; | |
stroke-width: .6px; | |
} |
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
<html> | |
<head> | |
<title>Swimlane using d3.js</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<script type="text/javascript" src="randomData.js"></script> | |
<style> | |
.chart { | |
shape-rendering: crispEdges; | |
} |
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
function histogramChart() { | |
var margin = {top: 0, right: 0, bottom: 20, left: 0}, | |
width = 960, | |
height = 500; | |
var histogram = d3.layout.histogram(), | |
x = d3.scale.ordinal(), | |
y = d3.scale.linear(), | |
xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(6, 0); |
We can't make this file beautiful and searchable because it's too large.
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
Nr,Rmag,e.Rmag,ApDRmag,mumax,Mcz,e.Mcz,MCzml,chi2red,UjMAG,e.UjMAG,BjMAG,e.BjMAG,VjMAG,e.VjMAG,usMAG,e.usMAG,gsMAG,e.gsMAG,rsMAG,e.rsMAG,UbMAG,e.UbMAG,BbMAG,e.BbMAG,VnMAG,e.VbMAG,S280MAG,e.S280MA,W420FE,e.W420FE,W462FE,e.W462FE,W485FD,e.W485FD,W518FE,e.W518FE,W571FS,e.W571FS,W604FE,e.W604FE,W646FD,e.W646FD,W696FE,e.W696FE,W753FE,e.W753FE,W815FS,e.W815FS,W856FD,e.W856FD,W914FD,e.W914FD,W914FE,e.W914FE,UFS,e.UFS,BFS,e.BFS,VFD,e.VFD,RFS,e.RFS,IFD,e.IFD | |
6,24.995,0.097,0.935,24.214,0.832,0.036,1.4,0.64,-17.67,0.14,-17.54,0.25,-17.76,0.25,-17.83,0.14,-17.6,0.25,-17.97,0.25,-17.76,0.14,-17.53,0.25,-17.76,0.25,-18.22,0.17,6.60E-04,3.85E-03,1.27E-02,3.72E-03,1.89E-02,4.48E-03,1.82E-02,3.55E-03,1.47E-02,3.01E-03,1.66E-02,4.09E-03,1.88E-02,5.63E-03,2.46E-02,3.51E-03,2.45E-02,5.24E-03,2.16E-02,2.66E-03,2.44E-02,5.46E-03,3.77E-02,6.10E-03,1.17E-02,1.01E-02,1.87E-02,2.39E-03,1.63E-02,1.29E-03,1.73E-02,1.41E-03,1.65E-02,4.34E-04,2.47E-02,4.83E-03 | |
9,25.013,0.181,-0.135,25.303,0.927,0.122,0.864,0.41,-18.28,0.22,17.86,0.55,-18 |