Category: Programming
-
Errors you might see if you forget `bazel_dep(name = “protobuf” …)
If you forget to include the dependency on protobuf in your MODULE.bazel file while including a cc_proto_library target, you may see errors like the following when you try to build that target: ERROR: /private/var/tmp/…/external/abseil-cpp+/absl/utility/BUILD.bazel: no such target ‘@@abseil-cpp+//absl/utility:if_constexpr’: target ‘if_constexpr’ not declared in package ‘absl/utility’ defined by /private/var/tmp/…/external/abseil-cpp+/absl/utility/BUILD.bazelERROR: /private/var/tmp/…/external/protobuf+/src/google/protobuf/BUILD.bazel:483:11: no such target ‘@@abseil-cpp+//absl/utility:if_constexpr’: target ‘if_constexpr’…
-
Extract attachments from .eml files
I have a need for an implementation of the Knuth-Morris-Pratt algorithm (or similar) handling streaming input. I’m pretty sure I’ve implemented this previously and thought I might my find my code in an old .zip file I’d sent someone in e-mail. But Gmail refuses a direct download of the attachment, I guess due to it…
-
Telling g++ about homebrew-installed lib
I’ve been having fun looking at some code created by a friend/ex-coworker, including https://github.com/hfgong/walker_vose. It makes use of the beloved to me GoogleTest C++ test framework. I guess probably the right thing to do is to set things up via one of the methods mentioned in the GoogleTest docs, Bazel or CMake. (I was very…
-
Undoing perspectival distortion
I have a lot of photos containing a sign or other rectangular object where I’d like to undo the distortion that comes from having the plane of the camera not exactly parallel to the plane of the rectangle. I’ve also been wanting to play with Tauri, a framework for creating apps, for a while. So,…
-
Fun with Xorshift
I’ve been hacking on an old game I wrote for the school paper I founded: Hangman. (Code: https://github.com/fadend/hangman.) One feature I like: the ability to create your own games with a shareable link. Here’s one for you: https://revfad.com/hangman/?w=JVFUVAT+LBH+N+JBAQRESHY+QNL. Since I didn’t want the URL parameter to give away the answer, I have the game run…
-
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…