I hereby claim:
- I am forestbelton on github.
- I am forestbelton (https://keybase.io/forestbelton) on keybase.
- I have a public key ASB7l0uda7N7t_GLdLbqcuk7FEIn5nZ1CqS1OEJ3elTQhQo
To claim this, I am signing this object:
| #include <math.h> | |
| double my_log(double x) { | |
| static const double log2 = 0.693147; | |
| double y, logy; | |
| int n; | |
| // factor x = y * 2^n, where 1 <= y < 2 | |
| // frexp gives us the range 0.5 <= y < 1 |
| start | |
| = (d:die _ { return d })* | |
| number | |
| = [0-9] | |
| nonzero | |
| = [1-9] | |
| diesize |
| Decl "data declaration" | |
| = Data name:TName params:TParam* Equals first:Constructor rest:Alternative* { | |
| return { | |
| name: name, | |
| params: params, | |
| constructors: [first].concat(rest) | |
| }; | |
| } | |
| Data "data keyword" |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| #grid { | |
| line-height: 0; | |
| } | |
| #grid > * { | |
| margin:0; |
| {-# LANGUAGE Rank2Types #-} | |
| {-# LANGUAGE GADTs #-} | |
| import qualified Data.Set as S | |
| import Data.List (intercalate, sort) | |
| data UnaryOp | |
| = Not | |
| deriving (Show) |
I hereby claim:
To claim this, I am signing this object:
| import qualified Data.Map as M | |
| newtype Trie c = Trie { getTrie :: M.Map c (Trie c) } | |
| deriving (Show) | |
| type Word c = [c] | |
| instance Ord c => Monoid (Trie c) where | |
| mempty = Trie M.empty | |
| (Trie t) `mappend` (Trie t') = Trie $ M.unionWith mappend t t' |
| #ifndef CASE_LEXER_H_ | |
| #define CASE_LEXER_H_ | |
| struct lexer; | |
| /** | |
| * A data type which accepts a string of characters and produces a stream of | |
| * tokens based on a set of predefined rules. | |
| */ | |
| typedef struct lexer lexer; |
| #!/usr/bin/bash | |
| set -euxo pipefail | |
| SQLITE=/Volumes/Macintosh\ HD/usr/bin/sqlite3 | |
| XXD=/Volumes/Macintosh\ HD/usr/bin/xxd | |
| GZIP=/Volumes/Macintosh\ HD/usr/bin/gzip | |
| NOTES_DB=NoteStore.sqlite | |
| "${SQLITE}" ${NOTES_DB} 'select quote(zdata) from zicnotedata where zdata is not null' > notes-raw.txt |
| const dataclass = f => function() { | |
| Object.entries(f(...arguments)).forEach(([k, v]) => { | |
| this[k] = v | |
| }) | |
| } | |
| const F = dataclass((x, y) => ({x, y})) | |
| const f = new F(1, 2) | |
| console.log(f instanceof F) // "true" |