"Package" is the same as "Chip carrier" in this context.
term | expanded | examples |
---|---|---|
SMD | Surface-mount devices | Active and passive components |
# 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" |
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 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 = {} |
# 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 |
for wavfile in *.wav; ffmpeg -i $wavfile -b:a 320k (string replace -r '\.wav$' '.mp3' $wavfile); end |