I hereby claim:
- I am davidkellis on github.
- I am davidkellis (https://keybase.io/davidkellis) on keybase.
- I have a public key whose fingerprint is 72B1 CBAA 4D75 C002 7400 3477 9262 2B71 FB8A D192
To claim this, I am signing this object:
> open Archer.Collections;; | |
> let c = new LruCache<int,string>(3);; | |
val c : LruCache<int,string> | |
> c.Add(5, "a");; | |
val it : unit = () | |
> c.Add(6, "b");; | |
val it : unit = () | |
> c.Add(7, "c");; | |
val it : unit = () |
I hereby claim:
To claim this, I am signing this object:
open System | |
module Decimal = | |
let Zero = 0M | |
let One = 1M | |
let ceil (d: decimal): decimal = System.Math.Ceiling(d) | |
let floor (d: decimal): decimal = System.Math.Floor(d) |
require 'time' | |
require 'pp' | |
require 'bigdecimal' | |
# This implementation is based on http://en.wikipedia.org/wiki/Quantiles#Estimating_the_quantiles_of_a_population | |
# For additional information, see: | |
# http://www.stanford.edu/class/archive/anthsci/anthsci192/anthsci192.1064/handouts/calculating%20percentiles.pdf | |
# http://en.wikipedia.org/wiki/Percentile | |
# http://www.mathworks.com/help/stats/quantiles-and-percentiles.html | |
# |
open System | |
let fromIEnumerator (xs: System.Collections.Generic.IEnumerator<'x>): seq<'x> = | |
seq { | |
while xs.MoveNext() do | |
yield xs.Current | |
} | |
let fromIEnumerable (xs: System.Collections.Generic.IEnumerable<'x>): seq<'x> = fromIEnumerator (xs.GetEnumerator()) |
1. type Foo = struct { X | Int, Float, Array[X]} | |
2. type Foo = struct {X ; Int, Float, Array[X]} | |
3. type Foo = Struct[X; Int, Float, Array[X]] | |
4. type Foo = struct [X; Int, Float, Array[X]] | |
1. type Foo = struct { | |
X | | |
Int, | |
Float, | |
Array[X] |
brew install apple-gcc42 openssl libyaml libffi | |
xcode-select --install | |
export CC=/usr/local/bin/gcc-4.2 | |
export CFLAGS='-g -O2' | |
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` | |
export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` | |
# I had to edit the svn repo URL in /usr/local/Cellar/ruby-build/20160913/share/ruby-build/1.8.7-p375 and change the URL from http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7 to https://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7 | |
rbenv install 1.8.7-p375 |
// I found the following implementation (verbatim) of Fibers in Go at https://play.golang.org/p/NSIlZ327sC | |
// I'm capturing it here for future reference. | |
package main | |
import ( | |
"errors" | |
"fmt" | |
) |
package hashids | |
MinAlphabetLength = 16 | |
SepDiv = 3.5 | |
GuardDiv = 12 | |
DefaultAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" | |
DefaultSeps = "cfhistuCFHISTU" | |
struct Encoder { |
interface Enumerable T for E { | |
fn each(E, T -> Unit) -> Unit | |
} | |
impl Enumerable T for Array T { | |
fn each(array: Array T, f: T -> Unit) -> Unit { ... } | |
} | |
impl Enumerable T for I : Iterator T { | |
fn each(it: I, visit: T -> Unit) = ... | |
} | |
impl Enumerable T for Iterator T { |