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 pollUrl(url, renderer) { | |
return function(render){ | |
if(render == undefined) { render = renderer; } | |
$.getJSON(url, function(data){ | |
render(data); | |
}).always(function(){ | |
setTimeout(pollUrl(url, render), 5000); | |
}); | |
}; |
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 PriorityCollection | |
{ | |
private readonly BlockingCollection<Item> low = new BlockingCollection<Item>(); | |
private readonly BlockingCollection<Item> middle = new BlockingCollection<Item>(); | |
private readonly BlockingCollection<Item> high = new BlockingCollection<Item>(); | |
private readonly BlockingCollection<Guid> main = new BlockingCollection<Guid>(); | |
private readonly BlockingCollection<Item>[] queue; | |
private readonly Dictionary<Priority, BlockingCollection<Item>> priorityMap = new Dictionary<Priority, BlockingCollection<Item>>(); | |
public List<Priority> TestList { get; private 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; | |
namespace Zjy.Utils | |
{ | |
public class Car { | |
public string Make {get; set;} | |
public string Model {get; set;} | |
public string Year {get; set;} | |
public int Mileage {get; set;} | |
public decimal Price {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 OrderRules.Interface; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
namespace OrderRules.RuleChecker | |
{ | |
public static class DynamicOrderRuleLoader | |
{ |
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; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace AsyncExplain | |
{ | |
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.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Runtime.Caching; | |
namespace Dev.Lib | |
{ | |
public class CacheHelper | |
{ |
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.Diagnostics; | |
using System.Linq; | |
using System.Web; | |
namespace Dev.Lib | |
{ | |
public static class Performance | |
{ |
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
static class IoC { | |
static readonly IDictionary<Type, Type> types = new Dictionary<Type, Type>(); | |
public static void Register<TContract, TImplementation>() { | |
types[typeof(TContract)] = typeof(TImplementation); | |
} | |
public static T Resolve<T>() { | |
return (T)Resolve(typeof(T)); | |
} |
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
""" Author contact: sepero 111 @ gmail . com """ | |
from django import http | |
from django.utils.http import urlquote | |
from django.core import urlresolvers | |
class RemoveSlashMiddleware(object): | |
""" | |
This middleware works like django's built in APPEND_SLASH, but in reverse. Eg |
NewerOlder