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
// Define other methods and classes here | |
/// <summary> | |
/// Sample Provider to allow fading in and out | |
/// </summary> | |
public class DelayFadeOutSampleProvider : ISampleProvider | |
{ | |
enum FadeState | |
{ | |
Silence, | |
FadingIn, |
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
<Window x:Class="WpfButtonStyles.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="WPF Example Button Styles" Height="350" Width="525"> | |
<Window.Resources> | |
<Style | |
TargetType="Button" x:Key="NewGameButtonStyle"> | |
<Setter Property="FontFamily" Value="Resources/teen bd.ttf#Teen" /> | |
<Setter Property="FontSize" Value="18" /> | |
<Setter Property="Template"> |
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
@echo off | |
cls | |
if not exist ".\.nuget" mkdir ".\.nuget" | |
if not exist ".\.nuget\nuget.exe" powershell -Command "Invoke-WebRequest https://www.nuget.org/nuget.exe -OutFile .\.nuget\nuget.exe" | |
".nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" | |
"packages\FAKE\tools\Fake.exe" build.fsx %* | |
pause |
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
// n.b. Linqpad script | |
class QueueSpellChooser : ISpellChooser | |
{ | |
private Queue<Spell> spellQueue; | |
public QueueSpellChooser(IEnumerable<Spell> spells) | |
{ | |
spellQueue = new Queue<Spell>(spells); | |
} |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.Runtime.Serialization.dll</Reference> | |
<NuGetReference>WindowsAzure.ServiceBus</NuGetReference> | |
<Namespace>Microsoft.ServiceBus</Namespace> | |
<Namespace>Microsoft.ServiceBus.Messaging</Namespace> | |
</Query> | |
void Main() | |
{ | |
string connectionString = Util.GetPassword("Test Azure Service Bus Connection String"); |
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 listSize = 10000000; | |
var stopwatch = new Stopwatch(); | |
stopwatch.Restart(); | |
var s = Enumerable.Range(1, listSize) | |
.Select(n => n * 2) | |
.Select(n => Math.Sin((2 * Math.PI * n)/1000)) | |
.Select(n => Math.Pow(n,2)) | |
.Sum(); | |
stopwatch.Stop(); | |
Console.WriteLine("LINQ {0} items in {1}ms", listSize, stopwatch.ElapsedMilliseconds); |
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 f = new Form(); | |
var b = new Button(); | |
b.Text = "Show message"; | |
b.AutoSize = true; | |
f.Controls.Add(b); | |
b.Click += (s, e) => | |
{ | |
var p = new Form(); | |
p.Text = "Hello"; | |
p.Show(f); |
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
{ | |
"bindings": [ | |
{ | |
"type": "httpTrigger", | |
"direction": "in", | |
"webHookTypeX": "genericJson", | |
"name": "req", | |
"methods": [ | |
"get", | |
"post", |
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
let highestRepeated dice minRepeats = | |
let repeats = dice |> List.countBy id |> List.filter (fun (_,n) -> n >= minRepeats) |> List.map fst | |
match repeats with | [] -> 0 | _ -> List.max repeats | |
let ofAKind n dice = | |
n * highestRepeated dice n | |
let sumOfSingle selected dice = | |
dice |> Seq.filter ((=) selected) |> Seq.sum |
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
// (created in LINQPad with the following references and namespaces) | |
// <Query Kind="Statements"> | |
// <Reference><RuntimeDirectory>\System.Runtime.Serialization.dll</Reference> | |
// <NuGetReference>WindowsAzure.ServiceBus</NuGetReference> | |
// <Namespace>Microsoft.ServiceBus</Namespace> | |
// <Namespace>Microsoft.ServiceBus.Messaging</Namespace> | |
// </Query> | |
string connectionString = Util.GetPassword("Test Azure Service Bus Connection String"); | |
const string queueName = "MarkHeathTestQueue"; |