Day 37: The Limits of Dentistry

I don’t much feel like writing at the moment, as I’ve just returned from the dentist, and had a new hole drilled into my upper jaw in preparation for getting an implant to replace a tooth. The numbing agents are wearing off, and my face is starting to throb.

I don’t keep records, but back in college I had several cavities, and being broke, went to the cheapest dentist I could find (cue the rant about American health insurance). Fast-forward to my 30s, and my new dentist told me that all of those fillings were failing, and some had new decay under them. They needed to be replaced, but one in particular would require removing so much material that a new filling wouldn’t be feasible; I would need to get a gold crown. They were really expensive, as insurance only pays a tiny fraction of what they cost (cue another rant). But, they said, gold crowns are permanent! So I got the crown.

Move on to my 50s. When reviewing my x-rays, the dentist said that there was new decay under the crown. “How was that possible?”, I asked, “I thought that crowns were permanent”. Turns out that “permanent” is a relative term, meaning “about 20 years”.

The decay had spread into the tooth’s roots, so I had to also get a root canal before they could replace the crown. Now that should be that!

Jump ahead to a couple of years ago, and my x-rays showed some smoky area in the jawbone where the tooth was located. An infection! Once again, my question was “How was this possible?”. Apparently the root canal didn’t get every single bit of bacteria, and they had now spread into the bone. The only way to treat it was to extract the tooth, surgically remove the infection, let the bone regrow, and then drill into it for the base of an implant to replace the extracted tooth.

So I started down that road. Each step requires months of healing in between. Finally I had the base inserted in my upper jaw for several months, and the x-rays showed it to be solid, so we proceeded with the next step: removing the inner threaded section that will hold the replacement tooth. This is pretty routine, but when the dentist began unscrewing it, I nearly jumped through the ceiling! Oh man, I hadn’t felt intense pain like that before!

Needless to say, that was not normal. It turns out that in a very small percentage of cases, the soft tissue grows faster than the bone, and infiltrates the implant base. This soft tissue is chock full of nerve endings, and when it got caught in the threads it hurt like hell! The only thing to do at that point is remove the entire implant material (after injecting me with lots of anaesthetic!), and start the whole process again.

So that’s where I am today: after several months of bone regeneration, they drilled into it and inserted a new implant base. Now I just need to wait several more months to see if this one is good.

Day 34: They Grow Up So Fast

Remember that large collection of butterfly eggs that I found almost 2 weeks ago? They’ve been eating, pooping, and growing non-stop ever since.

For some reason it seems that some grow faster than others. I generally keep the very little ones in a small plastic container with their food, as it helps to keep them from wandering off. But once they get big enough (third instar if we’re being technical), I transfer them to a larger mesh enclosure where I can provide more food, and where they can eventually pupate.

About half of the growing caterpillars outpaced their siblings, and so I transferred them to the larger enclosure first. The rest went into a second enclosure a few days later. Now that first group has grown to the point where they are ready to pupate.

When they’re ready, they stop eating, purge any undigested food from their stomachs, and search for a place to attach themselves to transition to a chrysalis. In the wild they can travel pretty far – when I used to let them grow outdoors, I’ve found their chrysalises attached to plants over 25 feet away. To get to those plants they would have had to crawl down the pot they were in, up a two-foot tall stone wall, and then across the garden to the plant.

Being in an enclosure limits their ability to find an attachment site. Sometimes they climb the enclosure itself and attach to either the sides or the top (as Lazarus did), but that’s not ideal, as it makes it hard for me to attend to the others without disturbing them. So I create what I call a Pupation Station.

The new Pupation Station

They are pretty simple: I find a branch with a Y-shape to provide a stable base, cut sections of branch at a slight angle, and then glue them to the base. Most of the time the wandering caterpillars find it, and choose to transition there. Here is a photo from last year’s crop of caterpillars, where 5 of them attached themselves to the branches:

5 Swallowtail chrysalises

So as I mentioned, the first group has already begun the pupation process. Two of them have purged, and have attached themselves to the ceiling of the enclosure. The rest are looking pretty pudgy, and I suspect that they will soon join them.

