Skip to content

Instantly share code, notes, and snippets.

@XerxesZorgon
XerxesZorgon / redflag.jl
Created September 28, 2024 01:21
Solves a geometry problem using linear algebra and Heron's formula
#=
Solves a geometry problem using linear algebra and Heron's formula
See: Red Flag Day Geometry
using Revise
Load with: includet("redflag.jl")
=#
using LinearAlgebra
/*
The PI License
Finds a four digit prime number n such that n is
- Balanced: A prime equidistant from the previous and subsequent prime numbers.
- Odious: A number is odious if the binary representation of the number as an odd number of 1's, and is evil if the number of 1's is even.
- Happy: Add the squares of the digits to get a new number. Continue the process and if you ever get to $1$, the original number is happy.
- Apocalyptic: If 2^n contains the sequence 666, then n is apocalyptic.
Author: John Peach
@XerxesZorgon
XerxesZorgon / shock_tube.geo
Created June 18, 2024 19:48
Simple 2D Gmsh shock tube model
// Gmsh project created on Mon Jun 17, 2024
SetFactory("OpenCASCADE");
// Define points
L = 0.5; // Tube length
H = 0.05; // Tube width
N = 10; // Number of rectangles along length of the tube
Point(1) = {0, 0, 0, 1.0};
Point(2) = {L, 0, 0, 1.0};
Point(3) = {L, H, 0, 1.0};
@XerxesZorgon
XerxesZorgon / CSG_example.scad
Created June 18, 2024 19:46
OpenSCAD model of CSG tree
// Shape parameters
sphereRadius = 0.65;
cylinderRadius = 0.3;
cylinderHeight = 1.1;
// Top level difference operation
difference(){
// Intersection of cube and sphere
intersection(){
@XerxesZorgon
XerxesZorgon / goldfish-conjecture.ipynb
Created June 5, 2024 01:31
Calculations for the Student's t-test using Python in a JupyterLab notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XerxesZorgon
XerxesZorgon / stefan-boltzmann-revisited.ipynb
Created May 28, 2024 19:17
Earth temperature from the Stefan-Boltzmann Law
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XerxesZorgon
XerxesZorgon / Fibonacci.html
Created February 2, 2024 19:36
Geogebra worksheet showing rotations/scaling for a linear transformation
<!DOCTYPE html>
<html>
<head>
<meta name=viewport content="width=device-width,initial-scale=1">
<meta charset="utf-8"/>
<script src="https://cdn.geogebra.org/apps/deployggb.js"></script>
</head>
<body>
<div id="ggbApplet"></div>
@XerxesZorgon
XerxesZorgon / Bretscher_sequence.ipynb
Created February 2, 2024 19:24
Spectral decomposition of 2x2 matrix defining recursive sequence, in Mathematica
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XerxesZorgon
XerxesZorgon / Problem2024.ipynb
Created February 2, 2024 19:23
Spectral decomposition of 2x2 matrix defining recursive sequence, in Julia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XerxesZorgon
XerxesZorgon / Attack rate.csv
Created November 12, 2023 14:55
Data used in HeuristicLab to estimate attack rate from relative risk (Hr)
x logx Hr Fit
0.000222026 -3.653596397 0.356389604 -0.125
0.000279034 -3.55434296 0.356389604 -0.125
0.00035068 -3.455089522 0.37470064 0
0.000440721 -3.355836085 0.37470064 0
0.000553882 -3.256582648 0.502877892 0.125
0.000696099 -3.157329211 0.557811 0.125
0.000874831 -3.058075774 0.637158823 0.25
0.001099456 -2.958822336 0.692091931 0.375
0.001381755 -2.859568899 0.917928042 0.5