This file contains hidden or 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 findtfpath = | |
let VS_REGPATHS = [ | |
@"Software\Wow6432Node\Microsoft\VisualStudio\10.0"; | |
@"Software\Microsoft\VisualStudio\10.0"; | |
@"Software\Wow6432Node\Microsoft\VisualStudio\9.0"; | |
@"Software\Microsoft\VisualStudio\9.0"; | |
@"Software\Wow6432Node\Microsoft\VisualStudio\8.0"; | |
@"Software\Microsoft\VisualStudio\8.0" | |
] | |
let INSTALLDIR = "InstallDir"; |
This file contains hidden or 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
class Program | |
{ | |
delegate bool delA(string item); | |
delegate bool delB(string item); | |
static void Main(string[] args) | |
{ | |
delA del = s => true; | |
callA(del); | |
callB(del); |
This file contains hidden or 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
(* Test embedding in blogger... *) | |
let add x y = x + y | |
let add1 = add 1 | |
let result = add1 2 | |
printfn "%d" result | |
This file contains hidden or 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 GLCameraRipple | |
open System | |
open System.Drawing | |
open System.Runtime.InteropServices | |
//open MonoTouch.CoreFoundation | |
open Microsoft.FSharp.NativeInterop | |
type RippleModel(screenSize : Size, meshFactor: int, touchRadius: int, textureSize: Size) = | |
do Console.WriteLine ("New RippleModel"); | |
let poolWidth = screenSize.Width / meshFactor |
This file contains hidden or 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 levenshteinm (s:string) (t:string) = | |
let c = new Dictionary<_,_>() | |
let rec memo i j = | |
match c.TryGetValue((i,j)) with | |
| true, x -> x | |
| _ -> | |
let r = | |
match (i,j) with | |
| (i,0) -> i |
This file contains hidden or 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
using System; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static DateTime compbugresult; | |
static void Main(string[] args) | |
{ | |
compbugresult = compbug.result; |
This file contains hidden or 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 A = | Correct | Incorrect | |
let answers = [1; 2; 3] | |
let correctanswers = [1; 2; 2] | |
answers | |
|> List.zip correctanswers | |
|> List.map (function | a,ca when a = ca -> Correct, a | |
| a,_ -> Incorrect, a) | |
// Just need a count? Use sumBy |
This file contains hidden or 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 inline contiguousGroupBy (f:'a -> 'b) (xs:'a seq) : seq<'a list> = seq { | |
use e = xs.GetEnumerator() | |
let stop = ref (e.MoveNext() |> not) | |
while not !stop do | |
let lastval = ref (f e.Current) | |
let list = | |
[ | |
while not !stop && !lastval = f e.Current do | |
let cur = e.Current | |
lastval := f cur |
This file contains hidden or 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
System.NotSupportedException was unhandled | |
HResult=-2146233067 | |
Message=Specified method is not supported. | |
Source=FSharp.Core | |
StackTrace: | |
at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](Result`1 res) | |
at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) | |
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) | |
at ConsoleApplication1.Program.Main(String[] args) in c:\Users\rojepp\Documents\Visual Studio 2012\Projects\ConsoleApplication7\ConsoleApplication1\Program.cs:line 26 | |
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) |
This file contains hidden or 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
A first chance exception of type 'System.EntryPointNotFoundException' occurred in mscorlib.dll | |
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>ConsoleApplication1.exe</AppDomain><Exception><ExceptionType>System.EntryPointNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Entry point was not found.</Message><StackTrace> at System.Collections.Generic.IEnumerable`1.GetEnumerator() | |
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) | |
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) | |
at ConsoleApplication1.Program.Main(String[] args) in c:\Users\rojepp\Documents\Visual Studio 2012\Projects\ConsoleApplication7\ConsoleApplication1\Pr |
OlderNewer