Skip to content

Instantly share code, notes, and snippets.

View davidkellis's full-sized avatar

David Ellis davidkellis

View GitHub Profile
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]
@davidkellis
davidkellis / gist:b58535a0f230e1a550c8
Last active August 29, 2015 14:14
sequence expression headache
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())
@davidkellis
davidkellis / vms_analysis.rb
Created October 14, 2014 14:07
VMS Analysis
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
#
@davidkellis
davidkellis / vms_analysis.fsx
Last active August 29, 2015 14:07
VMS Analysis
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)

Keybase proof

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 = ()