Skip to content

Instantly share code, notes, and snippets.

View padenot's full-sized avatar
🦊
foxing

Paul Adenot padenot

🦊
foxing
View GitHub Profile
import pandas as pd
import matplotlib.pyplot as plt
import json
import numpy as np
import sys
# Load data from JSON file
with open(sys.argv[1], 'r') as f:
data = json.load(f)
@padenot
padenot / compress.sh
Created February 10, 2025 15:51
compression bench
#!/bin/bash
OUTPUT_DIR="compressed_output"
FILES=("model.enet.intgemm.alphas.bin" "model.jaen.intgemm.alphas.bin")
LEVELS=(1 3 9)
ZSTD_LEVELS=(1 5 19)
mkdir -p "$OUTPUT_DIR"
for file in "${FILES[@]}"; do
@padenot
padenot / addition
Created January 23, 2025 12:42
fouineur api.md
+---------------+---------+-------------------+--------+----------------------------------------------------------+
| `sortv` | 1 | `ts` | `ts` | Returns a time series, sorted by value |
+---------------+---------+-------------------+--------+----------------------------------------------------------+
| `sortt` | 1 | `ts` | `ts` | Returns a time series, sorted by time |
+---------------+---------+-------------------+--------+----------------------------------------------------------+
| `slice` | 3 | `ts`, `s`, `s` | `ts` | Returns subset of time series by index |
+---------------+---------+-------------------+--------+----------------------------------------------------------+
| `sliceperc` | 3 | `ts`, `s`, `s` | `ts` | Returns subset of time series by percentage |
+---------------+---------+-------------------+--------+----------------------------------------

Install netlify:

npm install -g netlify-cli

Set it up like so, this will open a few web pages and create a netlify account with github login, authorize netlify, setup the github hook for deploy, etc.:

repositories/ringbuf.js::master$ netlify init
Logging into your Netlify account...
Opening https://app.netlify.com/authorize?response_type=ticket&ticket=e527b77c4d5c2a95a57c063ccb193459
if (window.SIMD) {
// yay, SIMD available, let's do a little stereo mixdown routine
for (var i = 0; i < bufsize; i+=4) {
var lhs = SIMD.float32x4(left[i+0], left[i+1],
left[i+2], left[i+3]),
rhs = SIMD.float32x4(right[i+0], right[i+1],
right[i+2], right[i+3]),
mixdown = SIMD.float32x4();
mixdown = lhs.add(rhs);
@padenot
padenot / index.html
Created December 5, 2014 23:32
Start of a test for setValueCurveAtTime
<script>
function lalaj() {
var out = document.querySelector("pre");
var a = new OfflineAudioContext(1, 44100, 44100);
var b = a.createBuffer(1, 44100, 44100);
var g = a.createGain();
var bb = b.getChannelData(0);
for (var i = 0; i < bb.length; i++) {
bb[i] = 1.0;
}
@padenot
padenot / blur.js
Created June 25, 2014 09:08
fast black and white gaussian blur on canvas in js
/* vertical blur of blur_px. for efficiency, we copy a vertical
* line to a buffer so that access are made in a cache efficient
* manner */
function vblur(b, blur_px) {
var buf = new Uint8ClampedArray(h * 4);
for (var vertical = 0; vertical < w; vertical++) {
copy_vertical_in_buffer(b, vertical, buf);
blur_scanline(buf, 0, h, blur_px);
// Converts a spec made with ReSpec to a cheat sheet
// Shift + f4 in Firefox, copy, paste, enjoy
var idl = document.querySelectorAll(".idl");
var cs = document.createElement("div");
cs.className = "lalala123123"
for (var i of idl) {
cs.appendChild(i);
- Web Audio Feature requests: https://github.com/WebAudio/web-audio-api/issues
- Web Audio mailing list: http://lists.w3.org/Archives/Public/public-audio/
- General web feature requests: http://www.whatwg.org/mailing-list
- Other GitHub repos for other whatwg specs, https://github.com/whatwg/
- Twitter to a person you know that implements / specs this kind of stuff, but prefer public venues so you get maximum visibility, and maximize your chances to get an answer
#!/usr/bin/env python
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import os
import sys
data = {}