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
{{Front}} | |
<div id='tags'>{{Tags}}</div> | |
<script> | |
let tags = document.getElementById('tags') | |
tags.innerHTML = tags.innerHTML.split(' ').filter(function(tag){return tag.match(/^N[0-9]$/i)}).join(' '); | |
</script> |
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
DROP TABLE IF EXISTS day15; | |
CREATE TABLE `day15` ( | |
`signalX` int DEFAULT NULL, | |
`signalY` int DEFAULT NULL, | |
`beaconX` int DEFAULT NULL, | |
`beaconY` int DEFAULT NULL, | |
`radius` int GENERATED ALWAYS AS (ABS(`signalX` - `beaconX`) + ABS(`signalY` - `beaconY`)) | |
); | |
LOAD DATA INFILE 'c:/ProgramData/MySQL/MySQL Server 8.0/Uploads/day15.txt' INTO TABLE day15 |
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
DROP TABLE IF EXISTS day12, graph; | |
SET NAMES binary; | |
CREATE TABLE day12 ( | |
rowNum int DEFAULT 1, | |
colNum int auto_increment, | |
cell char(1), | |
primary key (rowNum, colNum) | |
) DEFAULT CHARSET=binary ENGINE=MyISAM; |
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
CREATE TABLE day09 ( | |
direction ENUM('U', 'D', 'L', 'R'), | |
distance int | |
) ENGINE=BLACKHOLE; | |
CREATE TABLE knots ( | |
id int primary key, | |
x int, | |
y int | |
); |
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
CREATE TABLE `day07` ( | |
`id` int unsigned NOT NULL AUTO_INCREMENT, | |
`parentId` int unsigned DEFAULT NULL, | |
`name` varchar(20) DEFAULT NULL, | |
`size` int unsigned DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
); | |
CREATE TRIGGER `day07_bi` BEFORE INSERT ON `day07` FOR EACH ROW SET NEW.parentId = @curdir; |
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
CREATE TABLE day01 (elf int auto_increment primary key, calories JSON); | |
LOAD DATA LOCAL INFILE 'day01.txt' INTO TABLE day01 | |
LINES TERMINATED BY '\n\n' (@cal) | |
SET calories = CONCAT('[', TRIM(TRAILING ',' FROM REPLACE(@cal, '\n', ',')), ']'); | |
CREATE VIEW calories AS SELECT SUM(cal) AS cal | |
FROM day01 | |
JOIN JSON_TABLE(calories, '$[*]' COLUMNS(cal int path '$')) jt GROUP BY elf ORDER BY cal DESC; |
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
# Open the debug console with Ctrl+: (which is Ctrl+Shift+; on US keyboards) | |
# (Don't have the browser window open when you do.) | |
# Run it with Ctrl+Enter | |
# Remove the # from the last line to actually save the changes | |
s = r'regular expression to search for goes here' | |
srcField = 'Source Field Name goes here' | |
tgtField = 'Target Field Name goes here' | |
noteType = 'Name of the Note Type goes here' |