Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Westcott manofstick

  • Kaiser Trading Group
  • Melbourne, Australia
View GitHub Profile
View 5360c.fs
open System
open System.Diagnostics
let getNextRandom () =
let r = Random ()
let rec getNext m =
match r.Next () with
| n when m |> Map.containsKey n -> getNext m
| n -> n
getNext
View 5360b.fs
open System
open System.Drawing
open System.Diagnostics
let colours = [
"Transparent", Color.Transparent
"AliceBlue", Color.AliceBlue
"AntiqueWhite", Color.AntiqueWhite
"Aqua", Color.Aqua
"Aquamarine", Color.Aquamarine
View 5360.fs
open System
type KeyStruct(_1':int, _2':int, _3':int) = struct
member this._1 = _1'
member this._2 = _2'
member this._3 = _3'
end
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct
member this._1 = _1'
View 5307.fs
type KeyStruct(_1':int, _2':int, _3':int) = struct
member this._1 = _1'
member this._2 = _2'
member this._3 = _3'
end
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct
member this._1 = _1'
member this._2 = _2'
member this._3 = _3'
View 513_c_comp.fs
module Program
open Perf
open System
open System.Diagnostics
module Tortoise =
let test () =
let today = DateTime.Now
let tomorrow = today.AddDays 1.0
View 513_b_comp.fs
module Program
open Perf
open System
open System.Diagnostics
[<EntryPoint>]
let main argv =
printfn "%s" Id.Name
View 513_a_comp.fs
module Program
open Perf
open System
open System.Diagnostics
open System.Collections.Generic
type StructureInt =
struct
View 930_comp.fs
open Perf
type EnumA = A0 = 0 | A1 = 1 | A2 = 2 | A3 = 3 | A4 = 4 | A5 = 5 | A6 = 0x7
let getAnEnum i = match i &&& 7 with 0 -> EnumA.A0 | 1 -> EnumA.A1 | 2 -> EnumA.A2 | 3 -> EnumA.A3 | 4 -> EnumA.A4 | 5 -> EnumA.A5 | _ -> EnumA.A6
type R = {
GroupByKey : EnumA
OtherData : float
}
View 549_comp2.fs
module Program
open System.Diagnostics
open Perf
type Key1 =
struct
val A : int
new (a)= { A = a }
end
View 549_comp.fs
open Perf
open System
open System.Diagnostics
open System.IO
open System.Collections.Generic
let inline run<'key when 'key : equality> (comparer:IComparer<'key>) (createKey:int -> int -> 'key) =
let g_maxSize = 4480
let fileSizes = [ 1 .. 99 ]