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
internal class Program | |
{ | |
private static void Main( string[] args ) | |
{ | |
var source = new long[] { 8, 4, 2 }; | |
Console.WriteLine( SolveMemoizedWithUtil( source, 23427 ) ); | |
Console.ReadLine(); | |
} | |
public static bool Solve( IEnumerable<long> items, long target ) |
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
src\xunit\Sdk\Executor.cs | |
15: /// ExecutorWrapper instead. | |
src\xunit.runner.msbuild\Utility\XmlTestRunner.cs | |
8: public XmlTestRunner(IExecutorWrapper executorWrapper, IRunnerLogger logger) | |
10: testRunner = new TestRunner(executorWrapper, logger); | |
src\xunit.runner.msbuild\xunit.cs | |
98: using (ExecutorWrapper wrapper = new ExecutorWrapper(assemblyFilename, configFilename, ShadowCopy)) | |
src\xunit.runner.msbuild\xunitproject.cs | |
48: using (ExecutorWrapper wrapper = new ExecutorWrapper(assembly.AssemblyFilename, assembly.ConfigFilename, assembly.ShadowCopy)) | |
src\xunit.runner.tdnet\TdNetRunner.cs |
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 Test-TypeLoaded { | |
param([string]$typeName) | |
return @(try{Invoke-Expression "[$typeName]"}catch{}).Length -ne 0 | |
} | |
Test-TypeLoaded uri | |
Test-TypeLoaded Uri | |
Test-TypeLoaded System.uri | |
Test-TypeLoaded System.uris |
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
\documentclass[12pt]{article} | |
\usepackage{amsthm} | |
\usepackage{amsmath} | |
\usepackage{amssymb} | |
\usepackage{latexsym} | |
\usepackage{amsfonts} | |
\newtheorem{thm}{Theorem}[section] | |
\theoremstyle{definition} | |
\newtheorem{dfn}{Definition}[section] | |
\theoremstyle{remark} |
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
# new and def are used for lack of good PowerShell compatible API names. I want simple and easy to understand for this example. | |
function def { | |
param([string]$name, [scriptblock] $initializer) | |
# Create the static instance registry to mimic the CTS's single class instance per type | |
if($Global:__CTS__ -eq $null) { | |
$dictionary = (New-Object -TypeName 'System.Collections.Generic.Dictionary[string,object]' -ArgumentList @([StringComparer]::OrdinalIgnoreCase)) | |
$value = [PSObject]::AsPSObject($dictionary) | |
$Global:__CTS__ = $value |
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 New-SapiVoice { | |
return new-prototype "SapiVoice" { | |
# Define properties | |
$Speaker = New-Object -ComObject SAPI.SPVoice | |
$Message = 'Hello, World!' | |
# Define methods | |
function Say { | |
param([string]$Message) | |
[void]$Speaker.Speak($Message, 1) | |
} |
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 ConsoleApplication1 | |
{ | |
interface ITest | |
{ | |
void Method(); | |
} | |
class Parent : ITest |
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 =~ { | |
param([regex]$regex, [switch]$debug, [switch]$caseSensitive) | |
process { | |
$matches = $null | |
$mached = $false | |
if($caseSensitive) { | |
$matched = $_ -cmatch $regex | |
} else { | |
$matched = $_ -match $regex | |
} |
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
$point = new-object psobject | |
$point | Add-Member NoteProperty -Name X -Value 4 | |
$point | Add-Member NoteProperty -Name Y -Value 0 | |
$point2 = new-object psobject | |
$point2 | Add-Member NoteProperty -Name X -Value 0 | |
$point2 | Add-Member NoteProperty -Name Y -Value 0 | |
function Get-Distance { |
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
params([string]$message) | |
Write-Host $message |