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 | |
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
#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 = |
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
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"> |
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
namespace sameroom.mobile.iOS | |
open System | |
open Xamarin.Forms | |
open sameroom.mobile | |
open Auth0.OidcClient | |
type LoginParameters = { audience : string } | |
type AuthenticationService() = |
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
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 |
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 @"C:\Users\DIXON2019\.nuget\packages\microsoft.azure.storage.blob\11.1.0\lib\netstandard2.0\Microsoft.Azure.Storage.Blob.dll" | |
#r @"C:\Users\DIXON2019\.nuget\packages\microsoft.azure.storage.common\11.1.0\lib\netstandard2.0\Microsoft.Azure.Storage.Common.dll" | |
#r @"C:\Users\DIXON2019\.nuget\packages\microsoft.azure.cosmos.table\1.0.5\lib\netstandard2.0\Microsoft.Azure.Cosmos.Table.dll" | |
#r @"C:\Users\DIXON2019\.nuget\packages\microsoft.azure.documentdb.core\2.1.3\lib\netstandard1.6\Microsoft.Azure.DocumentDB.Core.dll" | |
open System | |
open System.Net | |
open System.Windows.Forms |
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 patternCount (text:string) (pattern:string) = | |
text | |
|> Seq.windowed pattern.Length | |
|> Seq.map(fun c -> new string(c)) | |
|> Seq.filter(fun s -> s = pattern) | |
|> Seq.length | |
let text = "ACAACTCTGCATACTATCGGGAACTATCCT" | |
let pattern = "ACTAT" | |
patternCount text pattern |
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 frequentWords (text:string) (k:int) = | |
let patternCounts = | |
text | |
|> Seq.windowed k | |
|> Seq.map(fun c -> new string(c)) | |
|> Seq.countBy(fun s -> s) | |
|> Seq.sortByDescending(fun (s,c) -> c) | |
let maxCount = patternCounts |> Seq.head |> snd | |
patternCounts | |
|> Seq.filter(fun (s,c) -> c = maxCount) |