This file contains hidden or 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 bool operator ==(Venda venda1, Venda venda2) | |
{ | |
var areEqual = true; | |
if (venda1 == null && venda2 == null) | |
{ | |
return areEqual; | |
} | |
if ((venda1 == null && venda2 != null) || (venda1 != null && venda2 == null)) |
This file contains hidden or 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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using System.IO; | |
using Newtonsoft.Json; | |
namespace UnitTestProject1 |
This file contains hidden or 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
//thread-safe | |
public class MySingleton | |
{ | |
private static readonly Lazy<MySingleton> _mySingleton = new Lazy<MySingleton>(() => new MySingleton()); | |
private MySingleton() { } | |
public static MySingleton Instance | |
{ |
This file contains hidden or 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
-- ============================================= | |
-- Computes and returns the Levenshtein edit distance between two strings, i.e. the | |
-- number of insertion, deletion, and sustitution edits required to transform one | |
-- string to the other, or NULL if @max is exceeded. Comparisons use the case- | |
-- sensitivity configured in SQL Server (case-insensitive by default). | |
-- http://blog.softwx.net/2014/12/optimizing-levenshtein-algorithm-in-tsql.html | |
-- | |
-- Based on Sten Hjelmqvist's "Fast, memory efficient" algorithm, described | |
-- at http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm, | |
-- with some additional optimizations. |
This file contains hidden or 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
private class OperationQueueInstanceHandleImpl : OperationQueueInstanceHandle | |
{ | |
private ManualResetEventSlim _isInUse = new ManualResetEventSlim(true); | |
private bool _disposed = false; | |
private TimeSpan _timeout; | |
public OperationQueueInstanceHandleImpl(Guid ownerId, DateTime expirationDate) | |
{ | |
this.OwnerID = ownerId; | |
this.ExpirationDate = expirationDate; |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script> | |
<script> | |
var viewModel = {}; | |
var MVVMFramework = {}; | |
MVVMFramework.Init = function (viewModel) { |
This file contains hidden or 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 ConsoleApplication4 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var lista = new List<string>(); | |
for (int i = 0; i < 700000; i++) |
This file contains hidden or 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> | |
/// Registra os Filters de Aplicação para injeção de dependência | |
/// </summary> | |
public class ApplicationFiltersModule : NinjectModule | |
{ | |
public override void Load() | |
{ | |
this.BindFilter<AuditoriaFilter>(FilterScope.Action, null).When(AuditoriaFilter.FilterCondition); | |
this.BindFilter<ValidatePermissionFilter>(FilterScope.First, null).When(ValidatePermissionFilter.FilterCondition); | |
} |
This file contains hidden or 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 Crash | |
{ | |
public class Foo | |
{ | |
public static void Method(object o) | |
{ | |
} | |
} | |
This file contains hidden or 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 ImageResize | |
{ | |
public enum Dimensions | |
{ | |
Width, | |
Height | |
} | |
public enum AnchorPosition |