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 | |
let getLastDirectory (filePath:string) = | |
let lastSlashPosition = filePath.LastIndexOf(char 47) | |
let totalLength = filePath.Length | |
let tokenLength = totalLength - lastSlashPosition - 1 | |
filePath.Substring(lastSlashPosition+1,tokenLength) | |
let subDirectoryInfos (path:string) = | |
let baseDirectoryInfo = System.IO.DirectoryInfo(path) |
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 System.Drawing | |
type PictureFile = {FileName:string; NumberOfColumns:int; NumberOfRows:int} | |
let createTargetDirectory (fileName:string) = | |
let targetDirectory = "//Users//jamesdixon//Desktop//Images//" + fileName | |
let directoryinfo = new DirectoryInfo(targetDirectory) | |
match directoryinfo.Exists with |
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 System.Collections.Generic | |
let path = @"C:\Git\..." | |
let folderInfo = System.IO.DirectoryInfo(path) | |
let files = folderInfo.GetFiles("*.cs") | |
let parseClass (values: IEnumerable<string>) = | |
let className = |
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
public sealed partial class MainPage : Page | |
{ | |
GpioPin _pin = null; | |
Int32 _pinValue = 0; | |
public MainPage() | |
{ | |
this.InitializeComponent(); | |
Loaded += MainPage_Loaded; | |
} |
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
type Customer = {Name:string; Email:string} | |
type Input = {Customer:Customer; MaxNameLength:int} | |
type Result<'t> = | |
| Good of 't | |
| Bad of string | |
let bind switchFunction = | |
fun twoTrackInput -> | |
match twoTrackInput with |
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 "../packages/NLog.4.4.1/lib/net45/NLog.dll" | |
open NLog | |
let config = new Config.LoggingConfiguration() | |
let target = new Targets.ColoredConsoleTarget("ConsoleTarget") | |
config.AddTarget(target) | |
let rule = new Config.LoggingRule() |
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 | |
let getNewDate dayOfYear = | |
["Jan";"Feb";"Mar";"Apr";"May";"Jun";"Sep";"Oct";"Nov";"Dec"] | |
|> Seq.mapi(fun i m -> if i%2=0 then m, [1..36] else m, [1..37]) | |
|> Seq.map(fun (m,ad) -> ad |> Seq.map(fun d -> m,d)) | |
|> Seq.collect(fun a -> a) | |
|> Seq.mapi(fun i d -> i, d ) | |
|> Seq.tryFind(fun (i,d) -> i = dayOfYear) |
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 "WindowsBase.dll" | |
#r "System.Net.Http.dll" | |
#r "PresentationCore.dll" | |
#r "../packages/FSharp.Data.2.3.2/lib/net40/FSharp.Data.dll" | |
open System | |
open System.IO | |
open System.Web | |
open System.Net |
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
the.counted <- read.csv("./Data/TheCountedWithGeo.csv") | |
summary(the.counted) | |
#http://stackoverflow.com/questions/13420700/r-ggplot2-ggmap-concentric-circles-as-points | |
library(ggplot2) | |
library(maps) | |
all.states <- map_data("state") | |
plot <- ggplot() | |
plot <- plot + geom_polygon(data=all.states, aes(x=long, y=lat, group = group), |
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 "../packages/FSharp.Data.2.2.2/lib/net40/FSharp.Data.dll" | |
open System | |
open System.IO | |
open System.Text | |
open FSharp.Data | |
[<Literal>] | |
let geoLocationSample = "..\Data\TAMUHttpGet.json" | |
type GeoLocationServiceContext = JsonProvider<geoLocationSample> |