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
| with input as ( | |
| select * | |
| from ( | |
| values ('1', '2012-01-01' :: timestamp, '2012-01-20':: timestamp), | |
| ('1', '2012-01-09':: timestamp, '2012-01-26':: timestamp), | |
| ('2', '2012-01-02':: timestamp, '2012-01-07':: timestamp) | |
| ) as t(id, date_from, date_to) | |
| ), | |
| date_points as ( | |
| select id, date_from as p |
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
| Verifying that "nikodem.id" is my Blockstack ID. https://onename.com/nikodem |
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
| DiskPart | |
| List Disk | |
| Select Disk # | |
| Clean | |
| Create Partition Primary | |
| Select Partition 1 | |
| Active | |
| Format fs=FAT32 quick | |
| Assign |
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 static byte[] CreateRandomSalt(int size = 16) | |
| { | |
| var cryptoProvider = new RNGCryptoServiceProvider(); | |
| var salt = new byte[size]; | |
| cryptoProvider.GetBytes(salt); | |
| return salt; | |
| } | |
| public static string HashPassword(string plainText, byte[] salt) | |
| { |
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
| private int FindNearestNumberIndex(decimal value, decimal[] array) | |
| { | |
| int index = Array.BinarySearch(array, value); | |
| if (index >= 0) | |
| { | |
| return index; // direct match | |
| } | |
| int indexOfFirstHigherValue = ~index; | |
| if (indexOfFirstHigherValue == 0) |
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
| /// <summary> | |
| /// Checks object of type <typeparamref name="T"/> for equality using provided delegates. | |
| /// </summary> | |
| /// <remarks>Use this class to avoid creating nested, narrow-scoped implementation of <see cref="IEqualityComparer{T}"/></remarks> | |
| /// <typeparam name="T">Type that comparer will able to compare.</typeparam> | |
| public class LambdaEqualityComparer<T> : IEqualityComparer<T> | |
| { | |
| private readonly Func<T, T, bool> _equalityCheck; | |
| private readonly Func<T, int> _hashCodeProvider; | |
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
| for /d /r . %%d in (bin, obj) do @if exist "%%d" rd /s/q "%%d" |