Preparation
truncate -s20G d1.img
truncate -s20G d2.img
truncate -s20G d3.img
truncate -s20G d4.img
set ld1 (sudo losetup --show --find d1.img)
CREATE TABLE transport_intercity_guess_bus AS | |
WITH bus AS ( | |
SELECT | |
cf.id city_from, | |
ct.id city_to, | |
0 AS transfers, | |
avg(price_avg) as price, | |
avg(distance_avg) as distance, | |
null transfer_city | |
from |
[tool.pylint.main] | |
fail-under = 8.0 | |
ignore = ["input"] | |
ignored-modules = ["pandas", "numpy"] | |
limit-inference-results = 100 | |
persistent = true | |
suggestion-mode = true | |
[tool.pylint.basic] | |
argument-naming-style = "snake_case" |
sqlite3 artist_similarity.db 'alter table artists add column artist_name text' | |
--- | |
attach 'artist_similarity.db' AS sim; | |
attach 'track_metadata.db' AS tr; | |
UPDATE | |
sim.artists SET artist_name = ( | |
SELECT | |
artist_name | |
FROM |
import math | |
import osgeo.gdal as gdal | |
import timeit | |
file_path = "1677269839.tif" | |
ds = gdal.Open(file_path) | |
file_block_size = ds.GetRasterBand(1).GetBlockSize() | |
xoff = 0 |
import argparse | |
from multiprocessing import Pool | |
import btrfs | |
parser = argparse.ArgumentParser() | |
parser.add_argument("btrfs_fs_mountpoint") | |
args = parser.parse_args() | |
def filter_file(path, sieve): | |
with open(path, 'r') as fr: | |
lines = fr.readlines() | |
with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp: | |
temp.writelines(l for l in lines if l.rstrip() not in sieve) | |
temp.flush() | |
os.fsync(temp.fileno()) | |
os.replace(temp.name, path) | |
@>>> timeit.timeit("filter_file('/tmp/t', ['abcnewsvideo 9758031'])", number=100, setup="from __main__ import filter_file") |
Aaron Swartz is the founder of Demand Progress, which launched the campaign against the Internet censorship bills (SOPA/PIPA) and now has over a million members. He is also a Contributing Editor to [The
# Author: Sean Gillies | |
# License: BSD | |
# https://pypi.org/project/de9im/ | |
""" | |
>>> from de9im import pattern | |
>>> side_hug = pattern('FF*F0****') | |
>>> im = p.relate(q) | |
>>> print im | |
FF2F01212 |