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.Numerics; | |
using System.Runtime.CompilerServices; | |
var input = UInt128.MaxValue; | |
var v = ((byte)input).SquareRoot(); | |
Console.WriteLine($"{v}"); | |
var w = ((ushort)input).SquareRoot(); | |
Console.WriteLine($"{w}"); | |
var x = ((uint)input).SquareRoot(); |
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.Numerics; | |
var w = BinaryIntegerFunctions.ComputeMagicConstant<ushort>(); | |
Console.WriteLine($"{w} {Convert.ToString((long)w, 2)}"); | |
var x = BinaryIntegerFunctions.ComputeMagicConstant<uint>(); | |
Console.WriteLine($"{x} {Convert.ToString(x, 2)}"); | |
var y = BinaryIntegerFunctions.ComputeMagicConstant<ulong>(); | |
Console.WriteLine($"{y} {Convert.ToString((long)y, 2)}"); | |
var z = BinaryIntegerFunctions.ComputeMagicConstant<UInt128>(); | |
Console.WriteLine($"{z} {Convert.ToString((long)z, 2)}"); |
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 Azure.Core; | |
using System.Text.Json; | |
namespace Sandbox; | |
public sealed class AzureIdentityHttpClient(HttpClient httpClient) | |
{ | |
public async Task<T?> SendAsync<T>( | |
Func<HttpResponseMessage, JsonSerializerOptions, CancellationToken, ValueTask<T>> handler, | |
HttpMethod httpMethod, |
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 Azure.Core; | |
namespace Sandbox; | |
public sealed class AzureIdentityAuthenticationHandler(TokenCredential tokenCredential) : DelegatingHandler | |
{ | |
public static HttpRequestOptionsKey<TokenRequestContext> TokenRequestContextKey => new(key: nameof(TokenRequestContext)); | |
protected override async Task<HttpResponseMessage> SendAsync( | |
HttpRequestMessage httpRequestMessage, |
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
namespace Sandbox; | |
public sealed class PropertyMetadata | |
{ | |
private string m_name = string.Empty; | |
private Type m_type = typeof(void); | |
public string Name { | |
get => m_name; | |
set { |
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 CommunityToolkit.Diagnostics; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.IO.Hashing; | |
using System.Numerics; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Text; | |
using System.Text.Json.Nodes; | |
using System.Text.Json; |
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
--[[ References: | |
https://breezewiki.com/wowpedia/wiki/Events | |
https://breezewiki.com/wowpedia/wiki/Global_functions | |
https://breezewiki.com/wowpedia/wiki/UIHANDLER_OnGamePadButtonDown | |
https://breezewiki.com/wowpedia/wiki/UIOBJECT_Button | |
https://breezewiki.com/wowpedia/wiki/UIOBJECT_Frame | |
https://breezewiki.com/wowpedia/wiki/UIOBJECT_Texture | |
https://github.com/Gethe/wow-ui-textures | |
/dump, /etrace, /fstack |
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 class StupidEncryption | |
{ | |
private const string STREAM_VALUE_ERROR = "Stream offset must be a positive integer less than 2^31."; | |
private const uint STREAM_VALUE_MAX = ((1U << 31) - 1U); | |
public static uint Seed = 4125763933U; | |
public static uint PrimeModularInverse1 = (Seed - 2U); // 4125763931 | |
public static uint Prime1 = PrimeModularInverse1.ModularInverse(); // 0920248019 | |
public static uint Prime0 = (Prime1 >> 1); // 0460124009 | |
public static uint Prime2 = ((Prime1 << 1) | 1U); // 1840496039 |
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
/* | |
create master key encryption by password = N'Tell me about the waters of your homeworld, Usul.'; | |
go | |
create database scoped credential [https://<name>.azurewebsites.net] | |
with identity = N'Managed Identity' | |
, secret = N'{ "resourceId": "<application-registration-id>" }'; | |
go | |
create database scoped credential [https://<name>.blob.core.windows.net] | |
with identity = N'Managed Identity' | |
, secret = N'{ "resourceId": "https://storage.azure.com" }'; |
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
/* | |
https://byteterrace.blob.core.windows.net/temp/Gödels.dat | |
https://byteterrace.blob.core.windows.net/temp/Primes.dat | |
*/ | |
var buffer = new byte[10]; | |
var cacheSize = 4096; | |
var numbersCache = new byte[cacheSize][]; | |
var primeIndex = 0; | |
var recordSeparator = ((byte)Convert.ToChar(value: 30)); |
NewerOlder