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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="HTTP to HTTPS Redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{SERVER_NAME}" pattern="^localhost$" negate="true" /> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> |
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 function dbo.GenerateMergeProcedure ( | |
@sourceTableName nvarchar(260) | |
, @targetTableName nvarchar(260) | |
, @keyColumnName nvarchar(130) | |
, @storedProcedureName nvarchar(260) | |
) | |
returns nvarchar(max) | |
as | |
begin; | |
declare @columns table ( |
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.Text; | |
namespace ByteTerrace.CSharp.Data | |
{ | |
public struct AsciiString : IEquatable<AsciiString> | |
{ | |
private readonly byte[] m_data; | |
private readonly uint m_length; | |
private readonly uint m_offset; |
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
A048597 "Very round numbers: reduced residue system consists of only primes and 1." | |
- finite (10) | |
- 1, 2, 3, 4, 6, 8, 12, 18, 24, 30 | |
A000040 "The prime numbers." | |
- infinite | |
- 2, 3, 5, 7, 11, 13, 17, 19, 23, 29... | |
30: | |
- becomes 8 when passed through Euler's Totient Function |
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 function [dbo].[NthWeekday] ( | |
@startDate date | |
, @n int = 0 | |
, @weekday int = 0 -- SUNDAY | |
) | |
returns table | |
with schemabinding | |
as return ( | |
select DateAdd(day, -((DatePart(weekday, @startDate) + @@DateFirst - 1) % 7) + (@weekday % 7) + (7 * @n), @startDate) as [Value] | |
); |
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 BinaryHeap<T> | |
{ | |
private readonly IComparer<T> m_comparer; | |
private readonly IList<T> m_values; | |
private int m_offset; | |
public int Capacity => m_values.Count; | |
public int Count => m_offset; |
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
.code | |
Main proc | |
sub rsp, 28h ; align with 16 while simultaneously setting up the "home space" | |
; TODO: something useful here... | |
xor eax, eax ; set return value to zero | |
add rsp, 48h ; free all space that was reserved on the stack | |
ret ; end of main | |
Main endp | |
end |
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
COMMENT @ | |
https://agner.org/optimize/instruction_tables.pdf | |
https://agner.org/optimize/microarchitecture.pdf | |
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilew | |
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfilesizeex | |
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-readfile | |
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile | |
https://docs.microsoft.com/en-us/windows/desktop/api/handleapi/nf-handleapi-closehandle | |
https://docs.microsoft.com/en-us/windows/desktop/api/memoryapi/nf-memoryapi-createfilemappingw | |
https://docs.microsoft.com/en-us/windows/desktop/api/memoryapi/nf-memoryapi-mapviewoffileex |
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 sealed class Die | |
{ | |
private readonly int m_numberOfSides; | |
private readonly IRandomNumberGenerator m_rng; | |
public Die(int numberOfSides, IRandomNumberGenerator rng) { | |
if (0 > numberOfSides) { | |
throw new ArgumentOutOfRangeException(actualValue: numberOfSides, message: "value must be greater than zero", paramName: nameof(numberOfSides)); | |
} |
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.Runtime.ConstrainedExecution; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
namespace ByteTerrace.Windows.Api | |
{ | |
static class BitwiseHelpers | |
{ | |
public static uint ConcatBits(ushort highPart, ushort lowPart) => ((((uint)highPart) << 16) | lowPart); |
OlderNewer