Skip to content

Instantly share code, notes, and snippets.

64
1024
4
0.20 -0.26 0.23 0.22 0 1.60 0.07
-0.15 0.28 0.26 0.24 0 0.44 0.07 0.85
0.04 -0.04 0.85 0 1.60 0.85
0 0 0 0.16 0 0 0.01
With 2^0 = 1 bit signed integers, Unix time will overflow on: 00:00:01 UTC January 01, 1970
With 2^0 = 1 bit unsigned integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit signed integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit unsigned integers, Unix time will overflow on: 00:00:04 UTC January 01, 1970
With 2^2 = 4 bit signed integers, Unix time will overflow on: 00:00:08 UTC January 01, 1970
With 2^2 = 4 bit unsigned integers, Unix time will overflow on: 00:00:16 UTC January 01, 1970
With 2^3 = 8 bit signed integers, Unix time will overflow on: 00:02:08 UTC January 01, 1970
import numpy as np
def isqrt(n):
if n <= 1:
return n
def f(x):
return (x + (n // x)) // 2
x = n // 2
rate = 44100
total_time = 60
iterations = 2**6
f0 = 440 * pow(2, -4 + 1)
f1 = 440 * pow(2, -4 + 8)
a0, a1 = 2.4, 4.0
import numpy as np
rs = np.linspace(a0, a1, rate * total_time, dtype=np.float64)
wav = np.zeros(len(rs), dtype=np.float64)
xs = np.full(len(rs), 0.5, dtype=np.float64)
This file has been truncated, but you can view the full file.
1 =
= 0^3 + 0^3 + 1^3
= -8^3 + -6^3 + 9^3
= -12^3 + 9^3 + 10^3
= -103^3 + 64^3 + 94^3
= -138^3 + -71^3 + 144^3
= -150^3 + 73^3 + 144^3
= -138^3 + -135^3 + 172^3
= -249^3 + 135^3 + 235^3
= -495^3 + 334^3 + 438^3
#!/usr/bin/env python3
import numpy as np
import imageio
import sys
def negtranspose(a, axes=(0, 1)):
return np.swapaxes(np.flip(np.flip(a, axes[0]), axes[1]), axes[0], axes[1])
#!/usr/bin/python3
import sys
import struct
def main():
# Produce a file with 45899235*repeats of zero bytes
if len(sys.argv) <= 1:
@Centrinia
Centrinia / all_images.cc
Created July 11, 2019 08:38
Generate all 1000x1000 24 bit color images.
#include <cstdint>
typedef std::size_t size_t;
template <typename color_t, typename Func>
void generate_images(size_t width, size_t height, size_t components, color_t limit, Func visit) {
size_t image_size = width * height * components;
color_t* image;
size_t* focus;
#include <stdio.h>
int
main ()
{
int x, y, z;
for (x = 0; x < 256; x++)
{
for (y = 0; y < 256; y++)
@Centrinia
Centrinia / bohlen-pierce.txt
Created February 22, 2019 15:44
Bohlen-Pierce Scales
0:00:00 :
0:00:01 : 13
0:00:03 : 2 - 11
0:00:05 : 4 - 9
0:00:07 : 6 - 7
0:00:09 : 8 - 5
0:00:11 : 10 - 3
0:00:13 : 12 - 1
0:00:15 : 1 - 1 - 11
0:00:18 : 1 - 3 - 9