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 / 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 / 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
@jamessdixon
jamessdixon / WCPSSScoresAndAssignmentCrossWalk
Created Feb 27, 2015
Crosswalk table for WCPSS Scores and WCPSS Assignment Pyramid
View WCPSSScoresAndAssignmentCrossWalk
#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"
#r "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5.1/System.Net.Http.dll"
open System
open System.IO
open FSharp.Data
open System.Linq
open Newtonsoft.Json
@jamessdixon
jamessdixon / WCPSSScoresAndTaxBase
Created Feb 28, 2015
WCPSS Scores and Tax Base Analysis Using R
View WCPSSScoresAndTaxBase
#Create Wake County Scores From NC State Scores
WakeCountyScores <- NCScores[NCScores$District == 'Wake County Schools',]
#Join SchoolNameMatch to Wake County Scores
WakeCountyScores <- merge(x=WakeCountyScores, y=SchoolNameMatch, by.x="School", by.y="WCPSS")
#Join Property Values
WakeCountyScores <- merge(x=WakeCountyScores, y=SchoolValuation, by.x="Property", by.y="SchooName")
#Remove Property column
View idiomaticjsonserialiser.fs
namespace Newtonsoft.Json.Converters
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open System
type IdiomaticDuConverter() =
inherit JsonConverter()
[<Literal>]