2- week-old big fat caterpillars

I took the above photo during a feeding/cleaning session. I remove the bundle of parsley and/or rue from the container of water, and separate the stalks with caterpillars from the rest, which is discarded. I take a bunch of fresh parsley, add the stalks with the caterpillars to it, and tie the base with a rubber band. Meanwhile I empty the glass that holds the water, as it is pretty gross from all the caterpillar poop that drops into it. I’ve started adding some round glass pieces to help prevent the caterpillars from drowning, so those have to be washed too. Then everything is carefully re-assembled and placed back into the enclosure.

Speaking of not drowning, I noticed this morning in the enclosure for the slower-growing caterpillars that one of them was partly submerged.

Saved by the glass pieces!

It looks like it had fallen down from the parsley leaves into the water, but since the glass pieces are there, it was able to crawl back up the stems to continue feeding. It made me very happy to know that I had learned from the bad experience of the past, and that adding those pieces saved a caterpillar from drowning.

Day 33: Discipline

Recently an online discussion about film vs. digital photography got me thinking. I absolutely love digital photography, and would never consider going back to film. Sure, it’s really tough to match the richness of color of Kodachrome 64, or the detail and subtle gradation of 4×5 black and white film, but to me, those are not the most important things when creating art. Those considerations are more like a measure of craftmanship than critical elements for conveying an idea.

However, I am so grateful that I grew up in the age of film photography because of the discipline it instilled in me. Every time you pressed the shutter button, you were spending money. Period. Contrast that to today, where images cost nothing: take a bunch of bad shots, who cares? Click the little trash can icon, and they’re gone. Doesn’t cost a cent.

If you were a poor, struggling student, as I was at the time, buying film was a good chunk of what was left of your money after paying for rent, food, and other essentials. So if I saw something interesting to photograph, I didn’t fire away, taking several exposures from a few different angles in the hope that one would be what I needed. Instead, I composed the image in the viewfinder, looking at it from various angles, and through this process learned to recognize what was important for the final image. Most of the time I walked away without taking the shot, because on further reflection, it didn’t seem worth it.

What if I had had lots of money to spend? I believe that I would not have developed the visual discipline that I have today, as there would never have been a need to limit what I shot. Without that discipline, I don’t believe that I would have become as good a photographer. Even today, with all my digital equipment, I still shoot as though every exposure means something.

In general, scarcity forces one to become disciplined. For example, when you grow up in an environment where food is in short supply, you learn not to waste anything, and to only eat enough to keep going. Back in the early days of computing, when both disk storage and RAM were expensive, you coded in a way to ensure that your program would fit into memory, and would require as little space as possible when written to disk. That parsimonious approach resulted in the “640K Ought to be Enough for Anyone” quote that Bill Gates never said, but keeps getting repeated anyway.

There’s something to be said for learning how to get through tough times. It’s a delicate balance, though – too much scarcity can damage you physically and/or psychologically. My mom grew up as one of six kids in a family during the Great Depression, and it definitely left its mark on her. She wasn’t a full-blown hoarder, but she definitely had a hard time throwing things away – “you never know when you might need it!” was her refrain. And we were not allowed to be fussy about the food we were served at mealtimes: you had to eat every bit on your plate before you could leave the table. That experience has had an effect on me, as I really hate to throw food out. Maybe it’s my mom’s voice still echoing in my mind.

Day 32: Caterpillar Update

Last week I wrote about the experience of finding over 30 caterpillar eggs at once, when typically I only find a few. So I thought I’d post an update on how they are doing.

A few days old

As far as I can tell, all of the eggs hatched. It’s hard to say for sure because in the two days after the initial finding, I found 5 more eggs, and then shortly after that, two baby caterpillars, like the ones in the photo above. So honestly I’ve lost count. Suffice to say that there are many, many caterpillars crawling around and eating like crazy!

Second Instar caterpillar among its smaller siblings.

When they’re this small, they are mostly black with a band of white around their middle. This is actually a form of camouflage, as it makes them look a bit like bird poop. Yes, bird poop mimicry is actually a thing! They keep eating and growing until they need to shed their skin to get larger. They look a little different in this next phase, or instar, besides the obvious part of being bigger.

