{
"query": {"match_all" :{}}
,
"size": 10,
"sort": { "PubDate":{ "order": "desc" }}
}
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 IConnectionProvider | |
{ | |
IConnection GetConnection(); | |
} | |
public class ConnectionProvider : IConnectionProvider | |
{ | |
private IConnection _connection; | |
private SortedDictionary<FactoryWrapperScore, IConnectionFactoryWrapper> _stats = | |
new SortedDictionary<FactoryWrapperScore, IConnectionFactoryWrapper>(); |
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 CircuitBreakerExtensions | |
{ | |
/// <summary> | |
/// | |
/// </summary> | |
/// <param name="circuit">async work</param> | |
/// <param name="timeout">it abandons the work if not finished until this timeout</param> | |
/// <param name="finalTimeout">timeout for when the task runs for final time</param> | |
/// <param name="tries">number of times to try the work</param> | |
/// <param name="retryRemedy">after each unscuccessful retry, this will be called and the index will be passed</param> |
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
Date/Time: 2014-02-13 01:55:04 +0000 | |
OS Version: 10.9 (Build 13A3028) | |
Architecture: x86_64 | |
Report Version: 18 | |
Event: Sleep Wake Failure | |
Steps: 44 | |
Hardware model: MacBookPro11,1 | |
Active cpus: 4 |
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) | |
{ | |
for (int i = 0; i < 1000000000; i++) | |
{ | |
var memoryCache = new MemoryCache("sdf"); // leads to memory leak!!! | |
// WHILE THIS ONE DOES NOT | |
// var memoryStream = new MemoryStream(new byte[100000]); |
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(); |
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
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
<?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
/// <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>.*)\"))"; |