Skip to content

Instantly share code, notes, and snippets.

@MartinBodocky
MartinBodocky / farming.fsx
Created April 26, 2016 09:49
CenterSpace NMath Linear Programming example in F#
open System
open System.IO
#r @"C:\Program Files (x86)\CenterSpace\NMath 6.2\Assemblies\NMath.dll"
open CenterSpace.NMath
open CenterSpace.NMath.Core
open CenterSpace.NMath.Analysis
// A farmer has 640 acres of farmland. It can be planted with wheat, barley, corn or a
@MartinBodocky
MartinBodocky / exampleElastic.fsx
Created March 7, 2016 15:16
ElasticSearch and F#
#r "../packages/Elasticsearch.Net.2.0.4/lib/net46/Elasticsearch.Net.dll"
#r "../packages/NEST.2.0.4/lib/net46/Nest.dll"
#r "../packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll"
open System
open System.Linq
open Nest
module Utils =
open Microsoft.FSharp.Quotations
@MartinBodocky
MartinBodocky / neo4jFriends.fsx
Last active February 4, 2019 11:50
F# sample for Neo4j - Friends
#r "../packages/Neo4jClient.1.1.0.28/lib/net45/Neo4jClient.dll"
#r "../packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll"
open System
open System.Collections.Generic
open System.Linq
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Linq.RuntimeHelpers
open System.Linq.Expressions
open System
open Neo4jClient
open System.Linq
[<CLIMutable>]
type Person = { Name:string; Twitter:string }
[<CLIMutable>]
type Knows = { How:string }
@MartinBodocky
MartinBodocky / cooking.fsx
Last active October 30, 2015 18:31
Prototyping for What's Cooking Kaggle competition
// link to competition: https://www.kaggle.com/c/whats-cooking/
//reference deelde with fsharp charting
#r "../packages/Deedle.1.2.4/lib/net40/Deedle.dll"
#r "../packages/FSharp.Charting.0.90.12/lib/net40/FSharp.Charting.dll"
#I "../packages/FSharp.Charting.0.90.12"
#load "FSharp.Charting.fsx"
#r "../packages/Newtonsoft.Json.7.0.1/lib/net45/Newtonsoft.Json.dll"
open System
@MartinBodocky
MartinBodocky / SecomPCA.fsx
Created October 18, 2015 15:38
PCA analysis on more real data with Accord.Net with Deedle and FSharp.Charting.
// data from http://archive.ics.uci.edu/ml/machine-learning-databases/secom/
// reference accord framework
#r "../packages/Accord.3.0.2/lib/net45/Accord.dll"
#r "../packages/Accord.Controls.3.0.2/lib/net45/Accord.Controls.dll"
#r "../packages/Accord.IO.3.0.2/lib/net45/Accord.IO.dll"
#r "../packages/Accord.Math.3.0.2/lib/net45/Accord.Math.dll"
#r "../packages/Accord.Statistics.3.0.2/lib/net45/Accord.Statistics.dll"
//reference deelde with fsharp charting
#r "../packages/Deedle.1.2.4/lib/net40/Deedle.dll"
#r "../packages/FSharp.Charting.0.90.12/lib/net40/FSharp.Charting.dll"
@MartinBodocky
MartinBodocky / PCA.fsx
Last active October 4, 2016 01:21
PCA with Accord.Net and FSharp.Charting
// Inspired by http://arxiv.org/abs/1210.7463
// reference accord framework
#r "../packages/Accord.3.0.2/lib/net45/Accord.dll"
#r "../packages/Accord.Controls.3.0.2/lib/net45/Accord.Controls.dll"
#r "../packages/Accord.IO.3.0.2/lib/net45/Accord.IO.dll"
#r "../packages/Accord.Math.3.0.2/lib/net45/Accord.Math.dll"
#r "../packages/Accord.Statistics.3.0.2/lib/net45/Accord.Statistics.dll"
//reference deelde with fsharp charting
@MartinBodocky
MartinBodocky / GetNugetPackagesLocal.ps1
Last active September 29, 2015 09:54
The script will be download most used Nuget packages, or just those which are in packages.config file.
# --- settings ---
$feedUrlBase = "http://go.microsoft.com/fwlink/?LinkID=206669"
# the rest will be params when converting to funclet
$forceLatest = $false
$latest = $true
$overwrite = $false
$top = 500 #use $top = $null to grab all
$destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocalNew"
$packageFile =(Resolve-Path ".\").Path + "\packages.config"
@MartinBodocky
MartinBodocky / RefreshNugetPackages.ps1
Created September 22, 2015 11:17
The script will reinstall all nuget packages installed in your project.
# Reinstall Nuget Packages into project
$packageFile =(Resolve-Path ".\").Path + "\packages.config"
if(Test-Path -Path $packageFile)
{
# get only packages mentioned inside packages config
[xml]$xmlContent = Get-Content $packageFile
# packages
$packages = $xmlContent.SelectNodes("//packages//package")
@MartinBodocky
MartinBodocky / MSMQ_Administration.fs
Last active August 29, 2015 14:17
MSMQ Administration with F#
#I @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\"
#r "System.Messaging.dll"
open System
open System.Messaging
open System.Diagnostics
// create message queue
MessageQueue.Create(@".\private$\r_default-queue")