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 static void Main() | |
{ | |
// Load the source image and mask image | |
using Bitmap sourceImage = new Bitmap("path/to/source/image.png"); | |
using Bitmap maskImage = new Bitmap("path/to/mask/image.png"); | |
// Apply the mask | |
using Bitmap resultImage = ApplyMask(sourceImage, maskImage); | |
// Save the result |
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
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$SolutionFilePath | |
) | |
# Get all lines that start with "Project(" | |
$projectLines = Get-Content $SolutionFilePath | Where-Object { $_ -match '^Project\(' -and $_ -match '\.csproj"' } | |
# Extract project names and paths | |
$projects = $projectLines | ForEach-Object { |
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
Explain rocket science to me like I was 9 years old | |
Rocket science is all about building machines that can fly really, really high and really, really fast! Just like how you can throw a ball really far, rockets have a special engine that shoots out hot gases to make them go really fast and really far into the sky. Rockets are used to send people and things into space, and explore planets and stars far, far away! It's kind of like a big, exciting adventure! | |
Even simpler | |
Rocket science is about building machines that can fly really high and really fast using special engines that shoot out hot gases. Rockets are used to explore space and go on big adventures! | |
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
var file = @"c:\code\AoC\AoC2022\Day6\input.txt"; | |
var message = File.ReadAllText(file).AsSpan(); | |
var set = new HashSet<char>(4); | |
var part1 = FindUniqueSegment(message, 4); | |
var part2 = FindUniqueSegment(message, 14); | |
(part1 == 1760).Dump("Part 1"); | |
(part2 == 2974).Dump("Part 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
var file = @"d:\code\decriptor\input3.txt"; | |
var input = File.ReadLines(file).ToArray(); | |
var priority = 0; | |
var badgePriority = 0; | |
for(int i = 0; i < input.Count(); i += 3) | |
{ | |
var input1 = input[i]; | |
var input2 = input[i+1]; |
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
var path = @"D:\code\decriptor\input2.txt"; | |
var lost = 0; | |
var draw = 3; | |
var won = 6; | |
var rock = 1; // A, X | |
var paper = 2; // B, Y | |
var scissors = 3; // C, Z |
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
Foo.csproj: | |
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | |
<PropertyGroup> | |
<OutputType>exe</OutputType> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<UseWindowsForms>true</UseWindowsForms> | |
</PropertyGroup> |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Day12 | |
{ | |
class PlantGenerations | |
{ | |
public string InitialState { get; } |
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.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks.Dataflow; | |
namespace SimpleProblems | |
{ | |
class Program | |
{ | |
static readonly IEnumerable<int> numbers = Enumerable.Range(1, 100); |
NewerOlder