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 WizardsAndWarriors | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
IPlayer player = new Wizard(); | |
Console.WriteLine(player.Weapon.Damage); |
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
/home/mark/cloudlens/azure-storage-net/Lib/Common/RequestEventArgs.cs(59,16): error CS0246: The type or namespace name 'HttpWebRequest' could not be found (are you missing a using directive or an assembly reference?) | |
/home/mark/cloudlens/azure-storage-net/Lib/Common/RequestEventArgs.cs(65,16): error CS0246: The type or namespace name 'HttpWebResponse' could not be found (are you missing a using directive or an assembly reference?) | |
/home/mark/cloudlens/azure-storage-net/Lib/Common/RequestResult.cs(34,6): error CS0246: The type or namespace name 'Serializable' could not be found (are you missing a using directive or an assembly reference?) | |
/home/mark/cloudlens/azure-storage-net/Lib/Common/StorageException.cs(44,6): error CS0246: The type or namespace name 'Serializable' could not be found (are you missing a using directive or an assembly reference?) | |
/home/mark/cloudlens/azure-storage-net/Lib/Common/StorageException.cs(109,44): error CS0246: The type or namespace name 'SerializationInfo' could not be found (are |
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 PersonApp | |
{ | |
public class Person | |
{ | |
public Person() | |
{ | |
} | |
private Person(string firstName, string lastName) |
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.Linq; | |
using Microsoft.AspNet.Builder; | |
namespace StealthProject.Mvc | |
{ | |
public static class AuthenticationMiddleware | |
{ | |
private static readonly char[] Eq = { '=' }; | |
public static IApplicationBuilder UseHeaderClaims(this IApplicationBuilder app) |
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
obj | |
bin | |
deploy | |
*.csproj.user | |
*.suo | |
*.cache | |
~$* |
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
(define contains | |
(lambda (list item) | |
(and (not (null? list)) | |
(or (= item (car list)) | |
(contains (cdr list) item))))) | |
(define hasdup | |
(lambda (list) | |
(and (not (null? list)) | |
(or (contains (cdr list) (car list)) |
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 ClaimsPrincipalBuilder | |
{ | |
public static ClaimsPrincipal FromDictionary(IDictionary<string, string> source) | |
{ | |
var claims = source.Select(pair => new Claim(pair.Key, pair.Value)); | |
var identity = new ClaimsIdentity(claims); | |
return new ClaimsPrincipal(identity); | |
} | |
} |
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 OverloadResolutionChallenge | |
{ | |
class Program : One | |
{ | |
static void Foo<T>(T? t = default(T?)) where T : struct | |
{ | |
Console.WriteLine("struct"); | |
} |
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 TaskEx | |
{ | |
private static readonly ConcurrentDictionary<Task, Timer> Timers = new ConcurrentDictionary<Task, Timer>(); | |
public static Task DelayedStart(this Task task, TimeSpan delay) | |
{ | |
var timer = new Timer(_ => Start(task), null, (long)delay.TotalMilliseconds, -1L); | |
Timers.AddOrUpdate(task, timer, (k, t) => t); | |
return task; | |
} |