Instantly share code, notes, and snippets.

View advent.fsx
module part1 =
let captcha (input:string) =
let len = input.Length
let circular i = i % len
input
|> Seq.toArray
|> Array.fold (fun (index,count) x ->
index + 1,
if x = input.[circular (index + 1)]
View cntk.fsx
// Code for the post http://brandewinder.com/2017/12/23/baby-steps-with-cntk-and-fsharp/
open System
open System.IO
open System.Collections.Generic
Environment.SetEnvironmentVariable("Path",
Environment.GetEnvironmentVariable("Path") + ";" + __SOURCE_DIRECTORY__)
let dependencies = [
View version1.fsx
// C# original: https://github.com/Microsoft/CNTK/blob/master/Examples/TrainingCSharp/Common/LogisticRegression.cs
// I assume CNTK.CPUOnly has been installed via Paket
// required dependencies:
// packages\CNTK.CPUOnly\lib\net45\x64
// packages\CNTK.CPUOnly\support\x64\Dependency
// packages\CNTK.CPUOnly\support\x64\Dependency\Release
// packages\CNTK.CPUOnly\support\x64\Release
// loading native dependencies in a script is a bit annoying,
View notes.md

Reboot meetings, aiming for regularity: alternate monthly, 1 talk, 1 hands-on, 1 breakfast. Tentatively: Aug: hands-on (Slack bot) Sep: rehearsal / teaser for the open fsharp conference Oct: breakfast? Nov: hands-on (F# Notebooks + ML)

Use Github more: we have an organization, https://github.com/sfsharp, let's use it.

Topics / Speakers / Formats

View graph.fsx
(*
Reading out bindings
*)
type Direction =
| Trigger
| In
| Out
type Properties = Map<string,string>
View presentation.md
  • title : Azure Functions
  • description : Introduction to Azure Functions with F#
  • author : Mathias Brandewinder
  • theme : night
  • transition : default

An intro to Azure Functions with F#

View gradient-boosting-1.fsx
// blog post: brandewinder.com/2016/08/06/gradient-boosting-part-1
// https://en.wikipedia.org/wiki/Gradient_boosting#Algorithm
(*
Exploring the dataset
*)
#I "./packages/"
#r "fsharp.data/lib/net40/fsharp.data.dll"
open FSharp.Data
View part1-solved.fsx
open System
open System.IO
let path = @"C:\Users\Mathias\Desktop\day-1-test\day-1\trainingsample.csv"
let data0 = File.ReadAllLines path
let data1 =
data0 |> Array.map (fun line -> line.Split ',')
View evaluation.fsx
let rng = System.Random()
// first interpretation: flip coins,
// and keep only the ones where heads (=0)
// until there is only 1 left.
let rec Strategy1 (rolls:int, choices:int list) =
match choices with
| [] -> failwith "unexpected"
| [x] -> rolls, x // only one result left: done
| _ ->