Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Last active August 29, 2015 14:22
Show Gist options
  • Save bjartwolf/96a7468a0842d266af5f to your computer and use it in GitHub Desktop.
Save bjartwolf/96a7468a0842d266af5f to your computer and use it in GitHub Desktop.
open Microsoft.FSharp.Data.TypeProviders
open System
open RProvider
open RProvider.``base``
open RProvider.``stats``
open RProvider.``graphics``
type dbSchema = SqlDataConnection<"Data Source=SECRETSERVER;Initial Catalog=SECRETDB;User id=SECRETUSERPassword=SECRET">
[<EntryPoint>]
let main argv =
let db = dbSchema.GetDataContext()
let mps = query {
for mp in db.ENTERPRISETABLE do
select mp.SERIALNUMBER
}
let serialNums = mps |> Seq.map Int64.Parse |> Seq.toList
let prime:Int64 = 13L
let modulusids = serialNums |> List.map(fun f -> f % prime) |> List.map float
R.hist(modulusids) |> ignore
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment