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
using System; | |
namespace Funcs { | |
public static class Funcs { | |
public static Func<A, C> Select<A, B, C>(this Func<A, B> f, Func<B, C> g) { | |
return a => g(f(a)); | |
} | |
public static Func<C, B> SelectMany<A, B, C>(this Func<C, A> f, Func<A, Func<C, B>> g) { | |
return a => g(f(a))(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
using System; | |
namespace PureIO { | |
/* | |
C# does not have proper sum types. They must be emulated. | |
This data type is one of 4 possible values: | |
- WriteOut, being a pair of a string and A | |
- WriteErr, being a pair of a string and A | |
- readLine, being a function from string to 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
public class ConcurrentGateway | |
{ | |
private ConcurrentQueue<Action> _workQueue = new ConcurrentQueue<Action>(); | |
private int _writeLock = 0; | |
private static AutoResetEvent _waitEvent = new AutoResetEvent(false); | |
protected static AutoResetEvent GetThreadWaitEvent() | |
{ | |
//returns same event for all threads ,but we could easily provide 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
namespace Sagas | |
{ | |
using System; | |
using System.Collections.Generic; | |
class Program | |
{ | |
static ActivityHost[] processes; |
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
namespace MultiMapSpatialTests | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using NUnit.Framework; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; | |
[Serializable] |
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
$ErrorActionPreference = "Stop" | |
function cleanBin { | |
param ([string]$path) | |
write-host "Cleaning bin from: $path" | |
get-childitem $path -include bin -recurse | remove-item -force -confirm:$false -recurse | |
write-host "Cleaning obj from: $path" | |
get-childitem $path -include obj -recurse | remove-item -force -confirm:$false -recurse |
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
namespace RavenIndexSandbox | |
{ | |
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; | |
[TestFixture] | |
public class WhenGroupinByLocation |
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
namespace RavenIndexSandbox.Customers | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using FizzWare.NBuilder; | |
using NUnit.Framework; | |
using Raven.Client; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; |
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 class FileSystem | |
{ | |
public void Evaluate(IFolder folder) | |
{ | |
int? count; | |
TimeSpan? howLong; | |
var firstTen = Query(folder) | |
.Statistics(x => count = x.Count) | |
.Statistics(x => howLong = x.ExecutionSpan) |
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
CREATE DATABASE [OrderedInsert] | |
GO | |
ALTER DATABASE [OrderedInsert] SET ALLOW_SNAPSHOT_ISOLATION ON | |
GO | |
USE [OrderedInsert] | |
GO | |
CREATE TABLE [dbo].[Test]( |