Skip to content

Instantly share code, notes, and snippets.

@tslater2006
tslater2006 / RotateFlipBug.cs
Last active June 10, 2020 12:57
Demonstrates a RotateFlip bug in the Bitmap class when dealing with a 52x128 1bpp bitmap
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
namespace TraegerImage
{
class RotateFlipBug
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DMSLib
{
public class EndianBinaryReader : BinaryReader
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.Unicode;
namespace esp32_flash_to_elf
@tslater2006
tslater2006 / ESP32NVS.cs
Created April 25, 2020 13:28
ESP32 NVS Parser
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace esp32_flash_to_elf
{
public class ESP32NVSKeyPair
{
Dictionary<int, bool[,]> EvolveWithLevels(Dictionary<int,bool[,]> levels)
{
Dictionary<int, bool[,]> newLevels = new Dictionary<int, bool[,]>();
foreach(var kvp in levels)
{
int curLevel = kvp.Key;
bool[,] map = kvp.Value;
bool[,] newMap = new bool[mapHeight, mapWidth];
for(var y = 0; y < map.GetLength(0); y++)
@tslater2006
tslater2006 / Day 22
Last active December 22, 2019 09:01
using AdventOfCode.Utilities;
using System;
using System.Linq;
using System.Numerics;
namespace AdventOfCode.Solutions.Year2019 {
class Day22 : ASolution {
public Day22() : base(22, 2019, "") {
s<->i = S,
s<->n = I, S,
s<->l = R, W,
s<->w = F, K, P, V, W,
s<->c = K, P, W,
s<->r = F, G, K, P, V, W,
s<->o = I, N, S,
s<->v = K, P, W,
s<->j = I, N, O, S,
s<->q = D, H, K, P, W,
s<->i = 16
s<->n = 38
s<->l = 114
s<->w = 740
s<->c = 608
s<->r = 776
s<->g = 50
s<->o = 58
s<->v = 158
s<->j = 74
#################################################################################
#.#.....#.........#...S.#...............#...............#.......#.....#.........#
#.#.#.###.#.#####.#.###.#.###########.#.#.###.###########.###.#E#.###.#.#.#######
#...#.....#.#...#.#.#.#.#.#.........#.#.#...#.#...#.....#...#.#.#...#...#.#.....#
#.#########.#.#.###.#.#.###.#######I###.#.#.#.#.#.#.###.###.#.#.#.#.#####.#.###.#
#.#.......#...#...#s#.#.#...#.#.....#...#.#.#.#.#.#.#.#...#.#.#.#.#...#.U.#...#.#
#.#R#####.#######.#.#.#.#.###.#.#####.#.#.#.###.#.#.#B#.#.#.#.#.#####.#.#####.#.#
#.#.#...#.#.....#...#.#..i....#n#.....#.#.#.....#.....#.#.#.#.#.......#.#.....#.#
#.#.###.#.#.#.#.#####.#######.#.#.#.###.#.#############.###.#.###.#####.#.#####.#
#.#..l..#.#.#.#.#.......#...#.#.#.#.#.#.#...#.....#.#...#...#.#...#...#.#.....#w#
using AdventOfCode.Utilities;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
namespace AdventOfCode.Solutions.Year2019 {