Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Dixon jamessdixon

View GitHub Profile
@jamessdixon
jamessdixon / DixonTraverseCensusData
Created Aug 10, 2014
Traverse Census Data using F#
View DixonTraverseCensusData
#r "../packages/FSharp.Data.2.0.9/lib/portable-net40+sl5+wp8+win8/FSharp.Data.dll"
open FSharp.Data
type censusDataContext = CsvProvider<"https://portalvhdspgzl51prtcpfj.blob.core.windows.net/censuschicken/AK.TXT">
type stateCodeContext = CsvProvider<"https://portalvhdspgzl51prtcpfj.blob.core.windows.net/censuschicken/states.csv">
let stateCodes = stateCodeContext.Load("https://portalvhdspgzl51prtcpfj.blob.core.windows.net/censuschicken/states.csv");
let stopwatch = new System.Diagnostics.Stopwatch()
@jamessdixon
jamessdixon / Dream Cheeky Thunder Conrtoller
Created Aug 20, 2014
Control the Dream Cheeky Thunder via code.
View Dream Cheeky Thunder Conrtoller
namespace ChickenSoftware.WeaponSystems
open System
open System.Threading
open UsbLibrary
type public MissileLauncher() =
let usbPort = new UsbHidPort()
let handle = new IntPtr()
let mutable devicePresent = false
@jamessdixon
jamessdixon / gist:f81b230d91c3f500ae14
Created Sep 15, 2014
Consume an Azure ML API (Request/Response) using F#
View gist:f81b230d91c3f500ae14
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll"
#r @"..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll"
open System
open System.Net.Http
open System.Net.Http.Headers
open System.Net.Http.Formatting
open System.Collections.Generic
@jamessdixon
jamessdixon / gist:0a6719f3ba20a24a5999
Created Oct 14, 2014
Parsing Microsoft MVP Page and Uploading Photo to Sky Biometry
View gist:0a6719f3ba20a24a5999
#r "../packages/FSharp.Data.2.0.15/lib/net40/FSharp.Data.dll"
open System
open System.IO
open System.Net
open System.Text
open FSharp.Data
open System.Threading
open System.Text.RegularExpressions
@jamessdixon
jamessdixon / IBMWatsonLanguageTranslationUsingFSharp
Created Nov 23, 2014
Consuming IBM's Watson Language Translation Service Using F#
View IBMWatsonLanguageTranslationUsingFSharp
//Make sure you install WebApi.Client via Nuget
//install-package Microsoft.AspNet.WebApi.Client
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll"
#r @"..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll"
open System
open System.Net.Http
open System.Net.Http.Headers
open System.Net.Http.Formatting
@jamessdixon
jamessdixon / IBMWatsonQAUsingFSharp
Created Nov 23, 2014
Consuming IBM's Watson QA Service Using F#
View IBMWatsonQAUsingFSharp
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll"
#r @"..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll"
#r @"..\packages\FSharp.Data.2.1.0\lib\net40\FSharp.Data.dll"
open System
open FSharp.Data
open System.Net.Http
open System.Net.Http.Headers
open System.Net.Http.Formatting
open System.Collections.Generic
@jamessdixon
jamessdixon / gist:bffa8b1c2c3dc806dc41
Created Dec 17, 2014
DocumentDB walk-through using F#
View gist:bffa8b1c2c3dc806dc41
#r "../packages/Microsoft.Azure.Documents.Client.0.9.1-preview/lib/net40/Microsoft.Azure.Documents.Client.dll"
#r "../packages/Newtonsoft.Json.4.5.11/lib/net40/Newtonsoft.Json.dll"
open System
open Microsoft.Azure.Documents
open Microsoft.Azure.Documents.Client
open Microsoft.Azure.Documents.Linq
let endpointUrl = "yourEndpoint"
@jamessdixon
jamessdixon / ScrapingWakeCountyTaxSite
Created Feb 12, 2015
Scraping Wake County Tax Site Using F#
View ScrapingWakeCountyTaxSite
#r "../packages/FSharp.Data.2.1.1/lib/net40/FSharp.Data.dll"
open System.IO
open FSharp.Data
type context = HtmlProvider<"../data/RealEstateSample.html">
type houseValuation = {addressOne:string; addressTwo:string; addressThree:string; assessedValue:string}
let createUri(id: int) =
"http://services.wakegov.com/realestate/Account.asp?id=" + id.ToString("D7")
@jamessdixon
jamessdixon / ScrapingWCPSSSchoolAssignment
Last active Aug 29, 2015
Scraping WCPSS School Assignment
View ScrapingWCPSSSchoolAssignment
#r "../packages/FSharp.Data.2.1.1/lib/net40/FSharp.Data.dll"
open System.Net
open System.Text
open FSharp.Data
type context = HtmlProvider<"../data/HouseSearchSample01.html">
type context' = HtmlProvider<"../data/HouseSearchSample02.html">
type SearchCriteria = {streetTemplateValue:string;
@jamessdixon
jamessdixon / CombineWCTandWCPSSScraping
Created Feb 15, 2015
Combining Scraping Wake County Tax and WCPSS School Assignment
View CombineWCTandWCPSSScraping
#r "../packages/FSharp.Data.2.1.1/lib/net40/FSharp.Data.dll"
#r "../packages/Microsoft.Azure.Documents.Client.0.9.2-preview/lib/net40/Microsoft.Azure.Documents.Client.dll"
#r "../packages/Newtonsoft.Json.4.5.11/lib/net40/Newtonsoft.Json.dll"
#load "SchoolAssignments.fsx"
open System
open System.IO
open FSharp.Data
open System.Linq