This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== MyItem 1 == | |
...some content... | |
Total: 10 | |
Success | |
== MyItem 2 == | |
...some content... | |
Total: 2 | |
Failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Threading | |
open System.IO | |
open Microsoft.FSharp.Control.WebExtensions | |
type Agent<'T> = MailboxProcessor<'T> | |
type SingleAgent<'T> = | |
| Set of 'T | |
| Get of AsyncReplyChannel<List<'T>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if INTERACTIVE | |
#else | |
module LogReader | |
#endif | |
//Log file parser for log4Net files. | |
open System | |
open System.IO | |
type CollectData = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module String = let notNullOrEmpty = not << System.String.IsNullOrEmpty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Threading | |
/// Async timer to perform actions | |
let timer interval scheduledAction = async { | |
do! interval |> Async.Sleep | |
scheduledAction() | |
} | |
/// Add action to timer, return cancellation-token to cancel the action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module BtcTesting | |
open System | |
open System.Security.Cryptography | |
/// https://en.bitcoin.it/wiki/Base58Check_encoding | |
let base58encode (hash:byte[]) = | |
let code_string = ['1'..'9']@['A'..'H']@['J'..'N']@['P'..'Z']@['a'..'k']@['m'..'z'] |> List.toArray | |
let data = hash |> Array.toList | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Using Azure Table Storage with WindowsAzure.Storage | |
open Microsoft.WindowsAzure.Storage | |
open Microsoft.WindowsAzure.Storage.Table | |
open Microsoft.WindowsAzure.ServiceRuntime | |
type Person(partitionKey, rowKey, name) = | |
inherit TableEntity(partitionKey, rowKey) | |
new(name) = Person("defaultPartition", System.Guid.NewGuid().ToString(), name) | |
new() = Person("") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From NuGet: Sparc.TagCloud | |
#if INTERACTIVE | |
#r @"..\packages\Sparc.TagCloud.0.0.1\lib\net40\Sparc.TagCloud.dll" | |
#else | |
module MyTagCloud | |
#endif | |
open System.IO | |
open Sparc.TagCloud | |
let analyzer = new TagCloudAnalyzer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Microsoft Kinect Body Basics with Kinect SDK 2.0 and F# | |
#if INTERACTIVE | |
#r @"..\packages\Microsoft.Kinect.2.0.1410.19000\lib\net45\Microsoft.Kinect.dll" | |
#else | |
module Kinect20 | |
#endif | |
open Microsoft.Kinect | |
open System.Collections.Generic | |
let bodyFrameReader = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// (Infinite) list of note-frequency -pairs | |
let tones = | |
let bass = 55.0 | |
let octave = ["A"; "A#"; "B"; "C"; "C#"; "D"; "D#"; "E"; "F"; "F#"; "G"; "G#"] | |
let notes = seq { while true do yield! octave } | |
let frequency = bass |> Seq.unfold (fun x -> Some (x, x*System.Math.Pow(2.0, 1.0 / 12.0))) | |
Seq.zip notes frequency | |
//let ``guitar open A`` = tones |> Seq.nth 24 // val it : float * string = (220.0, "A") |