I hereby claim:
- I am risicle on github.
- I am r_i_s (https://keybase.io/r_i_s) on keybase.
- I have a public key whose fingerprint is 8868 8AE4 8AE6 3195 BCF5 F732 3A7B 7B7A 2611 CE25
To claim this, I am signing this object:
| from django.core.cache import cache | |
| from django.core.cache.backends.base import DEFAULT_TIMEOUT | |
| from django.db import connection , transaction | |
| from hashlib import md5 | |
| def cache_chained_calculation(characteristic_str, calculate_function, timeout=DEFAULT_TIMEOUT, force_update=False): | |
| """ | |
| Attempt to obtain result of @calculate_function, represented by @characteristic_str, through cache or calling the | |
| function. Should only allow one caller to be calculating the value at once (enforced using postgres advisory locks), |
| import datetime | |
| def apply_calendar_month_delta(datetime_in, month_delta): | |
| """ | |
| Applies an (integer) @month_delta to @datetime_in. Cheats on days, clamping them to (0,28] to avoid complexities. | |
| >>> from datetime import date | |
| >>> apply_calendar_month_delta(date(2014, 1, 3), -1) | |
| datetime.date(2013, 12, 3) | |
| >>> apply_calendar_month_delta(date(2014, 9, 3), 6) |
| from django.db import transaction, IntegrityError, DatabaseError | |
| from functools import wraps | |
| import logging | |
| _transaction_logger = logging.getLogger("db.transactions") | |
| def retry_transaction(attempts=2, on_failure=None, logger=_transaction_logger): | |
| """ | |
| Decorator for catching db errors and retrying the operation. |
| [Unit] | |
| Description=Nix daemon | |
| [Service] | |
| ExecStart=/nix/var/nix/profiles/default/bin/nix-daemon | |
| Nice=15 | |
| IOSchedulingClass=3 | |
| Environment="CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" | |
| [Install] |
I hereby claim:
To claim this, I am signing this object:
| import png | |
| from PIL import Image, ImageMath | |
| import array | |
| import math | |
| def _planes_from_png(filename): | |
| with open(filename, "rb") as png_file: | |
| reader = png.Reader(filename) |
| { | |
| pkgs ? import <nixpkgs> {} | |
| }: | |
| let | |
| oraclejdk11 = pkgs.oraclejdk10.overrideAttrs (oldAttrs: { | |
| src = pkgs.requireFile { | |
| name = "jdk-11-ea+24_linux-x64_bin.tar.gz"; | |
| url = "http://jdk.java.net/11/"; | |
| sha256 = "51430792cd9955c7e41792964bede9fe7e4b2aae084986b8575467db75203a3a"; | |
| }; |
| """ | |
| Collection of utility functions to implement rudimentary template-matching based OCR using OpenCV, | |
| intended for use with large, uniform blocks of monospaced, non-language-correlated text (effectively | |
| resulting in a "character grid") where a 100.0% accuracy is required. This could be useful if one, for | |
| example, found themselves needing to recover a hardcopy-printed backup of an OpenPGP key. | |
| Modern general-purpose OCR software doesn't tend to do that well with these, relying heavily on | |
| language-context-based guessing, often trying to be too clever in layout auto-detection, all the while | |
| being extremely tricky to configure precisely enough to allow us to impart our existing knowledge | |
| about the constraints of the target text (expected alphabet, line length, expected font...). |
| building '/nix/store/cy97ghyfamlnaibslwb43f3r40y17zb0-python3.7-salmon-mail-3.1.0.drv'... | |
| unpacking sources | |
| unpacking sources | |
| unpacking source archive /nix/store/c2kalm4pn4vrp98vsq75si01793rz65l-salmon-mail-3.1.0.tar.gz | |
| unpacking source archive /nix/store/c2kalm4pn4vrp98vsq75si01793rz65l-salmon-mail-3.1.0.tar.gz | |
| source root is salmon-mail-3.1.0 | |
| source root is salmon-mail-3.1.0 | |
| setting SOURCE_DATE_EPOCH to timestamp 1547748991 of file salmon-mail-3.1.0/setup.cfg | |
| setting SOURCE_DATE_EPOCH to timestamp 1547748991 of file salmon-mail-3.1.0/setup.cfg | |
| patching sources |
| building '/nix/store/k1wh7gwnjrg1wf6dxvslr3rwspywpbyq-nip2-8.3.0.drv'... | |
| unpacking sources | |
| unpacking source archive /nix/store/q27lq2k4miccpmzfgm6avlgqchxfc1f9-nip2-8.3.0.tar.gz | |
| source root is nip2-8.3.0 | |
| setting SOURCE_DATE_EPOCH to timestamp 1463600557 of file nip2-8.3.0/po/nip2.pot | |
| patching sources | |
| configuring | |
| fixing libtool script ./ltmain.sh | |
| configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/5wqncbrm38hv94rsfrda2xvpjrx41559-nip2-8.3.0 | |
| checking for a BSD-compatible install... /nix/store/bv1lw6a2kw0mn2y3lxhi43180idx6sp9-coreutils-8.31/bin/install -c |