View gist:c367566c8f6e905620791b41c1ec74d4
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 rotateList amount initialList = | |
let rec rotate amount myList = | |
if amount = 0 | |
then myList |> List.rev | |
else | |
let newestList = | |
match myList |> List.rev with | |
| h::rest -> | |
let newList = (rest@[h]) |> List.rev |
View FsxBundle.fsx
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.IO | |
type Line = string | |
type Load = string | |
type Lines = Line list | |
type Loads = Load list | |
type Code = Lines | |
type FsxPath = string |
View vscodeAndPaket.sh
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
code () { | |
if [[ $# = 0 ]] | |
then | |
open -a "Visual Studio Code" | |
else | |
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}" | |
open -a "Visual Studio Code" --args "$F" | |
fi | |
} |
View sentiment.fs
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.IO | |
open edu.stanford.nlp.ling | |
open edu.stanford.nlp.neural.rnn | |
open edu.stanford.nlp.sentiment | |
open edu.stanford.nlp.trees | |
open edu.stanford.nlp.util | |
open java.util | |
open edu.stanford.nlp.pipeline |
View BatteryLifeProgram.fs
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
module ProgNet.Program | |
open System | |
open ProgNet.ClimbHill | |
[<EntryPoint>] | |
let main argv = | |
let printTitle title = | |
printfn "" |
View FsCheckShuffle.fs
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 FsCheck | |
let newDeck = | |
[ for r in [1..14] do | |
yield ("C",r) | |
yield ("H",r) | |
yield ("D",r) | |
yield ("S",r) ] | |
let genFullShuffledDeck = | |
gen |
View HandGen.fs
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 genHand : Gen<Hand> = | |
let deck = | |
gen { | |
let! seed = Gen.choose (0, 100000) | |
let deck = shuffle newDeck seed | |
return deck } | |
gen { | |
let! (ShuffledDeck d) = deck | |
let hand = |
View Time.fsx
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 time countN label f = | |
let stopwatch = System.Diagnostics.Stopwatch() | |
System.GC.Collect() | |
printfn "Started" | |
let getGcStats() = | |
let gen0 = System.GC.CollectionCount(0) | |
let gen1 = System.GC.CollectionCount(1) | |
let gen2 = System.GC.CollectionCount(2) |
View films.fsx
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 films :list<string*int64> = | |
[ ("Inside Out", 851458049L) | |
("Star Wars Episode III: Revenge of the Sith", 848754768L) | |
("Spectre", 837191062L) | |
("Transformers: Revenge of the Fallen", 836303693L) | |
("The Twilight Saga: Breaking Dawn – Part 2", 829746820L) | |
("Inception", 825532764L) | |
("Spider-Man", 821708551L) | |
("Independence Day", 817400891L) | |
("The Hobbit: An Unexpected Journey", 1021103568L) |
View range.fsx
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 (..) (start:int) (limit:int) = | |
let sequence = [start..limit] | |
let decapitate h t = | |
if t = List.empty | |
then [ h ] | |
else t |> List.rev | |
let reversed = | |
match sequence with |
NewerOlder