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
' .Net 1.1 and Later | |
Imports System.Threading | |
Public NotInheritable Class MessageSequencer | |
Implements IDisposable | |
Private _disposed As Integer = 0 | |
ReadOnly _waitThread As Thread | |
ReadOnly _mre As New ManualResetEvent(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
/* | |
One cannot use multisampling directly in a UWP application because | |
of reasons stipulated here: | |
https://docs.microsoft.com/tr-tr/windows/uwp/gaming/multisampling--multi-sample-anti-aliasing--in-windows-store-apps | |
The workaround is to create a render target with multisampling, render to that | |
and then render the render target as a sprite | |
*/ | |
using System; | |
using System.Collections.Generic; |
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.Collections.Generic; | |
using System.ComponentModel; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Core | |
{ |
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
public class MyBackgroundService : BackgroundService | |
{ | |
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
{ | |
using var disposer = messageQueue.Subscribe(async (msg) => | |
{ | |
await ProcessMessageAsync(msg, stoppingToken); | |
}); | |
// Nasty! |
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
public class MyBackgroundService : BackgroundService | |
{ | |
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
{ | |
while (!stoppingToken.IsCancellationRequested) | |
{ | |
await DoWorkAsync(stoppingToken); | |
} | |
} | |
} |
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
public class MyBackgroundService : BackgroundService | |
{ | |
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
{ | |
// run until stoppingToken is cancelled??? | |
} | |
} |
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
public class MyBackgroundService : BackgroundService | |
{ | |
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
{ | |
// run until stoppingToken is cancelled??? | |
} | |
} |
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
Copyright 2017 Cillié Malan | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
/** | |
* returns a base64url based digest of a PEM file | |
* @param {*} key | |
*/ | |
function digestKey(key) { | |
let meat = key.match(/^-{5}[A-Z ]+-{5}[\r\n]{1,2}([a-zA-Z0-9/+\r\n]+={0,3})[\r\n]{1,2}-{5}[A-Z ]+-{5}/)[1]; | |
if (!meat) throw "unrecognized format"; | |
meat = meat.replace(/[\r\n]{1,2}/g, ''); | |
var buf = Buffer.from(meat, 'base64'); |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace DataProcessorTemplate | |
{ | |
/// <summary> | |
/// Program that counts the number of lines in which each word occurs. |
NewerOlder