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 Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Options; | |
using SQLServerConnectionTest; | |
using System; | |
using System.Data.SqlClient; | |
using Xunit; | |
namespace MyProject |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
License, v. 2.0. If a copy of the MPL was not distributed with this | |
file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
/* | |
* IMPORTANT! This version is outdated! | |
* This script has been completely rewritten and upgraded, and is now available here: https://github.com/warriordog/little-log-scan | |
* You should strongly consider using the upgraded version instead of this prototype script. | |
*/ |
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
const publicKeys = [ 12232269, 19452773 ]; // PROD input | |
//const publicKeys = [ 5764801, 17807724 ]; // TEST input 1 | |
function runLoop(subject, loopSize) { | |
let value = 1; | |
for (let i = 0; i < loopSize; i++) { | |
value *= subject; | |
value %= 20201227; | |
} | |
return 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
const INPUT_FILE = 'day24-input.txt'; | |
const DAYS = 100; | |
/** | |
* A hash set that provides proper equivalence semantics for any data type. | |
* For an object type, override the toString() method to return a unique, identifying string. | |
* Values must be effectively immutable - updates to objects after being stored will NOT be reflected and will result in undefined behavior. | |
* @template TValue Type of value to store | |
*/ | |
class MapSet { |
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
//const INPUT = [ 3, 8, 9, 1, 2, 5, 4, 6, 7 ]; // TEST input | |
const INPUT = [ 1, 6, 7, 2, 4, 8, 3, 5, 9 ]; // PROD input - expect 21986479838 | |
const MOVES = 10000000; | |
const cups = (function () { | |
const numbers = Array.from(INPUT); | |
// init circle | |
for (let idx = 0; idx < 1000000; idx++) { | |
let nextIdx = idx + 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
//const INPUT = [ 3, 8, 9, 1, 2, 5, 4, 6, 7 ]; // TEST input | |
const INPUT = [ 1, 6, 7, 2, 4, 8, 3, 5, 9 ]; // PROD input | |
const MOVES = 10000000; | |
/** | |
* @typedef {object} Cup | |
* @property {number} label | |
* @property {Cup} clockwise | |
* @property {Cup} counterClockwise | |
*/ |
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
//const INPUT = [ 3, 8, 9, 1, 2, 5, 4, 6, 7 ]; // TEST input | |
const INPUT = [ 1, 6, 7, 2, 4, 8, 3, 5, 9 ]; // PROD input | |
const MOVES = 100; | |
/** | |
* @typedef {object} Cup | |
* @property {number} label | |
* @property {Cup} clockwise | |
* @property {Cup} counterClockwise | |
*/ |
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
const INPUT_FILE = 'day22-input.txt'; | |
// Load dependencies and utilities | |
const { Axis } = require('../utils/axis'); | |
const NodeFS = require('fs'); | |
// Parse input | |
const initialPlayers = NodeFS.readFileSync(INPUT_FILE, 'utf-8').split(/(?:\r{2}|\n{2}|(?:\r\n){2})/g) | |
.map(player => Axis.from(player.split(/(?:\r\n|\r|\n)/g).slice(1).map(card => parseInt(card.trim())))) | |
; |
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
const INPUT_FILE = 'day22-input.txt'; | |
// Load dependencies and utilities | |
const { Axis } = require('../utils/axis'); | |
const NodeFS = require('fs'); | |
// Parse input | |
const players = NodeFS.readFileSync(INPUT_FILE, 'utf-8').split(/(?:\r{2}|\n{2}|(?:\r\n){2})/g) | |
.map(player => Axis.from(player.split(/(?:\r\n|\r|\n)/g).slice(1).map(card => parseInt(card.trim())))) | |
; |
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
const { parseInputFile } = require('../utils/parser'); | |
const INPUT_FILE = 'day21-input.txt'; | |
/** | |
* @typedef {object} Food | |
* @property {string[]} ingredients | |
* @property {string[]} allergens | |
*/ |
NewerOlder