Skip to content

Instantly share code, notes, and snippets.

View chemoelectric's full-sized avatar

Barry Schwartz chemoelectric

View GitHub Profile
@chemoelectric
chemoelectric / gist:817e70db66dd4ae75b37fbe90c725a65
Created May 8, 2026 10:51
Integer radix trees in generic C
/*
The hiha programming language
Copyright © 2026 Barry Schwartz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@chemoelectric
chemoelectric / chem_unique_id.m4
Created April 15, 2026 20:46
Autoconf m4 code to find shell code that produces a unique identifier without spaces
# Copyright (C) 2025 Barry Schwartz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# serial 2
# chem_unique_id([CHEM_UNIQUE_ID([VAR])
@chemoelectric
chemoelectric / n-queens
Created March 22, 2026 01:47
n-queens solution in R⁷RS Scheme using circular lists extensively, so it cannot be translated to R⁶RS. Thus showing R⁶RS is the more retrograde standard.
#!/usr/bin/env scheme-r7rs
(import (scheme base)
(scheme list)
(scheme write)
(scheme process-context))
;;; Generate solutions to the n-queens problem.
;;;
;;; This implementation is based *very* closely on a Fortran solution
;;; by Barry Schwartz, and in turn *extremely* loosely on the public
@chemoelectric
chemoelectric / eprb_simulation.adb
Last active August 21, 2023 22:21
Ada simulation of an EPR-B experiment, showing that the correlations are due to polarization, not ‘entanglement’ or ‘non-locality’
--********************************************************************
-- This is free and unencumbered software released into the public domain.
-- Anyone is free to copy, modify, publish, use, compile, sell, or
-- distribute this software, either in source code form or as a compiled
-- binary, for any purpose, commercial or non-commercial, and by any
-- means.
-- In jurisdictions that recognize copyright laws, the author or authors
-- of this software dedicate any and all copyright interest in the