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
import numpy as np | |
from scipy.ndimage import convolve | |
lines = INPUT.splitlines() | |
alg = [i for i, c in enumerate(lines[0]) if c == "#"] | |
img = np.pad(np.array([[int(c == "#") for c in l] for l in lines[2:]]), ((50, 50), (50, 50))) | |
rot = np.array([[1, 2, 4], [8, 16, 32], [64, 128, 256]]) | |
for i in range(50): | |
img = np.isin(convolve(img, rot, mode="constant", cval=i % 2), alg).astype(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
BEGIN MESSAGE. | |
65hLapBEOn4NOxF egwcqIO20ortY0d na6S7EY81Qh8tCs QSLVmAVHIqqn3ad | |
h29hB5xx5GvRGgE aVFTWvLjWLkTCKq 6Xr2MZHgg6SdpCJ TM9zHVJotbsq3wI | |
lAtXO8mikSV1xga sUzGicn8NsMBiUU nTW4dABMOWXRxE1 nbIuenrRNb9lyhP | |
vCe0UMMbuselAJl g3V2jeGTpVJPxt6 UtPtN0Qz5Z. | |
END MESSAGE. |
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
# /// script | |
# dependencies = [ | |
# "mcp", | |
# "httpx", | |
# "dotenv", | |
# ] | |
# /// | |
import os | |
from typing import Any |
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
#!/usr/bin/env python3 | |
""" | |
patchclean.py - Process a patch file to handle blank line removals. | |
This script reads a patch file from stdin, processes it to convert blank line | |
removals (single "-" lines) to context lines (" "), and updates line numbers | |
in hunk headers accordingly. It also removes hunks that no longer have changes | |
and files that no longer have any modification hunks. | |
Special handling is added for deleted files to preserve their patch structure. |
OlderNewer