Skip to content

Instantly share code, notes, and snippets.


Jamie Dixon jamessdixon

View GitHub Profile
jamessdixon / TAMGeolocationService
Created Jun 9, 2015
Texas A&M Geolocation Service in F#
View TAMGeolocationService
#r "../packages/FSharp.Data.2.2.2/lib/net40/FSharp.Data.dll"
open System.IO
open System.Text
open FSharp.Data
let sample = "..\Data\TAMUHttpGet.json"
type Context = JsonProvider<sample>
jamessdixon / Covid
Created Dec 19, 2020
Looking at the COVID Genome Using F#
View Covid
open System
open System.IO
let path = "/Users/jamesdixon/Downloads/sequence.fasta"
let file = File.ReadAllText(path)
let totalLength = file.Length
let prefixLength = 97
let suffixLength = 2
let stringSequence = file.Substring(prefixLength,totalLength-prefixLength-suffixLength)
View BioinformnaticsFrequentWords.fsx
let frequentWords (text:string) (k:int) =
let patternCounts =
|> Seq.windowed k
|> c -> new string(c))
|> Seq.countBy(fun s -> s)
|> Seq.sortByDescending(fun (s,c) -> c)
let maxCount = patternCounts |> Seq.head |> snd
|> Seq.filter(fun (s,c) -> c = maxCount)
jamessdixon / BioinformnaticsPatternCount
Created Sep 15, 2020
Bioinformatics: Pattern Count
View BioinformnaticsPatternCount
let patternCount (text:string) (pattern:string) =
|> Seq.windowed pattern.Length
|> c -> new string(c))
|> Seq.filter(fun s -> s = pattern)
|> Seq.length
let pattern = "ACTAT"
patternCount text pattern
jamessdixon / WebCrawling
Last active Dec 19, 2019
WebCrawling With F#
View WebCrawling
#r @"C:\Users\DIXON2019\.nuget\packages\\11.1.0\lib\netstandard2.0\Microsoft.Azure.Storage.Blob.dll"
#r @"C:\Users\DIXON2019\.nuget\packages\\11.1.0\lib\netstandard2.0\Microsoft.Azure.Storage.Common.dll"
#r @"C:\Users\DIXON2019\.nuget\packages\\1.0.5\lib\netstandard2.0\Microsoft.Azure.Cosmos.Table.dll"
#r @"C:\Users\DIXON2019\.nuget\packages\\2.1.3\lib\netstandard1.6\Microsoft.Azure.DocumentDB.Core.dll"
open System
open System.Net
open System.Windows.Forms
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
View FSAuth0
open System
open Xamarin.Forms
open Auth0.OidcClient
type LoginParameters = { audience : string }
type AuthenticationService() =
jamessdixon / CSharpToFSharp
Created Aug 31, 2018
Convert Auto-Generatd C# classes to F# Types
View CSharpToFSharp
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 =
View PBP_InitialGameBoard.fs
namespace ChickenSoftware.PanzerGeneral
open System.IO
open FSharp.Data
open Xamarin.Forms
open System.Reflection
type TileContext = JsonProvider<"Data//Scenario_Tile.json">
type UnitContext = JsonProvider<"Data//Scenario_Unit.json">
type EquipmentContext = JsonProvider<"Data//Equipment.json">
View PGP_XMLToJSon.fsx
#r "System.Xml.Linq.dll"
#r "Newtonsoft.Json"
open System.IO
open System.Xml
open System.Xml.Linq
open Newtonsoft.Json
let convert xmlPath jsonPath =