1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
---|---|---|---|---|---|---|---|---|---|---|
C | 16.35 | 32.70 | 65.40 | 130.80 | 261.60 | 523.20 | 1046.40 | 2092.80 | 4185.60 | 8371.20 |
C# | 17.32 | 34.64 | 69.28 | 138.56 | 277.12 | 554.24 | 1108.48 | 2216.96 | 4433.92 | 8867.84 |
D | 18.35 | 36.70 | 73.40 | 146.80 | 293.60 | 587.20 | 1174.40 | 2348.80 | 4697.60 | 9395.20 |
D# | 19.45 | 38.90 | 77.80 | 155.60 | 311.20 | 622.40 | 1244.80 | 2489.60 | 4979.20 | 9958.40 |
E | 20.60 | 41.20 | 82.40 | 164.80 | 329.60 | 659.20 | 1318.40 | 2636.80 | 5273.60 | 10547.20 |
F | 21.83 | 43.66 | 87.32 | 174.64 | 349.28 | 698.56 | 1397.12 | 2794.24 | 5588.48 | 11176.96 |
F# | 23.12 | 46.24 | 92.48 | 184.96 | 369.92 | 739.84 | 1479.68 | 2959.36 | 5918.72 | 11837.44 |
G | 24.50 | 49.00 | 98.00 | 196.00 | 392.00 | 784.00 | 1568.00 | 3136.00 | 6272.00 | 12544.00 |
This file contains 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 json | |
import requests | |
import pandas as pd | |
def openapi_to_excel(url, output_file): | |
response = requests.get(url) | |
spec = response.json() | |
first_path = next(iter(spec['paths'])) | |
print(f"Example path structure for {first_path}:") |
This file contains 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 os, fnmatch, argparse | |
def clean_it(root_dir, file_extension): | |
""" | |
Walks through all subdirs of the given directory and deletes files with the specified extension. | |
Also removes any empty directories left after the file deletion. | |
:param root_dir: The root directory to start the search from. | |
:param file_extension: The file extension to look for and delete. | |
""" |
This file contains 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
#!/bin/bash | |
# Silly workaround for keeping user preset folder on top in Vital library. | |
DEST_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Audio/Vital/_User/Presets" | |
SOURCE_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Audio/Vital/User/Presets" | |
fswatch -0 "$SOURCE_DIR" | while read -d "" event; do | |
if [[ "$event" == *.vital ]]; then | |
mv "$event" "$DEST_DIR/" | |
echo "Moved $event to $DEST_DIR" |
This file contains 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 | |
# https://www.svenskaspel.se/triss/spelguide/triss-30 | |
prizes = np.array([ | |
(1, 2765000), | |
(4, 300000), | |
(6, 265000), | |
(2, 100000), | |
(3, 50000), | |
(8, 20000), |
This file contains 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
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
body { | |
font-family: 'Helvetica', sans-serif; | |
} | |
This file contains 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 os, keyboard, time, json, threading | |
def format(elapsed): | |
ms = int((elapsed * 1000) % 1000) | |
seconds = int(elapsed % 60) | |
minutes = int((elapsed // 60) % 60) | |
hours = int((elapsed // 3600) % 24) | |
return f"{hours:02}:{minutes:02}:{seconds:02}.{ms:03}" | |
def record(): |
This file contains 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 os | |
from pyftpdlib.authorizers import DummyAuthorizer | |
from pyftpdlib.handlers import FTPHandler | |
from pyftpdlib.servers import FTPServer | |
USERNAME = "admin" | |
PASSWORD = "foobar" | |
PERMISSION = 'elradfmwMT' |
This file contains 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 os | |
import soundfile as sf # https://github.com/bastibe/python-soundfile | |
def get_wav_sample_rate(file_path): | |
try: | |
with sf.SoundFile(file_path) as wav_file: | |
return wav_file.samplerate | |
except: print(f"Error processing file: {file_path}") | |
def count_sample_rates_in_dir(root_dir): |
This file contains 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 | |
from sklearn.model_selection import train_test_split | |
import matplotlib.pyplot as plt | |
np.random.seed(42) | |
samples = 1000 | |
X = 2 * np.random.rand(samples,1) # Features with uniform distribution | |
epsilon = np.random.normal(0,1, size=(samples,1)) # Random disturbance | |
y = 2 + 9 * X + epsilon # Simple linear regression model |
NewerOlder