EDID情報の比較
(ioreg
はコマンド ioreg
の出力から得られたもの、 get-edid
はパッケージread-edidのget-edid
の出力から得られたもの)
MD5 (get-edid.bin) = 8f43572ff6d8d6097d4d7313ee7c4daf
extension String.StringInterpolation { | |
mutating func appendInterpolation(_ value: CVarArg, format: String) { | |
appendLiteral(.init(format: format, value)) | |
} | |
} | |
// Usage | |
print("π = \(pi)") // π = 3.141592653589793 | |
print("π = \(pi, format: "%.2f")") // π = 3.14 |
EDID情報の比較
(ioreg
はコマンド ioreg
の出力から得られたもの、 get-edid
はパッケージread-edidのget-edid
の出力から得られたもの)
MD5 (get-edid.bin) = 8f43572ff6d8d6097d4d7313ee7c4daf
# | |
# | |
# | |
import sys | |
from typing import List | |
import numpy as np | |
from PIL import Image | |
file_path = "/path/to/image.png" |
def is_virtual_env() -> bool: | |
"""venv, virtualenvその他仮想環境で動いているかどうかを調べる | |
Returns: | |
bool: 仮想環境ならTrue、そうでなければFalse | |
""" | |
# base_prefixはインストール元のpython, prefixは仮想環境のpythonを指すパス | |
# - https://docs.python.org/ja/3/library/sys.html#sys.base_prefix | |
# - https://docs.python.org/ja/3/library/sys.html#sys.prefix | |
# これらの値が同一でなければ、仮想環境での実行と判断する |
# | |
# bytes型を任意bitで分割・結合する | |
# | |
import functools | |
from typing import List | |
def splitbytes(data: bytes, n_sep: int) -> bytes: | |
"""bytes型のデータを任意のビット数ごとに分割する |
# | |
# | |
# | |
from abc import ABCMeta, abstractmethod | |
class Meta(metaclass=ABCMeta): | |
class MetaChildren(metaclass=ABCMeta): |
// | |
// ViewController.swift | |
// PDFEx | |
// | |
// Created by EnchantCode on 2020/12/26. | |
// | |
import UIKit | |
import PDFKit | |
import UniformTypeIdentifiers |
#!/bin/bash | |
# ログを出力する. | |
# 第一引数がメッセージとして扱われ、 | |
# stdoutがttyでなければカラーエスケープシーケンスを除去する | |
function log(){ | |
if [ -t 1 ]; then | |
printf "$1\n" | |
else | |
printf "$1\n" | sed -r 's/\x1b\[[0-9]*(;[0-9]*)*m//g' |
def listdir_r(path: str) -> List[str]: | |
"""ディレクトリの再帰検索 | |
Args: | |
path (str): 検索対象 | |
Returns: | |
List[str]: 検索結果 | |
""" |
# | |
# イテレータ上手く使えばナベアツを錬成できるのでは? | |
# | |
import sys | |
from typing import Optional, Union | |
class Nabeatsu: |