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; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.XPath; | |
using System.Xml.Xsl; | |
using System.IO; | |
using System.Reflection; | |
using System.Xml; |
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 lang=en-us> | |
<head> | |
<meta charset=utf-8><title>Highlight JS</title> | |
<meta name=viewport content="width=device-width, initial-scale=1.0, maximum-scale=1"> | |
<link rel=stylesheet href=//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/tomorrow-night.min.css"/> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/languages/fsharp.min.js"></script> |
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
// n.b. Linqpad script | |
class QueueSpellChooser : ISpellChooser | |
{ | |
private Queue<Spell> spellQueue; | |
public QueueSpellChooser(IEnumerable<Spell> spells) | |
{ | |
spellQueue = new Queue<Spell>(spells); | |
} |
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
let rec f n x acc = | |
if x = n then | |
x::acc | |
elif n % x = 0 then | |
f (n/x) x (x::acc) | |
else | |
f n (x+1) acc | |
let factorise n = f n 2 [] | |
let factors = factorise 124782 |
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
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 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 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"; |
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
{ | |
"bindings": [ | |
{ | |
"name": "inputBlob", | |
"type": "blobTrigger", | |
"direction": "in", | |
"path": "samples-workitems/input/{name}", | |
"connection": "AzureWebJobsDashboard" | |
}, | |
{ |
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
{ | |
"bindings": [ | |
{ | |
"type": "httpTrigger", | |
"direction": "in", | |
"webHookTypeX": "genericJson", | |
"name": "req", | |
"methods": [ | |
"get", | |
"post", |
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
void Main() | |
{ | |
int outRate = 16000; | |
var inFile = @"E:\example input file.mp3"; | |
var outFile = @"E:\Input Driven Resampled.wav"; | |
using (var reader = new AudioFileReader(inFile)) | |
using (var writer = new WaveFileWriter(outFile, WaveFormat.CreateIeeeFloatWaveFormat(outRate, reader.WaveFormat.Channels))) | |
{ | |
var read = 0; |
OlderNewer