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 static class ImmutableListExtensions | |
{ | |
public static ImmutableList<T> Filter<T>(this ImmutableList<T> source, Func<T, bool> predicate) | |
{ | |
if (source == null) throw new ArgumentNullException("source"); | |
if (predicate == null) throw new ArgumentNullException("predicate"); | |
if (source.IsEmpty) return source; | |
return ImmutableList<T>.Create(source.Where(predicate)); | |
} |
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 static class EventFactory | |
{ | |
public static Event<T> Create<T>(Expression<Func<T>> eventExpr) | |
{ | |
return new Event<T>(eventExpr); | |
} | |
} | |
public class Event<T> | |
{ |
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 static class EventFactory | |
{ | |
public static DelegateEvent<T> Create<T>(Expression<Func<T>> eventExpr) | |
{ | |
return new DelegateEvent<T>(eventExpr); | |
} | |
} | |
public class DelegateEvent<TDelegate> | |
{ |
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
private static RAMDirectory IndexBenchmark(String target, int topN) throws Exception { | |
System.gc(); | |
if (topN < 0) topN = Integer.MAX_VALUE; | |
RAMDirectory ramDir = new RAMDirectory(); | |
IndexWriter ramWriter = new IndexWriter(ramDir, new StandardAnalyzer()); | |
FileInputStream fstream = new FileInputStream("Content.txt"); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(fstream)); | |
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 NHTest.Collections | |
{ | |
using System.Reflection; | |
using Iesi.Collections.Generic; | |
using NHibernate.Collection.Generic; | |
using NHibernate.Engine; | |
public class PersistentSetBase<TItem, TAbstractSet> : PersistentGenericSet<TItem> | |
where TAbstractSet : ISet<TItem> |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace SimpleTest.Tdd | |
{ | |
internal interface IConverter | |
{ | |
object Convert(List<string> values); |
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
#light | |
module Token | |
let rec private readToken inQuote tokenChars restChars = | |
let chars2Token chars = new string(chars |> Array.ofList |> Array.rev) | |
if inQuote then | |
match restChars with | |
| '\'' :: [] -> (chars2Token tokenChars, []) | |
| '\'' :: '-' :: cs -> (chars2Token tokenChars, '-' :: cs) |
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
class Program | |
{ | |
static void Main() | |
{ | |
Post post = null; | |
Blog blog = null; | |
UrlHelper helper = null; | |
CodeTimer.Initialize(); |
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 abstract class ReadFreeCache<TKey, TValue> | |
{ | |
protected ReadFreeCache() | |
: this(null) | |
{ } | |
protected ReadFreeCache(IEqualityComparer<TKey> comparer) | |
{ | |
this.m_storage = new Dictionary<TKey, TValue>(comparer); | |
} |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.FSharp.Collections; | |
using System.Threading; | |
using System.Collections.Concurrent; | |
namespace CacheBenchmark | |
{ |