Skip to content

Instantly share code, notes, and snippets.

/*
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
@XerxesZorgon
XerxesZorgon / Normalized speaking coughing.csv
Created November 12, 2023 14:53
Virus droplet diameter data for Veusz worksheet NormalizedDiamters.vsz
Diam Speaking Coughing Ratio Counts
3 0.052829091 0.05826629 0.906683629 0.05554769
6 0.207200481 0.201454534 1.028522303 0.204327507
12 0.311449996 0.333187718 0.934758332 0.322318857
20 0.159914164 0.179976297 0.888529026 0.169945231
28 0.096156561 0.085830027 1.120313771 0.090993294
36 0.047840788 0.048243113 0.991660483 0.04804195
45 0.023751532 0.021037346 1.129017519 0.022394439
62.5 0.028075245 0.026764876 1.048958533 0.027420061
87.5 0.01935919 0.015309816 1.264495204 0.017334503