stack is required. On MacOS it can be installed via brew install stack.
Assuming there is an affected Garmin activity that you want to remove HR data from.
| target hw1 | |
| sources | |
| hw1.mlb | |
| hw1.main.sml | |
| end | |
| option compiler = mlton | |
| option output = hw1 | |
| end |
Various blog posts related to Nix and NixOS
configuration.nix example.| instance FromJSON Database where | |
| - parseJSON (Object o) = Database | |
| - <$> o .: "id" | |
| - <*> o .: "_rid" | |
| - <*> o .: "_ts" | |
| - <*> o .: "_self" | |
| - <*> o .: "_etag" | |
| - <*> o .: "_colls" | |
| - <*> o .: "_users" | |
| + parseJSON (Object o) = |
| #!/bin/bash | |
| # wow so bash such fast very O(n^2*log(n)^2) | |
| for author in `git log --format='%ae' | sort -u`; do | |
| changes=`git log --author=$author --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 } END { printf "%s ++ / %s --\n",add,subs }'` | |
| commits=`git log --author=$author --oneline | wc -l` | |
| echo "$author: $commits commits / $changes" | |
| done | sort -rn -k2 |
| open System | |
| open System.Net | |
| type Stock(symbol : string) = class | |
| let url = | |
| "http://download.finance.yahoo.com/d/quotes.csv?s=" + symbol + "&f=sl1d1t1c1ohgv&e=.csv" | |
| let mutable _symbol = String.Empty | |
| let mutable _current = 0.0 | |
| let mutable _open = 0.0 |
| What is going on here is creating 2 streams with numbers from 1 to 100000 sorting randomly and finding with grep all lines that each of them contains. All of them, actually. -c flag is a shortcut for `| wc -l`, nothng more. | |
| $> n=100000; time grep -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c | |
| 100000 | |
| grep -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c 148.65s user 0.28s system 98% cpu 2:31.89 total | |
| $> n=100000; time grep -xF -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c | |
| 100000 | |
| grep -xF -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c 0.34s user 0.01s system 26% cpu 1.315 total |
| import Control.Monad (($), forM, undefined) | |
| main = forM [] $ undefined |
| Lemma mult_0_r : forall n:nat, | |
| n * 0 = 0. | |
| Proof. | |
| intros n. induction n as [| n']. | |
| (* Case "n = 0". *) | |
| simpl. | |
| reflexivity. | |
| (* Case "n = S n'". *) | |
| simpl. | |
| rewrite -> IHn'. |