Skip to main content

Posts

Showing posts from April, 2024

Week Notes: Elevation Specified and Mostly Solved; Datasette Spatialite Windows Fix;

 It's been a busy and fun week again! Most of my time was spenting finalizing what the elevation profile Datasette enrichment would look like. I finally found the last piece of the puzzle laying around in a pile of Jinja template use practice. One of the goals this week will be to release the elevation package. I made my first pull request for an open source project, datasette, in this case. (I make them at workr, but this is my first foray into the wider world.)  ChatGPT provided the final kick to get the elevation maps plotted really eaisly. Subsequently, I learned about the Pyplot package and how to add labels to charts. I got a start back towards writing about dadding. I spruced up some writing I had lying around about cleaning the kitchen with the gang. I found another older piece that I love while checking out old blog entries here: Meerktas and Ravens . Oh, and then this one about what unschooling with toddlers lools like. Goals Release the elevation package Release a

Dads, Kids, Kitchen Cleaning, Executive Function, and Social Emotional Learning

 This is a story from back in February. I wanted to share a cool moment in time that Mota, Tawnse, and I had on Monday. Daize had gone off to attend College Algebra, and I was working from the house. I walked into the kitchen and it looked like a portion of the recent bomb cyclone had landed in there. I had 25 minutes to kill, so I called Motaand Tawnse. When they arrived, I was already taking the recycling bag out to the garage. I asked them to empty the dishwasher and they got to work. When I returned, I moved everything off the stove into one sink. I asked them to load the dishwasher back up. While they were doing that, I got to work on scrubbing pans. As I did, I looked around the kitchen. I noticed a few dishes they’d missed, pointed it out, and they plopped those in as well. I asked them to check the rest of the house for dishes. While they were checking, I finished the pans, and got to work on cleaning the stove top. When they returned, I asked the two of them to get all the foo

My First GitHub Pull Request; Datasette Windows and Spatialite

 I made my first ever pull request on GitHub this morning! The gang and I still mostly develop code on Windows boxes. It has more to do with the machines we have available to us on any given day than anything else. (The just-sit-down-and-type machine in our house is also for playing video games, so... Windows.) This has led to issues when using our Datasette enabled QSO logger and mapping applications .  Datasette on Windows has an issue with finding the SpatiaLite DLL file. The gang and I worked through the issues and documented our really clunky, blunt force, fix . The fix, however, amounted to changing the source code of Datasette itself on a per installation basis. That meant that if I moved to a new Windows machine I had to find the fix and re-implement it. Even worse, that meant that if I wanted to try something that worked only in a newer version of Datasette, I also had to reimplement the fix. That... Was a Lot. So, I was totally psyched when I got a little bit of time yester

Things I Learned: Adding new DLL locations to Windows via the PATH Envrionment Variable

 This is a note for myself for later when I try to construct a better set of instructions for adding Spatialite to Windows for use with Datasette . You can instruct Windows to look for DLLs in a new directory simply by adding that directory to your PATH envrionment variable via  set PATH=C:\path to your dll;%PATH% via .

Things I Learned: Datasette-Enrichments: The Template Can Be The Optional Arguments

 This is a small thing, but it's going to give me a lot of utility with the enrichments I'm writing. More than once, I've run into the need for an input argument to the enrichments I'm creating. Take the elevation enrichment for example. I'd like the user to be able to specify how long their elevation profile path should be in meters. My slop and drop method for adding an argument to rows of table data would be to simply specify a constant in my SQL query ala  select tx_lat, tx_lng, rx_lat, rx_lng, 200 as optional_meters from qso_table That would result in an extra column containing the number 200 on every row. That also won't work with enrichments for the moment because the operate on filtered tables, not generic SQL queries. That was irksome. The answer though, is simple, elegant even. For each enrichment , the user specifies their input using a template. For the elevation enrichment, the template looks like this: but I could have just as easily typed and now

Things I Learned... Again: Spatialite with Datasette on Windows

 I'm mostly writing this so that the next time I run into this, I'll have a handy set of notes. Many months ago, I found out that Datasette on Windows doesn't like this :             for extension in self.sqlite_extensions:                 # "extension" is either a string path to the extension                  or a 2-item tuple that specifies which entrypoint to load.                 if isinstance(extension, tuple):                     path, entrypoint = extension                     conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])                 else:                     conn.execute("SELECT load_extension(?)", [extension]) instead, it wants to see              for extension in self.sqlite_extensions:                 # "extension" is either a string path to the extension                 # or a 2-item tuple that specifies which entrypoint to load.                 #if isinstance(extension, tuple):                 #    p

Soldersmoke Becomes Cloud Chamber Smoke!

 Bill Meara over at Soldersmoke built a cloud chamber particle detector! He has all the details on the Soldersmoke  blog , including the plans for the detector and a few videos of particle traces. Cloud Chamber de Soldersmoke Between the chamber and the book the plan came from, it all put me in mind of the time Ruidoso High School had not one, not two, but three particle accelerator science fair projects occupying the high school lab. Including a Tesla Coil version, a cyclotron, and one of these highlighted in the plan book Bill links above: From  "The Amateur Scientist" by C. L. Strong  (The cyclotron was mine.)

