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
builder | |
.UseSerilog((ctx, _, logConfig) => | |
{ | |
logConfig.ReadFrom.Configuration(ctx.Configuration, "Log"); | |
}, writeToProviders: true) | |
.ConfigureServices((ctx, services) => | |
{ | |
services.AddOpenTelemetry() | |
.ConfigureResource(res => { | |
... |
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 ExponentialWeightedMovingAverage | |
{ | |
private bool isInitialized; | |
// Smoothing/damping coefficient | |
private double alpha; | |
public double Average { get; private set; } | |
public ExponentialWeightedMovingAverage(int samplesPerWindow) |
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
DECLARE @compatibility_level TINYINT = 0; | |
SELECT @compatibility_level = compatibility_level FROM sys.databases WHERE name = 'MyDatabase'; | |
PRINT CONCAT('Database compatibility level is: ', @compatibility_level); | |
IF @compatibility_level < 150 | |
BEGIN | |
RAISERROR('Data Classification will not be performed, as database compatibility level %d is not high enough', 10, 1, @compatibility_level); | |
SET NOEXEC ON; | |
END; | |
GO |
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.Security.Cryptography; | |
// ReSharper disable SuggestVarOrType_SimpleTypes - BCL rules | |
namespace Crypto | |
{ | |
/// <summary> | |
/// Simple implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf, section 5.1 | |
/// Things not implemented: | |
/// - Encoding parameters using compressed points; only uncompressed points are used |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |
<html><head><title>Crash List</title></head> | |
<body> | |
<h3>Crash List</h3> | |
<br><h4>Created by using <a href="http://www.nirsoft.net/" target="newwin">BlueScreenView</a></h4><p><table border="1" cellpadding="5"><tr bgcolor="E0E0E0"> | |
<th>Dump File | |
<th>Crash Time | |
<th>Bug Check String | |
<th>Bug Check Code | |
<th>Parameter 1 |
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.Runtime.CompilerServices; | |
using System.Security.Cryptography; | |
// ReSharper disable InconsistentNaming | |
// ReSharper disable SuggestVarOrType_BuiltInTypes | |
namespace WyHash | |
{ | |
/// <inheritdoc /> | |
/// <summary> |
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
; Core CLR v4.6.27615.73 (coreclr.dll) on amd64. | |
MyClass..ctor() | |
L0000: push rbp | |
L0001: sub rsp, 0x20 | |
L0005: lea rbp, [rsp+0x20] | |
L000a: mov [rbp+0x10], rcx | |
L000e: cmp dword [rip+0xbffb], 0x0 | |
L0015: jz L001c | |
L0017: call 0x7ffc61fad9e0 |
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
// Non-intrinsics path is based on https://stackoverflow.com/a/51587262/25758, which is faster than any other portable 64-bit multiplication function I've found | |
public static class Maths | |
{ | |
/// <summary> | |
/// Multiplies 2 unsigned 64-bit integers, returning the result in 2 ulongs representing the hi and lo bits | |
/// of the resulting 128-bit integer | |
/// </summary> | |
/// <remarks> | |
/// <seealso cref="System.Numerics.BigInteger"/> can perform multiplication on large integers, but it's |
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
# Docker image for PostgreSQL with the TimescaleDB extensions installed, running on a Debian Stretch-Slim base | |
# Begin by building TimescaleDB | |
FROM postgres:11.2 AS build | |
ENV TIMESCALEDB_VERSION 1.2.2 | |
ENV TIMESCALEDB_SHASUM="c8e8071c24707e3fa8a50abb788c85d03a1bd9d9dea2e273b4abf407f39c182a timescaledb-${TIMESCALEDB_VERSION}.tar.gz" | |
RUN buildDeps="curl build-essential ca-certificates git python gnupg libc++-dev libc++abi-dev pkg-config glib2.0 cmake libssl-dev" \ | |
&& apt-get update \ |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Reflection; | |
namespace Acme.Utils | |
{ | |
public static class EnumExtensions |
NewerOlder