If you run
#lang dtc/frames/animations
(animate `(1 2 3))
as a script from the command line in Ubuntu 25.04, the result is:
invalid memory reference. Some debugging context lost
If you run
#lang dtc/frames/animations
(animate `(1 2 3))
as a script from the command line in Ubuntu 25.04, the result is:
invalid memory reference. Some debugging context lost
| #!/usr/bin/env racket | |
| ;;;; Support code for my shell "gitcd" function: if you are in a git | |
| ;;;; repo, but not in the worktree part -- you're in a regular repo | |
| ;;;; somewhere inside the .git directory, or in a bare git repo -- the | |
| ;;;; usual "git rev-parse --show-toplevel" stuff doesn't work. | |
| ;;;; | |
| ;;;; The code here detects those situations where rev-parse fails: it | |
| ;;;; looks for either ".git" somewhere in the current directory's | |
| ;;;; ancestry, or "reponame.git" in the cwd ancestry. |
| ;; Inspired by this blog post on "let's surround": | |
| ;; https://arialdomartini.github.io/emacs-surround-2 and | |
| ;; https://www.emacswiki.org/emacs/SurroundRegion. | |
| ;; | |
| ;; Notable bits: | |
| ;; | |
| ;; - Specifying =open= as a default value in the closing delimiter completing | |
| ;; read -- that allows the user to hit return to re-use the opening | |
| ;; delimiter for the closing one. | |
| ;; - This moves point accordingly, so that you can make repeated calls to |
You can write Markdown content and is should work as expected with links and such.
Moreoever, because this is github, there's git's revision control behind the scenes.
Here's a typo that I'll fix...click Edit in the top right, and edit away. Then see your changes in the Revisions tab from the upper left.
| """ | |
| Print a "continuous" calendar -- as a ribbon / candy bar: | |
| https://davidseah.com/node/compact-calendar/ | |
| https://docs.python.org/3/library/calendar.html | |
| Example output: | |
| >>> calendar.setfirstweekday(1) | |
| >>> print(domonths(2023, 9, 6)) |
| ; Emacs has two mark rings: a buffer-local one, and a global one. I always get confused with them; my mental model | |
| ; is that there ought to be just one mark ring. I want to implement that without trampling over the existing mark | |
| ; ring stuff. Here's a first draft at doing so: I just add a hook so that anytime the mark is set, we append to | |
| ; my own personal mark ring, and then I have a function that is basically a copy-and-paste of pop-to-mark-command. | |
| ; This...seems to work? I am (1) stunned that it was so easy, and (2) suspcious that this ought to be unnecessary | |
| ; if I really understand the mark rings and used them correctly. | |
| ; Thanks to https://mathstodon.xyz/@vernon@emacs.ch for pushing me to try this; see https://mathstodon.xyz/@vernon@emacs.ch/109913166908490838 | |
| ; and my replies. |
| # Python code accompanying https://ddrake.prose.sh/base_ten_without_zero | |
| def T_to_zero(Tnum): | |
| """Convert a number (provided as a string) written with "T" notation | |
| to a Python integer, which by default is displayed using the | |
| ordinary positional notation with "0". | |
| """ | |
| T_digit_to_int = {str(i): i for i in range(1, 10)} | |
| T_digit_to_int['T'] = 10 | |
| return sum(10**p * T_digit_to_int[d] for p, d in enumerate(reversed(Tnum))) |
Here are the rules for what I call Trice -- it's a trick-taking dice game. The name comes from trick-taking, and that it plays quickly.
| select * from THINGS_IM_GONNA_DO where | |
| thing = "give you up" or | |
| thing = "let you down" or | |
| thing = "run around and desert you" or | |
| thing = "make you cry" or | |
| thing = "say goodbye" or | |
| thing = "tell a lie and hurt you"; | |
| select count(*) from problems; | |
| 99 |
| /* Like join.c, but I want to see if multiple threads can wait on a single | |
| condition. It looks like `pthread_cond_broadcast` is the API function for this. | |
| What's weird is that this has some kind of race condition in it. I've seen: | |
| * only the parent woken up | |
| * parent and child2 woken up | |
| * child2 woken up twice! | |
| */ |