Skip to content

Instantly share code, notes, and snippets.

View howerj's full-sized avatar

Richard James Howe howerj

View GitHub Profile
@skeeto
skeeto / example.c
Last active December 30, 2025 01:00
Code for "Examples of quick hash tables and dynamic arrays in C"
// Examples of quick hash tables and dynamic arrays in C
// https://nullprogram.com/blog/2025/01/19/
// This is free and unencumbered software released into the public domain.
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@howerj
howerj / if.c
Created April 6, 2023 21:39
Operators for comparision using only SUBLEQ
/* This short program uses Less-Than-Or-Equal-To-Zero
* to create the various signed comparison operators.
*
* The reason for this program is to understand how
* those operators can be implemented on a SUBLEQ
* One Instruction Set Computer.
*
* It is trivial to construct addition, subtraction
* and branching with the SUBLEQ machine, but the
* comparison and bitwise operators are more complex.
/** A simple kalman filter example by Adrian Boeing
www.adrianboeing.com
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double frand() {
return 2*((rand()/(double)RAND_MAX) - 0.5);