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 abstract class AsyncInterceptor : IInterceptor | |
{ | |
private static readonly MethodInfo transitionMethod = | |
typeof(AsyncInterceptor).GetMethod(nameof(TransitionToAsync), BindingFlags.NonPublic | BindingFlags.Instance); | |
protected AsyncInterceptor() | |
{ | |
} | |
void IInterceptor.Intercept(IInvocation invocation) |
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; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
// Note that this is `internal` and regularly shouldn't be accessible from other assemblies: | |
internal sealed class Hellower | |
{ | |
internal void SayHello() | |
{ | |
Console.WriteLine("Hello!"); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="node_modules/angular/angular.min.js"></script> | |
<script src="node_modules/angular-animate/angular-animate.min.js"></script> | |
<script src="node_modules/angular-aria/angular-aria.min.js"></script> | |
<script src="node_modules/angular-material/angular-material.min.js"></script> | |
<link rel="stylesheet" href="node_modules/angular-material/angular-material.min.css"> | |
</head> | |
<body ng-app="app"> |
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
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
</configSections> | |
<connectionStrings> | |
<add name="SqlServerDatabase" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SqlServerDatabase.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> | |
</connectionStrings> | |
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> |
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.Collections.Generic; | |
using System.ComponentModel; | |
using System.Runtime.CompilerServices; | |
using System.Threading; | |
public abstract class ObservableObject : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected ObservableObject() |
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 ESRI.ArcGIS.Geodatabase; | |
// using System; | |
// using System.Collections.Generic; | |
// using System.Runtime.InteropServices; | |
public static IEnumerable<IRow> SearchAsEnumerable(this ITable table, IQueryFilter queryFilter, bool recycling) | |
{ | |
Func<ICursor> createCursor = () => table.Search(queryFilter, recycling); | |
return createCursor.AsEnumerable(); | |
} |
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
static IEnumerable<R> Pairwise<T, R>(this IEnumerable<T> xs, Func<T, T, R> selector) | |
{ | |
using (var enumerator = xs.GetEnumerator()) | |
{ | |
if (enumerator.MoveNext()) | |
{ | |
T x = enumerator.Current; | |
while (enumerator.MoveNext()) | |
{ | |
T y = enumerator.Current; |
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; | |
using System.Collections.Generic; | |
public sealed class ContainerBuilder | |
{ | |
public ContainerBuilder() | |
{ | |
this.registrations = new Dictionary<RuntimeTypeHandle, object>(); | |
} |
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
// Dummy definition of the binary tree: | |
type Deque<'a> = | |
| Empty | |
| Node of Deque<'a> * 'a * Deque<'a> | |
// Traverse from "front" (L) to "back" (R): | |
let rec items D = | |
match D with | |
| Empty -> Seq.empty | |
| Node(L,x,R) -> seq { |
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; | |
partial class Deque<T> | |
{ | |
private sealed class Empty<T> : IDeque<T> | |
{ | |
public IDeque<T> PushFront(T value) | |
{ | |
return new Deque<T>(value, Deque<T>.Empty, Deque<T>.Empty); | |
} |