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.Collections.Generic; | |
using System.Threading.Tasks; | |
using System.Collections.Concurrent; | |
using System.Text; | |
using System.Threading; | |
namespace MapReduceWords | |
{ | |
public class WordReducer |
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
{ | |
"action": "index.html", | |
"method": "get", | |
"html": [ | |
{ | |
"type": "p", | |
"html": "You must login" | |
}, | |
{ | |
"type": "text", |
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(string[] args) | |
{ | |
ReflectedType reflectedType = new ReflectedType(); | |
PropertyInfo intProperty = typeof(ReflectedType).GetProperty("SampleInt32"); | |
SetAndGet(intProperty, reflectedType, 0); | |
SetAndGet(intProperty, reflectedType, 10); | |
SetAndGet(intProperty, reflectedType, 30); |
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 RLUtils | |
{ | |
/// <summary> | |
/// Creates an Comparer for a type | |
/// </summary> |
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 EnumerableExtensions | |
{ | |
public static IEnumerable<IEnumerable<T>> Permutations<T>(this IEnumerable<T> source) | |
{ | |
if (source == null) | |
throw new ArgumentNullException("source"); | |
// Ensure that the source IEnumerable is evaluated only once | |
return permutations(source.ToArray()); | |
} |
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 interface IFactory<in TKey, TValue> | |
{ | |
/// <summary> | |
/// Registers an item | |
/// </summary> | |
/// <param name="key">Item to register</param> | |
/// <param name="value">The object to be returned</param> | |
void Register(TKey key, TValue value); | |
/// <summary> |
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.Linq.Expressions; | |
using System.Reflection; | |
namespace Expression.Runner | |
{ | |
/// <summary> | |
/// Extensions to <see cref="LambdaExpression"/> | |
/// </summary> | |
public static class ExpressionExtensions |
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 TransactionProvider : ITransactionProvider<SqlTransaction> | |
{ | |
private const string TransactionField = "StoreTransaction"; | |
private const BindingFlags BindingFlags = System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod | |
| System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.NonPublic; | |
public SqlTransaction GetTransaction() | |
{ | |
var sqlTransaction = (SqlTransaction)this.transaction.GetType() |
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.IO; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.Serialization.Json; | |
using System.Text; | |
namespace Test.Lib | |
{ | |
/// <summary> |
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 NullSafeStringComparer : StringComparer | |
{ | |
private readonly StringComparer baseStringComparer; | |
public static NullSafeStringComparer NullSafeInvariantCulture | |
{ | |
get | |
{ | |
return new NullSafeStringComparer(InvariantCulture); | |
} |
OlderNewer