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
" ir_black color scheme | |
" More at: http://blog.infinitered.com/entries/show/8 | |
" ******************************************************************************** | |
" Standard colors used in all ir_black themes: | |
" Note, x:x:x are RGB values | |
" | |
" normal: #f6f3e8 | |
" |
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 void TheWrongWay() | |
{ | |
var connection = new SqlConnection(...); | |
connection.Open(); | |
DoSomethingTimeConsumingThatDoesNotUseTheDatabase(); | |
// execute query |
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 UnableToBookRoomException : Exception | |
{ | |
public UnableToBookRoomException() | |
: base("Unable to book the room") | |
{ | |
} | |
} | |
class Room | |
{ |
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.Security.Cryptography; | |
using System.Text; | |
namespace Example | |
{ | |
public static class StringExtensions | |
{ | |
/// <summary> | |
/// Hash a string with SHA-1. |
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 ThreadPool | |
{ | |
private static readonly object LockObject = new object(); | |
private static readonly Queue<Action> _work = new Queue<Action>(); | |
private static readonly List<Thread> _workers = new List<Thread>(); | |
static ThreadPool() | |
{ | |
for (var i = 0; i < 5; i++) | |
{ |
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 DictionaryExtensions | |
{ | |
private static readonly Random Generator = new Random(); | |
public static TValue GetRandom<TKey, TValue>(this IDictionary<TKey, TValue> dictionary) | |
{ | |
var randomKey = dictionary.Keys.ToList()[Generator.Next(0, dictionary.Keys.Count)]; | |
return dictionary[randomKey]; | |
} |
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
It is popularly believed that Dave Cutler[2] intended the initialism "WNT" as a pun on VMS, incrementing each letter by one. However, the project was originally intended as a follow-on to OS/2 and was referred to as "NT OS/2" before receiving the Windows brand.[3] One of the original NT developers, Mark Lucovsky, states that the name was taken from the original target processor—the Intel i860, code-named N10 ("N-Ten").[4] Various Microsoft publications, including a 1998 question-and-answer session with Bill Gates, reveal that the letters were expanded to "New Technology" for marketing purposes but no longer carry any specific meaning.[5] The letters were dropped from the name of Windows 2000, though Microsoft described the product as "Built on NT technology". |
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 Component | |
{ | |
private readonly IDictionary<string, object> _properties = new Dictionary<string, object>(); | |
public Component() | |
{ | |
} | |
public Component(IEnumerable<KeyValuePair<string, object>> properties) | |
{ |
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 AutoMappingExpression Override<TController>(this AutoMappingExpression autoMappingExpression, string url, Expression<Action<TController>> actionExpression) | |
{ | |
Assert.ParameterIsNotNull(autoMappingExpression, "mappingExpression"); | |
Assert.ParameterIsNotNull(url, "url"); | |
var methodCallExpression = actionExpression.Body as MethodCallExpression; | |
if (methodCallExpression == null) | |
{ | |
throw new ArgumentException("Invalid expression. Expression should consist of a Method call only."); |
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 Test | |
{ | |
using System.Linq.Expressions; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
OlderNewer