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
// NOTE: assumption that query doesn't start with '?' | |
static string? RemoveInstanceIdFromQueryString(string query) | |
{ | |
if (string.IsNullOrWhiteSpace(query)) | |
{ | |
return query; | |
} | |
// Opting to not use a StringBuilder as a single string concat feels OK re: allocations | |
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; | |
namespace BloomFilter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
AddItem("test"); | |
AddItem("test2"); |
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
static void Main(string[] args) | |
{ | |
var input = @"5 5 | |
1 2 N | |
LMLMLMLMM | |
3 3 E | |
MMRMMRMRRM".Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); | |
var bounds = input[0].Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(i => int.Parse(i)).ToArray(); | |
var dirs = "NESW"; var magnitudes = new[] { Tuple.Create(0, 1), Tuple.Create(1, 0), Tuple.Create(0, -1), Tuple.Create(-1, 0) }; | |
for (int i = 1; i < input.Length; i += 2) { |