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
switch(policy.LanguageType) | |
{ | |
case LanguageTypes.CSharp: | |
// process c# rules | |
break; | |
case LanguageTypes.Python: | |
//process python rules | |
break; | |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
const string mom = "mom"; | |
const string mother = "mother"; | |
const int iterations = 10000; | |
var sw = new Stopwatch(); | |
sw.Start(); |
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
function Stopwatch() | |
{ | |
var sw = this; | |
var start = null; | |
var stop = null; | |
var isRunning = false; | |
sw.__defineGetter__("ElapsedMilliseconds", function() | |
{ | |
return (isRunning ? new Date() : stop) - start; |
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 System.Diagnostics; | |
namespace JsEnginePerformanceComparison | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var done = false; |
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
var ret = [], tmp, num = 500, i = 1024; | |
for ( var j1 = 0; j1 < i * 15; j1++ ) { | |
ret = []; | |
ret.length = i; | |
} | |
for ( var j2 = 0; j2 < i * 10; j2++ ) { | |
ret = new Array(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
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
public static class Crypto | |
{ | |
#region MD5 | |
public static string HashMD5(string phrase) | |
{ |
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 System.Configuration; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Text; | |
using System.Web; |
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
USE [master] | |
GO | |
IF OBJECT_ID('dbo.sp_foreachdb') IS NULL EXEC ('CREATE PROCEDURE dbo.sp_foreachdb AS RETURN 0') | |
GO | |
ALTER PROCEDURE dbo.sp_foreachdb ( | |
@command NVARCHAR(MAX), | |
@replace_character NCHAR(1) = N'?', | |
@print_dbname BIT = 0, | |
@print_command_only BIT = 0, |
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
<# | |
This code illustrates highlighting a line based on a cell value | |
Search-CellValue will help identify the rows we care about | |
Format-Cell will format these rows | |
Prerequisite: Download and load up PSExcel http://ramblingcookiemonster.github.io/PSExcel-Intro/ | |
#> | |
# View the help on the primary commands we will be using | |
Get-Help Search-CellValue -Full |
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
function Get-EnumValues { | |
<# | |
.SYNOPSIS | |
Return list of names and values for an enumeration object | |
.DESCRIPTION | |
Return list of names and values for an enumeration object | |
.PARAMETER Type | |
Pass in an actual type, or a string for the type name. |