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
{ | |
"description": "Plot showing a 30 day rolling average with raw values in the background.", | |
"width": 800, | |
"height": 300, | |
"data": { | |
"values": [ | |
{ | |
"amount": 3428.56, | |
"date": {"month": 11, "year": 2017, "date": 13}, | |
"rolling-mean": 26339.3075 |
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 heatmap | |
(:require [nextjournal.clerk :as clerk] | |
[aerial.hanami.common :as hc] | |
[aerial.hanami.templates :as ht]) | |
) | |
(defn heat-map-graph [title data] | |
(hc/xform ht/heatmap-chart | |
:TITLE title | |
:DATA data |
We can't make this file beautiful and searchable because it's too large.
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
"index","a","b","sigma" | |
"1",154.463029424446,0.92772083455486,4.77531500115427 | |
"2",155.029235091832,0.865009228189656,5.14265740434293 | |
"3",154.749386483007,0.944318746661559,4.95830093670106 | |
"4",154.882538995558,0.913085622253422,5.21154658941009 | |
"5",154.160127355332,0.932373407986481,5.39321059734968 | |
"6",154.720477056833,0.910420398843487,5.04069697859452 | |
"7",155.060590305595,0.819713086692938,5.44063312830036 | |
"8",154.447996257924,0.849465851550294,5.26068685571713 | |
"9",154.698811513831,0.919012523494473,5.14835069594044 |
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 coin-toss | |
(:require [clojure.test :as t])) | |
(defn expt | |
"x to the yth power" [x y] | |
(apply * (repeat y x))) | |
(defn sum-of-geometric-series | |
"a(1-r^n )/(1-r)" [a r n] |
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 one-to-nine.core | |
(:require [clojure.math.combinatorics :as combo])) | |
(defn all-possible-boards | |
"What are all the possible combinations of the set of numbers from 1 to x." | |
[x] | |
(combo/permutations (range 1 (inc x)))) | |
(defn horiz-vertical-coords | |
"Index for array for the rows and columns of a board with width * height squares" |
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 euler.p549-divisibility-of-factorials-v4) | |
(defn to-the-power [factor exp] | |
(reduce * 1 (repeat exp factor))) | |
(defn a-prime-factor-for-all-to | |
([max-n] | |
(loop [pfs (apply vector-of :int (range 0 (inc max-n))) | |
n 2] | |
(if (<= (to-the-power n 2) max-n) |
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 euler.p549-divisibility-of-factorials-v3) | |
(defn primes | |
([] (primes (iterate inc 2))) | |
([s] | |
(lazy-seq (if (nil? (first s)) | |
nil | |
(cons (first s) | |
(primes |
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
Close |
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
import qualified Data.Text as T | |
import Language.Plutus.Contract hiding (when) | |
import Language.PlutusTx.Prelude | |
import Playground.Contract | |
-- | A 'Contract' that logs a message. | |
hello :: Contract BlockchainActions T.Text () | |
hello = logInfo @String "Hello, world" | |
endpoints :: Contract BlockchainActions T.Text () |
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
module Prettify | |
( | |
-- * Constructors | |
Doc | |
-- * Basic combinators | |
, (<>) | |
, empty | |
, char | |
, text | |
, line |