Category: Programming

  • Julia sets in Julia

    I decided to draw some Julia sets for my first little project in Julia: https://github.com/fadend/JuliaSetCycle Example output: I’m pretty happy with that, at least for a start. One thing that has surprised me is the focus on running things via the REPL, which on second thought reminds me of R. See, e.g., How do I…

  • “use of `continue` for control flow is discouraged”

    This comment caught my attention: https://github.com/scikit-agent/scikit-agent/pull/19#discussion_r2112768829 use of continue for control flow is discouraged. Is it? I see Guido cautions against using continue in a finally block in https://peps.python.org/pep-0008/: Use of the flow control statements return/break/continue within the finally suite of a try…finally, where the flow control statement would jump outside the finally suite, is…

  • Percent of Iowans in county with OB Unit

    Following up on my previous post, Obstetrical care in Iowa, I was curious what percentage of Iowans are in a county with an OB Unit. We can get this pretty easily using the handy usdata R package in combination with the data we extracted previously. With this preamble, now we can take a weighted mean…

  • Obstetrical care in Iowa

    The third article in Kalen McCain’s excellent series on maternal healthcare in southeastern Iowa, Barriers aren’t limited to birthdays, features a map from numbered page 14 of ACCESS TO OBSTETRICAL CARE IN IOWA: A REPORT to the IOWA STATE LEGISLATURE – CALENDAR YEAR 2021 [PDF]. This got me wondering what it would take to reproduce…

  • Iowa county seats

    I got the coordinates of the county seats using the utility I previously wrote to get California county seats: The generated CSV is now available here: https://github.com/fadend/county_seat_coords/blob/main/county_seat_coords/generated/ia_usa_county_seats.csv. One complication that it doesn’t handle: Lee County has *two* county seats. A little copying pasting from the R code from the other post produced a pretty okay…

  • Save as “single file” via AppleScript is live in Chrome!

    Back in December 2024, I got to submit a change to Chrome/Chromium adding support for saving as MHTML via AppleScript: https://chromium-review.googlesource.com/c/chromium/src/+/6107133/1 — Adding support for MHTML in Chrome’s Apple Script “save” action. Just now, I noticed that it’s live: It’s a little thing, but I’m excited. Woohoo!

  • California geophytes

    On Reddit, bobtheturd said, “Calscape doesn’t do a good job filtering for geophytes, so wondering which are your favorites. I’m in the Bay Area, so more specifically interested in those.” (The post got some interesting replies.) Calscape describes itself like this: “Calscape is California’s hub for California native plants and native plant gardening, created for…

  • Defining a method outside of a Python class

    I’m having some fun reading the source code for Whisper: https://github.com/openai/whisper. One thing I learned from it that delighted (horrified?) me: you can use a function defined outside of a class to provide the implementation for a method. (E.g., used in their Whisper class.) That’s fun. I don’t have a use case in mind yet…

  • Stripping NULLs recursively from an R list

    Is there a nicer way to do this in R? I have a list where some elements are themselves lists (of lists of lists, etc.) I want to ignore entries with NULL as well as entries that are empty after stripping NULLs.

  • California County Seats

    I had some fun today getting the location of each county seat in California. You can see the code here if you’re curious: https://github.com/fadend/county_seat_coords. The data are pulled from Wikipedia’s List of counties in California. I plotted them going through the tutorial here: https://eriqande.github.io/rep-res-eeb-2017/map-making-in-R.html. (Very nice!) Here’s my ugly R code for doing that, shamelessly…