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
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
#define SAMPLE_RATE 8000.0 | |
// Sample output | |
void outsample( float v ) | |
{ | |
// Clamp |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <complex.h> | |
#include <argp.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> |
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
/* | |
A crude utility to repeat file contents n times. | |
As far as I know, there's no UNIX tool to that yet. | |
2018, Jacek Wieczorek | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> |
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
/* | |
Utility to create *.mif (Memory Initialization File) for Quartus. | |
Usage: | |
cat file.bin | mkmif <WIDTH> <COUNT> > out.mif | |
by Jacek Wieczorek, 2018 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
#define SAMPLE_RATE 8000.0 | |
// Sample output | |
void outsample( float v ) | |
{ | |
// Clamp |
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
#include "dcf.h" | |
#include <time.h> | |
#include <inttypes.h> | |
// 8-bit BCD decoder | |
// Requires n > 0 | |
static uint8_t dcf_decode_bcd( uint8_t *frame, uint8_t start, uint8_t n ) | |
{ | |
uint8_t val = 0; | |
uint8_t b = 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
#include "dcf.h" | |
#include <time.h> | |
#include <inttypes.h> | |
// 8-bit BCD decoder | |
static inline int dcf_decode_bcd( uint8_t bits ) | |
{ | |
return ( bits & 0x0f ) + 10 * ( ( bits >> 4 ) & 0x0f ); | |
} |
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
#!/usr/bin/env python3 | |
import gi | |
gi.require_version( "Playerctl", "1.0" ) | |
from gi.repository import Playerctl, GLib | |
import time, sys | |
player = Playerctl.Player() | |
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
#include "cuos.hpp" | |
#include <libpng16/png.h> | |
#include <GL/glew.h> | |
#include <dirent.h> | |
#ifdef __cplusplus | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> |
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
function mkroom(x, y, w, h, id) | |
local room = { | |
x = x, | |
y = y, | |
w = w, | |
h = h, | |
adj = {}, | |
id = id or 0 | |
}; |