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
| let (|ModZero|_|) d v = | |
| match v % d with | |
| | 0 -> Some () | |
| | _ -> None | |
| let fizzBuzz = function | |
| | ModZero 15 -> printfn "fizzbuzz" | |
| | ModZero 3 -> printfn "fizz" | |
| | ModZero 5 -> printfn "buzz" | |
| | i -> printfn "%i" i |
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
| let rec (|Run|_|) n c = | |
| let rec identicals n = function | |
| | rest when n = 0 -> Some rest | |
| | a :: rest when a = c && n > 0 -> identicals (n - 1) rest | |
| | _ -> None | |
| identicals n |
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
| #r @"C:\Bib\Projects\FSharp.Data\src\bin\Release\FSharp.Data.dll" | |
| open FSharp.Data | |
| let data = WorldBankData.GetDataContext() | |
| let ``Sergey's data`` = | |
| [ | |
| "United States", 11823 | |
| "United Kingdom", 4256 |
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
| #load @"C:\Bib\Projects\FSharpChart\F#\scripts\FSharpChart.fsx" | |
| #r @"C:\Bib\Projects\FSharp.Data\src\bin\Release\FSharp.Data.dll" | |
| open FSharp.Data | |
| open MSDN.FSharp.Charting | |
| type Types = CsvProvider<"""C:\Users\dgrenier\Desktop\race_data.csv"""> | |
| let data = Types.Load """C:\Users\dgrenier\Desktop\race_data.csv""" |
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
| let transpose3 = function | |
| | [||] -> [||] | |
| | a -> | |
| Array.maxBy Array.length a | |
| |> Array.Parallel.mapi (fun i _ -> | |
| Array.filter (fun js -> Array.length js > i) a | |
| |> Array.map (fun sub -> sub.[i]) | |
| ) |
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
| let genString = | |
| let rand = System.Random() | |
| let chars = [|'A'..'Z'|] |> Array.append [|'a'..'z'|] | |
| fun n -> System.String (Array.init n (fun _ -> chars.[rand.Next(0, chars.Length)])) | |
| genString 10 |
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
| let inline itemsProp arg = (^a : (member Items : ItemCollection) arg) | |
| let inline withBackground brush e = (^a : (member set_Background : Brush -> unit) (e, brush)) |
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
| Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0 and add a new dword value named UseSolutionNavigatorGraphProvider with a value of 0 |
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
| #r @"C:\Projects\FSharpx\Build\FSharpx.Core.dll" | |
| #r @"C:\Projects\FSharpx\Build\FSharpx.Collections.Experimental.dll" | |
| #r @"C:\Projects\ExtCore\ExtCore\bin\release\ExtCore.dll" | |
| #r @"C:\Users\dgrenier\desktop\System.Collections.Immutable.dll" | |
| open System | |
| module Queue = FSharpx.Collections.Queue | |
| module IntMap = FSharpx.Collections.Experimental.IntMap | |
| module HashMap = ExtCore.Collections.HashMap |
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
| cmd.exe /k echo on & pushd "%1" & "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat" x64 | |
| HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2012\command |