Skip to content

Instantly share code, notes, and snippets.

@XerxesZorgon
XerxesZorgon / MainActivity.kt
Created April 7, 2025 15:00
Buckaroo Time app for Android. Calculates solar time based on phone's GPS location and UTC time.
package com.example.buckarootime
import android.Manifest
import android.content.pm.PackageManager
import android.os.Bundle
import android.os.Looper
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.