I keep them in a plastic container until they reach the third instar, at which point I move them to a bigger enclosure where I can provide more food for them. It’s important to keep them contained, because they do like to wander!

Last night I moved a lot of them to the larger container, but there were a few that had wandered away from the food, and were just hanging out motionless. Usually if you place a bit of food in front of them, they crawl on top and start eating, but not these caterpillars – they weren’t interested.

In the morning, though, I checked in on these stragglers, and saw this:

Leaving the old skin behind

The dark, crumpled-up bit on the left is the old skin from its previous instar. The new, much bigger third instar caterpillar emerged by attaching the back section of its body to the surface with some silk, splitting the skin at the head, and then crawling forward, leaving the old skin behind. A short while later it definitely was interested in the sprig of parsley I placed in front of it, so once it was aboard, I transferred that sprig and its passenger to the larger enclosure. There they’ll continue to eat and poop for a few days, until an internal trigger tells them it’s time to move on…

Day 31: Using etcd As a Mediator

etcd is a database originally developed by CoreOS, and is most famously used as the database at the heart of Kubernetes. It is a distributed key-value store, which in itself is not all that remarkable. The thing about etcd that makes it so attractive is the ability to watch a key for changes.

Other key/value stores, such as Redis, have implemented a similar feature, and may work just as well for you. I’ve been using etcd for years, and it’s worked well for me, so I’ve never had a reason to try these other tools.

For most data stores, the only way to find if a particular value has changed is to poll. You issue a query for that value on a regular basis, and compare it to the last value returned to see if it has changed. This is terribly inefficient, especially with values that don’t change often. It’s also inexact with respect time, because your system’s reaction to a changed value depends on the interval between polls. Longer intervals, while less chatty, mean that more time will elapse between when the value changes, and when your application responds to that change.

Enter etcd. Instead of polling an etcd server for changes, you can watch for changes. This is essentially a pubsub system that requires almost no configuration to work. When a key is written to etcd, if there are any watchers for that key, a message is sent to them with the new value.

This is kind of dry in theory, so let’s look at a real-world application using this system: my photoviewer and photoserver applications. These applications allow me to display photographs on monitors that can be anywhere with an internet connection, and control each of those displays from a central server. They represent the ultimate convergence of my work as an artist and my love of programming.

Each display consists of a monitor (actually a TV, but all I want is an HDMI input) and a Raspberry Pi that runs the photoviewer application. Each display has a unique ID to identify it, and when a display starts up, it registers itself with the server. The server contains the settings for that display, such as the list of photos to display, and how often to change the displayed photo.

Photoviewer running in my kitchen

I have one such display in the kitchen of my home, and like to change the photos displayed on it from time to time. To do that, I go into my photoserver app and change the album for that display. Almost instantly the image on the display changes. How did that happen? The server is a virtual machine running in the Digital Ocean cloud, not local to the kitchen display.

The reason this works is that I’m also running an etcd server on another cloud instance. When I change any setting for a display, the photoserver app writes a new value for that display’s key. The key consists of the unique ID of the display plus the type of value being changed. For example, if I change the photos I want displayed for a display with the ID of 65febdde-3e8a-4c76-ab8f-d8a653e466c7, the server would write a value of a list of the names of those images to the key /551a441f-8aba-44b5-b70b-349af0be5b67:images.

That application uses the etcd3 library to watch my etcd server for changes to any key beginning with /<unique ID>. The watch() method is called with a callback method, and when a new key is written beginning with that display’s prefix, the value is sent to the callback.

The callback method sees that the full key ends with :images, so it passes the value (the list of image names) to the photo display method, which then retrieves the image and displays it. This happens in real time, without any polling of the server needed.

The original version of these apps used the traditional polling method, which seemed wasteful, considering that it was typically weeks between any changes being made. Switching to an etcd watch makes much more sense from a design perspective, and it greatly simplified the code.

Look for cases in your applications where a response is needed to a change in data. Using etcd as a mediator might be a good approach.