ChatGPT, Datasette-Extract, and the US Ham Radio General Exam Question Pool

 I started a project, ahem, yesterday to 'quickly' see if ChatGPT could read the entire United States general class amateur radio exam question pool into a Datasette instance using the datasette-extract plugin. As of this morning, I haven't been able to coax ChatGPT using the gpt-4-turbo model. I capture my rather raw notes below. The short version of this is that I was never able to get the AI to capture more than 19 questions at a time. I'm hopeful that the pool could be moved into a database table using iterative processes, but for now, I've run out of time for this quick project :)  Occasionally ChatGPT seemed to hallucinate out part of its process into the table Notes Follow I'm going to track how easy it is to get the general exam question pool into a database using the Datasette Plugin. I started this endeavor at 20:37 UTC. Get my already existent OpenAI API key ready to go 20:43: Done. As usual with OpenAI, the hardest part was finding login screens

Things I'm Learning: Adding Text Encoded Images to Google Earth (Pro and Web)

 This project has been going on for a while, but remember, the point of the elevation profile project was to add the elevation profile between our ham radio—Project TouCans—and the receiving station at the other end of a QSO to the map of the QSO itself. This week, I finally got to start work on the maps themselves, and I've found a few things. First, an image added to a Placemark description without a  width="100%" tag will overflow the pane that Google Earth Web creates for the Placemark A user can scroll the chart horizontally, but theOh  information isn't all visible at once. Adding the width tag back in fixes the issue on Google Earth Web, but leaves Google Earth Pro with a very small chart I thought a good compromise between the two might be to house the image in its own div. For Google Earth Web we get but on Google Earth Pro we still get the tiny chart: It seems the only way to get this done will be to learn the new Google Earth kml 'Carousel' extensio

Finalizing Thoughts on the Elevation API Datasette Enrichment for Ham Radio QSO Paths

 I've outlined the work on the ham radio QSO Google Maps Elevation API Datasette Enrichment  (try saying that 3 times fast) over the last several days.  What I haven't talked about much, but thought about pretty often is what the released elevation enrichment should do. Here goes. The Datasette enrichment will store the JSON data returned from the Elevation format in a database column named 'elevation'. Remember, the enrichment is taking two coordinate pairs that form a QSO like the brown line shown between Villa Nueva, NM and Idaho (KJ7DT's QTH). It then determines the endpoint of a line that only covers the first 200 meters of that path, shown as the blue line below: (Yes, 8 year-old Tawnse and I were sitting on the side of the 'cliff' on the other side of the Pecos River from the campground during that QSO. Yes, Tawnse does have a lower center of gravity than I do and led me up that path. Yes, I did have a heck of a time getting back down once I turned

Things I Learned: Text Encoded Images Work in Google Earth KML Placemark Description Tags

 The project to add elevation profiles to each ham radio QSO on a QSO map is moving along. I've started to prototype inserting elevation charts into the map—via kml—of elevation profiles per QSO today. I had a slight bit of consternation that the charts might not be visible at all after coming across a post on stackoverflow that indicated text encoded images cannot be used as icons in kml files for Google Earth. I am happy to report however, that text encoded images in description fields for kml Placemark tabs work great! A tag like: <Placemark> <name>kj7dt </name> .............. <description> <![CDATA[<div width="400px"<h1>kj7dt </h1>Date/Time GMT: <div><br></div>"2023-02-12T21:58:00"<div><br></div><div><img width="100%" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAH.............. .......FTkSuQmCC"></div></div>]]></descr

Things I Learned: Text Alignment in the PyPlot text Method

 I learned how to arrange labels on PyPlot charts yesterday.  I've mentioned that the scales on the ham radio QSO elevation profiles weren't entirely comparable to one another. Due to the variety off hills, mountain ridges, and coasts the kids and I make POTA activations on, the vertical scales on the elevation chart y axes range from three meters in total to dozens of meters. What's important (and interesting) about the various sites though isn't the sheer number of meters of descent or ascent, but rather, the angle of the terrain with respect to level. That angle gets subtracted from the natural radiation angle of the dipole that houses Project TouCans and, theoretically, extends the distance that TouCans can transmit before bouncing off the F2 layer of the ionosphere. Consequently, rather than determining a scaling algorithm to make all the elevation profile graphs returned for the various QSOs comparable, I elected to simply calculate the slope of the terrain over

Ham Radio QSO Elevation Profiles Up and Running or ChatGPT to the Rescue

 The initial release of the ham radio QSO elevation profiles Datasette enrichment is up and running!  (In the next few days, I expect there to be several posts on this.) First, let's talk about the beauty of ChatGPT for personal coding challenges, my personal coding challenges. Over the course of the last week, I've tugged back and forth at the the problem of moving data from the Google Maps Elevation API into a png chart that I thought was going to be provided by the Google Chart API. All of this work taught me a lot, but did not produce useful results. Yesterday though, I had ChatGPT open seeing what sort of job it could do creating electronic circuit schematics (spoiler: the results aren't pragmatically useful yet, although, they are pretty.) Since I had the app open anyway, I popped over to my ongoing conversation with ChatGPT about my fictional friend Penelope. (You can see her prompt below.) Here's what I jotted down to see if Penelope could solve my charting issu