Skip to content

Instantly share code, notes, and snippets.

View hazzik's full-sized avatar

Alex Zaytsev hazzik

  • Brisbane, Australia
View GitHub Profile
@hazzik
hazzik / gist:cdec8b4c6863e7a33bc2
Created August 13, 2014 23:13
IISExpress.cmd
for /F %i in ('appcmd list sites /text:NAME') DO @appcmd delete site %i
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Linq;
public static class Tests
{
private static readonly IDictionary<string, IList<long>> results = new Dictionary<string, IList<long>>();
using System;
using System.Diagnostics;
public class Class1
{
}
public class Test1
{
private const int iterations = 10000000;
module Jekyll
class TagCloudTag < Liquid::Tag
safe = true
def initialize(tag_name, text, tokens)
super
end
def render(context)
html = ""
@{
var data = new RouteValueDictionary(ViewData);
object action;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("action", out action);
object controller;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("controller", out controller);
object area;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("area", out area);
if (!string.IsNullOrEmpty((string) area))
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using DelegateDecompiler;
@hazzik
hazzik / LSP.cs
Created March 26, 2014 20:32
LSP.cs
public class Rectangle {
public Rectangle(decimal width, decimal height) {
Width = width;
Height = height;
}
public decimal Area() {
return Width * Height;
}
public decimal Width { get; private set; }
public decimal Height { get; private set; }
========
Array.ForEach: 341.4, Min: 338, Max: 346
Array for i != Length; ++i: 355.5, Min: 352, Max: 365
Array for ++i: 356.8, Min: 350, Max: 381
Array for: 397.9, Min: 391, Max: 420
Array for i != Length: 410.6, Min: 398, Max: 468
Array for, cached length: 413.5, Min: 399, Max: 502
Array foreach: 437.9, Min: 433, Max: 447
List<T>.ForEach: 489.7, Min: 480, Max: 540
IList<T> for, cached length: 590.5, Min: 582, Max: 619
-pascalCase+
-nativeTypeSystem
-organizeUsings
-separateInterfaceConstants
-junitConversion
-maxColumns 400
-namespaceMapping org.mozilla.javascript Rhino
-fullyQualify Cipher
@hazzik
hazzik / Output.txt
Last active December 25, 2015 03:49
SelectMany performance
Compiling the source code....
$mcs main.cs -out:demo.exe 2>&1
main.cs(37,13): warning CS0219: The variable `ids1' is assigned but its value is never used
main.cs(40,13): warning CS0219: The variable `ids1' is assigned but its value is never used
Compilation succeeded - 2 warning(s)
Executing the program....
$mono demo.exe
SelectMany method chain : 00:00:00.7027228
SelectMany linq : 00:00:00.6438793