This file contains 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.Diagnostics | |
let inline (|LessThan|_|) n = function | |
| x when x < n -> Some() | |
| _ -> None | |
let rec cc amount coins = | |
match amount, coins with | |
| 0, _ -> 1 |
This file contains 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 columnNum = | |
let charValues = | |
['A'..'Z'] | |
|> Seq.mapi (fun i c -> c, i + 1) | |
|> map | |
fun (code: string) -> | |
(Seq.toList code, (0,-1)) | |
||> List.foldBack(fun v (depth, total) -> depth + 1, total + (pown 26 depth * charValues.[v])) | |
|> snd |
This file contains 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
#I @"C:\Bib\Projects" | |
#load @"Lib\Charting.fsx" | |
#r @"FSharp.Data\bin\FSharp.Data.dll" | |
open FSharp.Charting | |
open FSharp.Data | |
type Runs = CsvProvider<"""C:\Users\dgrenier\Desktop\race_data.csv"""> | |
query { |
This file contains 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 |
This file contains 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 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 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 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 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 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""" |