How to get an
.epub
from an.acsm
on Fedora Linux
This guide is based on Installing on Arch Linux via WINE and Exactly how to remove DRM.
The steps below were tested with Fedora 32.
COMPASS = { | |
"E": (+1, 0), | |
"S": (0, +1), | |
"W": (-1, 0), | |
"N": (0, -1) | |
} | |
ship_pos = [0, 0] | |
ship_heading = 0 |
COMPASS = { | |
"E": (+1, 0), | |
"S": (0, +1), | |
"W": (-1, 0), | |
"N": (0, -1) | |
} | |
ship_pos = [0, 0] | |
waypoint = [10, -1] |
import copy | |
def num_adj_occupied_2(x, y, in_array): | |
num = 0 | |
dim_x, dim_y = len(in_array[0]), len(in_array) | |
for ym in (-1, 0, 1): | |
for xm in (-1, 0, 1): | |
if ym == 0 and xm == 0: continue | |
xp, yp = x+xm, y+ym |
import re | |
## Part 1 | |
def day14_p1(program): | |
mask = None | |
mem = {} | |
for line in program: | |
lh, rh = line.split(" = ") | |
if lh == "mask": |
from functools import reduce | |
import re | |
def get_allergens(input): | |
ingredient_list = [] | |
allergen_map = {} | |
for line in input: | |
m = re.match("^([\w\s]+) \(contains ([\w\s,]+)\)$", line).groups() |
def crab_cups(cycle, n=10): | |
cur_val = cycle[0] | |
max_val = max(cycle) | |
cycle_dict = dict(zip(cycle, cycle[1:])) | |
cycle_dict[cycle[-1]] = cycle[0] | |
def pick_up(n=3): | |
pick = [cycle_dict[cur_val]] | |
for _ in range(n-1): |
from io import StringIO | |
def parse(line): | |
fp = StringIO(line) | |
while True: | |
d1 = fp.read(1) | |
if not d1: | |
break | |
if d1 in ('s', 'n'): |
def get_loops(*search, max_iter=10000000): | |
value = 1 | |
n = 1 | |
while search and n <= max_iter: | |
value = (value * 7) % 20201227 | |
if value in search: | |
yield (value, n) | |
n += 1 | |
## Part 1 |
def build(initial, dim_sz=3): | |
cubes = {} | |
for y, line in enumerate(initial): | |
for x, state in enumerate(line): | |
cubes[(x, y, 0, 0)] = state | |
fill(cubes, dim_sz=dim_sz) | |
return cubes | |
def should_flip(cubes, pos, dim_sz=3): | |
DW_MOV = (0,) if dim_sz == 3 else (-1, 0, 1) |
How to get an
.epub
from an.acsm
on Fedora Linux
This guide is based on Installing on Arch Linux via WINE and Exactly how to remove DRM.
The steps below were tested with Fedora 32.