Kathy Canary's Obituary

My mother passed away last week.

My mother passed away last week.

Kathryn (Kathy) Carroll Canary
January 13, 1943 – December 13, 2024

Born Kathryn Ann Carroll on January 13, 1943, in Wilmington, North Carolina, to David Shields Carroll (1917–1992) and Mary Kathryn (McGuire) Carroll (1918–1960), Kathy Canary passed away on December 13, 2024, in Raleigh, North Carolina. Kathy grew up in Memphis, Tennessee, and moved several times, living in Virginia, Florida, and North Carolina. She held a bachelor's degree in Elementary Education from the University of Tennessee, Knoxville. She married Hal Winchester Canary (1943–2018) in 1966, they were married 52 happy years with their only child born in 1978.

Kathy will be remembered for the joy she found in teaching and volunteering. She was a talented artist and enjoyed painting landscapes, botanicals, and abstracts. She adored her son, granddaughter, and grandson.

Kathy is survived by her siblings David S. Carroll, Jr, of Memphis, Tennessee, and Elizabeth (Carroll) Busch of Burke, Virginia, as well as her son Hal W. Canary, III, of Durham, North Carolina, and grandchildren Margaret R. Canary and Thaddeus W. Canary.

A visitation followed by a burial service will be held at Memorial Park Cemetery (5667 Poplar Avenue, Memphis, Tennessee) on Saturday January 18, 2025, at 12:30 and 1:30 p.m. One may make a donation in Kathy's memory to Arts For Life of North Carolina (artsforlifenc).


Python Object JSON Encoder

How to JSON-encode any Python object.

How to JSON-encode any Python object.
#! /usr/bin/env python3

import json

class ObjectEncoder(json.JSONEncoder):
    def default(self, o):
        try:
            super().default(o)
        except:
            return vars(o)

class Example:
    def __init__(self, x, y):
        self.x = x
        self.y = y

print(ObjectEncoder(indent='  ').encode(Example(42, 24)))

This produces:

{
  "x": 42,
  "y": 24
}

Missing Emoji

Someone should design an emoji that means "thank you". I generally use "👍︎", but I'm not sure that that is the most unambiguous possibility.


Golang Pitfall

Go does not have references.

Go does not have references.

In C++11 one might do the following:

struct Foo {
    int Value;
};

void f() {
    std::vector<Foo> foovec;
    //....
    for (auto& foo : foovec) {
        if (foo.Value > 10) {
            foo.Value = 10;
        }
    }
    //....
}

However, in Go, the following contains a bug:

type Foo struct {
    Value int
}   

func f() {
    var fooslice []Foo
    //....
    for _, foo := range fooslice {
        if foo.Value > 10 {
            foo.Value = 10
        }
    }
}

What I wanted to do was the following:

    for idx, foo := range fooslice {
        if foo.Value > 10 {
            foo.Value = 10
            fooslice[idx] = foo
        }
    }

Git Unstage

Unstaging is the only git action I can never remember.

Unstaging is the only git action I can never remember.

For reference, it is:

git restore --staged FILE[S]

Text-only skymap

Just a list of brightest objects in the sky.

Just a list of brightest objects in the sky.

Sometimes, when I want to quickly identify the planets I see in the early evening and before dawn, the planetarium/sky map app on my phone is sometimes harder to use than I want.

I would love to have an website that uses your location and the time to list the brightest dozen objects in the sky right now, along with current azimuth and altitude.

Living in the city, I can barely see few dozen stars anyway.


Using A Theorem Prover

I reccomend the Lean4 Natural Number Game.

I reccomend the Lean4 Natural Number Game.

I was playing around with the Lean4 Natural Number Game. (Via this discussion.) I really like this way of doing mathematics. Maybe in the future, all upper-level math classes will use this software for homework. And all math papers too (Professor Tao is working on formalizing his papers in Lean4!)


Building a Better House.

Houses should last for hundreds of years and be easy to inspect, maintain, and upgrade.

Houses should last for hundreds of years and be easy to inspect, maintain, and upgrade.

I think about this all too often.

"How to design a house to last 1000 years" by Brian Potter.

"The Perfect Wall" by Joseph Lstiburek.

Oh, and sofas too.


Can the US House of Representatives function without a speaker or with a speaker with limited power?

A way to let the house pass any bill that gets enough votes, without leadership involement.

A way to let the house pass any bill that gets enough votes, without leadership involement.

Can the US House of Representatives function without a speaker or with a speaker with limited power?

Expanding on a previous thought.

The house should adopt a new method of passing laws & resolutions:

  • There will be a server that anyone can read from and any member of the house can upload a proposed law to.

  • Any bill that passes the Senate is immediately uploaded to the server without modification.

  • The text of the bill will then be hashed to produce a cryptographic checksum used to identify a law.

  • Any member can amend (modify) a bill, which produces a new identifier.

  • Any member can vote in favor of any bill (identified by checksum) electronicly via secure methods. That vote is public.

  • Any member may un-vote for a bill they have already voted for via the same procedure. This action also goes into the public record.

  • If a bill gets 218 (=floor(N/2)+1) votes in favor (at the same time), it is passed the house and sent to the Senate.

  • Bills are deprecated at the end of the term. There may be other ways of deprecating a bill.


“Rule number one, never carry anything you don’t control.”

On using networked computers you don't understand.

On using networked computers you don't understand.

“Rule number one, never carry anything you don’t control.” (See Andor.)

How would one follow this advice in this world?

One would need only computers with a 100% open source stack. Including hardware.

Imagine starting with a mass-produced phone-sized touchscreen and battery that contained zero processors. You would then build a computer that plugs into that and screws onto the back. That would be your smartphone. You control all processors.

Imagine a RaspberryPi-Zero-style RISC-V computer that was 100% open on every integrated circuit. you could use that as the core of your fully-secure smartphone.

You would need to reverse-engineer a bunch of currently-opaque hardware that's hidden in special-purpose chips. E.g. cell network antenna drivers.

I would also build the hardware such that a led lights up whenever a camera or microphone is enabled, without the ability to change that in software.

And the software stack would need to be controlled by a non-profit with a long history of respecting users. Maybe Debian? I'd love just to have a phone that runs Debian!

It looks like there are several raspberryPi-based phone designs out there. My main problem with that is that it uses processors made by Broadcom Inc. These system-on-a-chip processors are wonderful technology, but the hardware is closed-source, and has closed-source firmware and graphics drivers.

Discuss: https://mastodon.sdf.org/@hal_canary/109710865869979581