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
type BaseProvidedType() = | |
static let mutable _host = "" | |
static member Host | |
with get() = _host | |
and set(value) = _host <- value | |
type ProvidedType() = inherit BaseProvidedType() | |
ProvidedType.Host <- "1" | |
BaseProvidedType.Host // = "1" |
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
//--------- Sample 1 ------------- | |
/// Factorial | |
let rec fact n = | |
if n = 1 then 1 | |
else n*fact(n-1) | |
/// Tail optimized Factorial | |
let fact n = | |
let rec factImpl n acc = // acc = accumulator |
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
// include Fake libs | |
#r @"c:\Project\FAKE.Deploy\bin\FAKE\tools\FakeLib.dll" | |
open Fake | |
open System | |
open System.IO | |
let targetDirectory = @"c:\Project\Service.MSO" | |
let runScript file = | |
if File.Exists file then |
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\Streams.0.2.5\lib\Streams.Core.dll" | |
open System | |
open System.IO | |
open System.Collections.Generic | |
open Nessos.Streams | |
// make Visual Studio use the script directory | |
Directory.SetCurrentDirectory(__SOURCE_DIRECTORY__) |
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/FSharp.ComProvider.1.0.0-pre1/lib/net40/FSharp.ComProvider.dll" | |
#r @"../packages/FSharp.Data.2.1.0/lib/net40/FSharp.Data.dll" | |
open FSharp.Data | |
type SpeechService = TypeLib.``Microsoft Speech Object Library``.``5.4`` | |
let speech = SpeechService.SpVoiceClass() | |
type js = JsonProvider<"""{ "type": "success", "value": { "id": 42, "joke": "Joke here." } }""" > | |
let getJoke num = |
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
#I @"packages\Nuget.Core.2.8.3\lib\net40-Client" | |
#r "NuGet.Core.dll" | |
#r "System.Xml.Linq.dll" | |
let repository = | |
NuGet.PackageRepositoryFactory.Default.CreateRepository | |
"https://nuget.org/api/v2" | |
type NuGetStat = | |
{ Id: string; DownloadCount:int} |
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
public List<Dependency> GetDependency(Tree tree) | |
{ | |
var tlp = new PennTreebankLanguagePack(); | |
var gsf = tlp.grammaticalStructureFactory(); | |
var gs = gsf.newGrammaticalStructure(tree); | |
var dependencies = gs.typedDependenciesCollapsedTree(); | |
return (from TypedDependency dependency in dependencies.toArray() | |
select new Dependency | |
{ |
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
#I @"..\packages\mongocsharpdriver.1.8.3\lib\net35\" | |
#r "MongoDB.Driver.dll" | |
#r "MongoDB.Bson.dll" | |
open System | |
open MongoDB.Bson | |
open MongoDB.Bson.Serialization.Attributes | |
open MongoDB.Driver | |
open MongoDB.Driver.Builders | |
open MongoDB.Driver.Linq |
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 shift (s:string) (k:int) = | |
System.String( | |
s.ToCharArray() | |
|> Array.map (function | |
| x when 'a' <= x && x <='z' -> | |
let code = int(x)-int('a') | |
char(int('a') + (code + k + 26) % 26) | |
| x -> x ) | |
) |
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
*** Assembly Binder Log Entry (10/30/2013 @ 11:29:27 PM) *** | |
The operation failed. | |
Bind result: hr = 0x80070002. The system cannot find the file specified. | |
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll | |
Running under executable D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe | |
--- A detailed error log follows. | |
=== Pre-bind state information === |