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 FSharp.Data | |
open System | |
open System.ServiceModel | |
open Microsoft.FSharp.Linq | |
open Microsoft.FSharp.Data.TypeProviders | |
(* execute the following commented stuff only once to get the wsdl, then leave commented | |
(* bit dumb but because service requests authentication, and we can't do that in the wsdlservice tp, we have to download wsdl, load it up locally, set |
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 @"packages\NodaTime\lib\net35-Client\NodaTime.dll" | |
open NodaTime | |
SystemClock.Instance.Now | |
let pattern = NodaTime.Text.LocalDateTimePattern.CreateWithInvariantCulture("MM/dd/yyyy HH:mm") | |
pattern.Parse("11/05/2014 21:15") | |
let dt s = DateTime.ParseExact(s, "d/MM/yyyy h:mm:ss tt", CultureInfo.CurrentCulture) |
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 | |
let cSs = File.ReadAllLines(@"C:\Extras\kfoundry1.6.4\520x50a.txt") | |
(* | |
Raw form data exported from kfoundry with baseline at the waterline looks like this: | |
Form Position, X (mm), Y (mm) | |
... | |
Form at 52 cm, 60, 39.3333 |
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
// getting to grips with PrintfFormat | |
//let sscanf (pf:PrintfFormat<_,_,_,_,'t>) s : 't = | |
let explorePF (pf:PrintfFormat<'printer,'state,'residue,'result,'tuple>) s : string = | |
pf.Value | |
explorePF "(%s %% % %i)" "(somestring)" | |
explorePF "(%s %% %z %i)" "(somestring)" // error FS0741: Unable to parse format string 'Bad format specifier: 'z'' |
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.Text.RegularExpressions | |
open System.Globalization | |
(* | |
For this example let's say we have data describing the processing of a batch of steps eg something like this: | |
BatchId | |
Start DateTime, End DateTime, Step Description |
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
# data was closed incidents in a tab separated txt file that looked like this | |
# week category P1 P2 P3 | |
# sucked up into R it formed a data frame like so | |
# 1 28/05/2012 some category1 NA NA 1 | |
# 2 28/05/2012 some category2 NA 2 1 | |
# 3 28/05/2012 some category3 1 NA 1 | |
# 4 28/05/2012 some category4 NA NA 2 | |
# as it happens, this data was manually collected from excel spreadsheets | |
# unfortunately the spreadsheets were for differing week ranges and there was some overlap 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
# download tweets using twitter search api, combine text and count +ve -ve words to get sentiment | |
# minor modifications to the code taken from | |
# http://jeffreybreen.wordpress.com/2011/07/04/twitter-text-mining-r-slides/ | |
library(RCurl) | |
library(twitteR) | |
library(ROAuth) | |
requestURL <- "https://api.twitter.com/oauth/request_token" | |
accessURL = "http://api.twitter.com/oauth/access_token" |
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:\wd\AzureTxnUploader\packages\WindowsAzure.Storage.2.0.6.0\lib\net40\Microsoft.WindowsAzure.Storage.dll" | |
#r @"C:\wd\AzureTxnUploader\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll" | |
#r @"C:\wd\AzureTxnUploader\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll" | |
#r @"C:\wd\AzureTxnUploader\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll" | |
#r "Microsoft.WindowsAzure.ServiceRuntime" | |
#r "System.Data.Services.Client" | |
#r "System.Linq" | |
open System |
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
// | |
// We're going to simulate some financial transactions and experiement with storing them in azure table storage | |
// | |
//#r "..\packages\Fog.0.1.3.1\Lib\Net40\Fog.dll" | |
//#r "..\packages\FogMyBuild\Debug\Fog.dll" | |
//#r "Microsoft.WindowsAzure.Diagnostics" | |
#r @"C:\wd\AzureTxnUploader\packages\WindowsAzure.Storage.2.0.6.0\lib\net40\Microsoft.WindowsAzure.Storage.dll" | |
//#r @"C:\wd\AzureTxnUploader\packages\Microsoft.Data.Edm.5.5.0\lib\net40\Microsoft.Data.Edm.dll" |
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 | |
#r @"../packages/FSharp.Data.1.1.10/lib/net40/FSharp.Data.dll" | |
#r @"c:\wd\MathDemo\packages\MathNet.Numerics.2.6.2\lib\net40\MathNet.Numerics.dll" | |
#r "../packages/MathNet.Numerics.FSharp.2.6.0/lib/net40/MathNet.Numerics.FSharp.dll" | |
open MathNet.Numerics.LinearAlgebra | |
open MathNet.Numerics.LinearAlgebra.Double |
OlderNewer