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
(* Borrowed very liberally from | |
https://blogs.msdn.com/b/jomo_fisher/archive/2010/03/06/neat-samples-f-freebase-and-dgml.aspx | |
and | |
http://cs.hubfs.net/forums/permalink/11096/11096/ShowThread.aspx#11096 | |
Many thanks to both those posters for giving me 99% of the starting code |
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
// Copy/paste this into the FSI to see what it does. | |
open System | |
let a = [|"a";"b";"c";"d"|] | |
let randstring (arr:string[]) = | |
let r = new Random() | |
arr.[r.Next(arr.Length)] | |
let resultstring = randstring a;; |
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
module measures | |
type ILinear = | |
interface | |
end | |
[<Measure>] type inch = |
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
(* | |
* Filter a specified file into a second file | |
* Onorio Catenacci | |
* 21 October 2011 | |
*) | |
#r "System.dll" | |
open System.IO | |
//Remember: |
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
#11 November 2011 | |
#ExecFsx.ps1 | |
#Onorio Catenacci | |
#Insure we get all the error checking from Powershell itself that we can | |
set-strictmode -version latest | |
#Set this to point at the location of fsi.exe on your machine. | |
set-variable -name fsi -value """$env:ProgramFiles\Microsoft F#\v4.0\fsi.exe""" -option constant | |
#This is where I put all of my .fsx files. Change this to your favorite location |
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
#nowarn "62" | |
//Note this is running on Win7 x64 but git is 32 bit. | |
let pathEnvVar = "Path" | |
let gitBin = @"\Program Files (x86)\Git\bin" | |
let st2Bin = @"\Program Files\Sublime Text 2" | |
let currentPath = System.Environment.GetEnvironmentVariable(pathEnvVar) | |
let modifiedPath = gitBin ^ ";" ^ st2Bin ^ ";" ^ currentPath | |
System.Environment.SetEnvironmentVariable (pathEnvVar,modifiedPath) |
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
#Adjust these values for your own installation. | |
Set-Variable -Name defaultDirectory -option Readonly -value "c:/mydev" | |
Set-Variable -Name defaultRepository -option Readonly -value "myrepo" | |
Set-Variable -Name defaultBranch -option Readonly -value "workbranch" | |
#Per "Everyday git-aliases", do a rebase as opposed to a merge | |
function gpurr($repository=$defaultRepository, $branch=$defaultBranch) | |
{ | |
& 'git' pull --rebase $repository $branch | |
} |
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 Android.App | |
open Android.Content | |
open Android.Net | |
let IsConnectionAvailable (app:Activity) connTypeToCheckFor = | |
let n = app.GetSystemService(Context.ConnectivityService) | |
let cm = | |
match n 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
// This F# dojo is directly inspired by the | |
// Digit Recognizer competition from Kaggle.com: | |
// http://www.kaggle.com/c/digit-recognizer | |
// The datasets below are simply shorter versions of | |
// the training dataset from Kaggle. | |
// The goal of the dojo will be to | |
// create a classifier that uses training data | |
// to recognize hand-written digits, and | |
// evaluate the quality of our classifier |
OlderNewer