Skip to content

Instantly share code, notes, and snippets.

@cavedave
cavedave / spring3.ipynb
Created June 6, 2025 09:36
Spring3.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / armagh-weather.ipynb
Last active June 4, 2025 09:15
armagh-weather.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / dollar.ipynb
Created June 1, 2025 17:44
dollar.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / nationalgallery.ipynb
Created May 26, 2025 18:26
NationalGallery.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / code
Last active May 25, 2025 14:33
The pointer that never lies. 1. put the code below into microbit 2. attache a kitronik 25105 servo to the microbit. ask questions like 'Does Daddy Smell?'
input.onButtonPressed(Button.A, function () {
angle = 110
// quick label
basic.showString("L")
pins.servoWritePin(AnalogPin.P0, angle)
basic.pause(200)
})
input.onButtonPressed(Button.B, function () {
angle = 0
basic.showString("R")
lyric subject date subject2 birth_year death_year category
"Harry Truman" Harry S. Truman November 2, 1948 Harry S. Truman 1884.0 1972.0 Politics
"Doris Day" Doris Day June 25, 1948 Doris Day 1922.0 2019.0 Entertainment
"Red China" Proclamation of the People's Republic of China October 1, 1949
"Johnnie Ray" Johnnie Ray 1949 Johnnie Ray 1927.0 1990.0 Entertainment
"South Pacific" South Pacific (musical) April 7, 1949
"Walter Winchell" Walter Winchell 1950 Walter Winchell 1897.0 1972.0 Other
"Joe DiMaggio" Joe DiMaggio February 7, 1949 Joe DiMaggio 1914.0 1999.0 Sports
"Joe McCarthy" Joseph McCarthy February 9, 1950 Joe McCarthy 1908.0 1957.0 Politics
"Richard Nixon" Richard Nixon November 7, 1950 Richard Nixon 1913.0 1994.0 Politics
@cavedave
cavedave / vesuvius.ipynb
Created May 14, 2025 09:08
vesuvius.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cavedave
cavedave / smalln.py
Created May 13, 2025 15:05
Chess puzzle by Martin Gardner: Place a queen, king, bishop, rook, and knight on a 4 by 4 chessboard so that no pieces is attacking any other.
from z3 import *
from itertools import combinations
# === Parameters ===
N = 4 # Board size
solver = Solver()
# === Helper functions ===
def z3_abs(x):
return If(x >= 0, x, -x)
Start year End year Number of days of Pontificate (max) English name Place of birth Age at start of papacy Age at end of papacy Country Country_clean
2025 Leo XIV Chicago 69 Chicago USA
2013 2025.0 4422 Francis I Buenos Aires 76 88 Buenos Aires Argentina
2005 2013.0 2870 Benedict XVI Marktl am Inn, Bavaria, Germany 78 85 Germany Germany
1978 2005.0 9658 John Paul II Wadowice, Poland 58 84 Poland Poland
1978 1978.0 33 John Paul I Forno di Canale, Veneto, Italy 65 65 Italy Italy
1963 1978.0 5521 Paul VI Concesio, Brescia, Italy 65 80 Italy Italy
1958 1963.0 1678 John XXIII Sotto il Monte, Bergamo, Italy 76 81 Italy Italy
1939 1958.0 7156 Pius XII Rome, Italy 63 82 Italy Italy
1922 1939.0 6209 Pius XI Desio, Lombardy-Venetia, Austrian Empire 64 81 Austrian Empire Italy
@cavedave
cavedave / may1st.ipynb
Created May 8, 2025 12:35
may1st.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.