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.Diagnostics; | |
namespace System.Threading | |
{ | |
public static class ThreadNameTracingExtensions | |
{ | |
/// <summary> | |
/// if thread has a name, it leaves the name as it is. If it does not have a name, | |
/// it sets the thread's name to the module.method | |
/// It outputs as |
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; | |
namespace System.Collections.Generics | |
{ | |
public static class IEnumerableExtensions | |
{ | |
public static IEnumerable<T> ForEachOne<T>(this IEnumerable<T> enumerable, Action<T> action) | |
{ |
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; | |
namespace System.Threading | |
{ | |
public class PollingWorker : IPollingWorker,IDisposable | |
{ | |
private class TickAction | |
{ | |
public string Name { get; set; } | |
public Action Work { get; set; } |
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; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using CacheCow.Client; | |
using CacheCow.Client.Headers; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
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; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using CacheCow.Client; | |
using CacheCow.Client.Headers; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
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
/// <summary> | |
/// Parses commandline parameters that are in format of | |
/// -name:value | |
/// /name=value | |
/// -name="value 1" | |
/// </summary> | |
public static class CommandLineParser | |
{ | |
private const string CommandLinePattern = | |
"\\s+[-/](?<name>\\w+)[=:](?:(?<value>[^\\s\\:\"]+)|(?:\"(?<value>.*)\"))"; |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<sectionGroup name="simpleData"> | |
<section name="simpleDataConfiguration" type="Simple.Data.SimpleDataConfigurationSection, Simple.Data"/> | |
</sectionGroup> | |
</configSections> | |
<simpleData> | |
<simpleDataConfiguration traceLevel="Error"/> | |
</simpleData> |
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.Net; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web.Http; |
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
function ViewModel(price, discountPercentage){ | |
this.price = price; | |
this.discountPercentage = discountPercentage; | |
} | |
ViewModel.prototype.getRealPrice = function(){ | |
return this.price * this.discountPercentage; | |
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) | |
{ | |
Func<string> getStuff = () => | |
{ | |
Console.WriteLine("Called!"); | |
return Guid.NewGuid().ToString(); |