CODE | MULTIPLIER |
---|---|
Z | 0.001 |
Y or R | 0.01 |
X or S | 0.1 |
A | 1 |
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
for wavfile in *.wav; ffmpeg -i $wavfile -b:a 320k (string replace -r '\.wav$' '.mp3' $wavfile); end |
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
# Note that not all CPR numbers can be validated this way | |
# More info: https://cpr.dk/cpr-systemet/personnumre-uden-kontrolciffer-modulus-11-kontrol | |
def mod11check(cpr_to_check) -> bool: | |
sum2mod = 0 | |
cpr_arr = [int(x) for x in str(cpr_to_check)] | |
for i in range(0, len(cpr_arr)): | |
sum2mod += cpr_arr[i] * [4, 3, 2, 7, 6, 5, 4, 3, 2, 1][i] | |
if sum2mod % 11 == 0: | |
return True |
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
# This is the memoization demo. | |
# First a wrapper is created, which can be used for each call of the fibonacci function. | |
# The wrapper will save (or cache) the result of each function call - index for a given set of arguments and keyword arguments. | |
from functools import wraps | |
from time import perf_counter | |
def memoize(func): # The memoisation needs to take a function, since it's a decorator. | |
cache = {} |
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
def unique_sum_with_list(howMany): | |
sum = 0 | |
seen_numbers = [] | |
for n in range(howMany): | |
if n in seen_numbers: | |
continue | |
sum += n | |
seen_numbers.append(n) | |
print("list sum: " + str(sum)) | |
return sum |
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
# Traverses a given path and: | |
# 1: Converts filename from "spaces.are.dots" to "human readable", without breaking the filename/extension. | |
# 2: Strips extra stuff found in filename. | |
# NOTE: This assumes that all files in the path are the same extension. | |
from os import scandir, rename | |
extension = ".wav" | |
r1 = ".RECORDED.AT.AMAGER.BIO.AUGUST.2017" | |
r2 = ".FIRST.REHEARSAL.RECORDINGS" |
Service | IPv4 | IPv6 |
---|---|---|
Google Public DNS | 8.8.8.8 | 2001:4860:4860::8888 |
Google Public DNS | 8.8.4.4 | 2001:4860:4860::8844 |
Cloudflare | 1.1.1.1 | 2606:4700:4700::1111 |
Cloudflare | 1.0.0.1 | 2606:4700:4700::1001 |
Quad9 | 9.9.9.9 | 2620:fe::9 |
Quad9 | 149.112.112.112 | 2620:fe::fe |
OpenDNS | 208.67.222.222 | 2620:119:35::35 |
OpenDNS | 208.67.220.220 | 2620:119:53::53 |
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 | |
import matplotlib.pyplot as plt | |
dist_nums = [834109, 193930, 83203, 83448, 83712, 83123, 83335, 83304, 83044] | |
rangenums = [i for i in range(1, 10)] | |
dist_vals = list(zip(rangenums, dist_nums)) | |
labels, values = zip(*dist_vals) | |
indexes = np.arange(len(labels)) | |
width = 1 |
NewerOlder