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 sealed class Remote<T> where T : MarshalByRefObject | |
{ | |
private readonly AppDomain domain; | |
private readonly T remoteObject; | |
private Remote(AppDomain domain, T remoteObject) | |
{ | |
this.domain = domain; | |
this.remoteObject = remoteObject; | |
} |
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 GenericSqlProvider | |
{ | |
private readonly string connectionString; | |
public GenericSqlProvider(string connectionString) | |
{ | |
this.connectionString = connectionString; | |
} | |
public IResult<ProcedureResult> ExecuteCall(string procedureName, IDictionary<string, object> input) |
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 SortableBindingList<T> : BindingList<T> | |
{ | |
private readonly Dictionary<Type, PropertyComparer<T>> comparers; | |
private bool isSorted; | |
private ListSortDirection listSortDirection; | |
private PropertyDescriptor propertyDescriptor; | |
public SortableBindingList() | |
: base(new List<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
//http://jsperf.com/call-apply-bind-method | |
function targetCall(thisArg, func) { | |
return func.call(thisArg, 1, 2); | |
} | |
function targetApply(thisArg, func) { | |
return func.apply(thisArg, [1, 2]); | |
} |
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 () { | |
// IndexedDB | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
dbVersion = 1.0; | |
// Create/open database | |
var request = indexedDB.open("elephantFiles", dbVersion), | |
db, | |
createObjectStore = function (dataBase) { |
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
/* | |
faster bind by http://jsperf.com/bind-vs-emulate/9 | |
*/ | |
(function () { | |
var slice = Array.prototype.slice; | |
Function.prototype.bind2 = function (context) { | |
var f = this; | |
var curriedArgs = slice.call(arguments, 1); | |
if (curriedArgs.length) { |
NewerOlder