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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using LinFu.Finders; | |
using LinFu.Finders.Interfaces; | |
using LinFu.Reflection; | |
using CLRDynamicObject = System.Dynamic.DynamicObject; |
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
public static class FunctionalBindingExtensions | |
{ | |
public static Action<T2> Bind<T1, T2>(this Action<T1, T2> action, Func<T1> getValueFunc) | |
{ | |
return action.Bind(getValueFunc()); | |
} | |
public static Action<T1> Bind<T1, T2>(this Action<T1, T2> action, Func<T2> getValueFunc) | |
{ |
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 Nemerle.Collections; | |
using Nemerle.Text; | |
using Nemerle.Utility; | |
using System; | |
using System.Collections.Generic; | |
using System.Console; | |
using System.Linq; | |
public class FizzBuzzer |
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
public ShouldMatchGivenHeaderBytesWhenWrittenToTargetStream() : void | |
{ | |
def bytes = array[ // dos header start | |
0x4d : byte, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, | |
0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, | |
0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
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 Nemerle; | |
using Nemerle.Collections; | |
using Nemerle.Text; | |
using Nemerle.Utility; | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Linq; |
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
public static ShouldMatch(this stream : Stream, other : Stream) : void | |
{ | |
def hash = stream.GetHash(); | |
def otherHash = other.GetHash(); | |
mutable smallerStream = other; | |
when(other.Length > stream.Length) | |
{ | |
smallerStream = stream; | |
} |
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 Nemerle; | |
using Nemerle.Assertions; | |
using Nemerle.Collections; | |
using Nemerle.Text; | |
using Nemerle.Utility; | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Linq; |
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
public FlushContentsTo([NotNull] outputStream : Stream) : uint | |
requires outputStream.CanWrite | |
{ | |
def startPosition = 0; | |
_heap.Seek(startPosition); | |
outputStream.Seek(startPosition); | |
def bytes = _heap.ToArray(); | |
def writer = BinaryWriter(outputStream); | |
writer.Write(bytes); |
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
var testHarness = new TestHarness(); | |
// The processors decide which methods should be replaced and how they should behave once the method is called | |
var consoleTestProcessor = new ConsoleTestProcessor(); | |
testHarness.Processors.Add(consoleTestProcessor); | |
var fileSystemTestProcessor = new FileSystemTestProcessor(); | |
fileSystemTestProcessor.AddMockFile(@"c:\foo.txt", "bar"); | |
testHarness.Processors.Add(fileSystemTestProcessor); |
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
<?xml version="1.0"?> | |
<configuration> | |
<appSettings> | |
<add key="sdkDir" value="C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin"/> | |
<add key="sdkDirUnderVista" value="C:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin"/> | |
</appSettings> | |
<startup> | |
<supportedRuntime version="v2.0.50727"/> | |
</startup> | |
</configuration> |