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.

Day 30: It Ain’t Over

It’s tiring. I get it. Dealing with the pandemic is exhausting: wondering if any time you touch something that you’re picking up the virus, or if that person is walking by a little to close, or if it’s worth the risk to pick up some fresh vegetables from the store. It’s been months!

And it’s going to be many months more, thanks to the completely inept handing of things by the Republicans in this country. I single them out because they took common-sense safety precautions and politicized them. How is wearing a mask to limit the spreading of the virus a political question?

But thanks to Governor Abbott here in Texas, the number of new cases of COVID-19 infection is climbing rapidly. Here in San Antonio we had the biggest number of new cases (311) on Tuesday, and the most significant increase in the number of people on ventilators. Houston has the world’s largest medical center, but is so overwhelmed by COVID-19 cases that its Children’s Hospital has started admitting adult patients. Back in April Abbott issued an order that forbids localities from enforcing rules requiring face masks, in an effort “open Texas back up”. There was no evidence that the risk of contagion was gone; in fact, everything said the exact opposite. But in keeping with the Republican strategy of pretending it’s gone, he kept lifting the restrictions that had kept the infection rates low. Now the infection rates are spiking, and they’re acting surprised. The same pattern is happening in Florida, where Governor DeSantis is likewise pretending that things are normal.

And this isn’t a case of “how could we have known?”. Every epidemiologist was saying that re-opening was the wrong thing to do. Every medical authority was saying that we needed more testing to understand the extent of the disease, and that we needed stricter precautions: masks that cover the nose and mouth, full social distancing, and banning public gatherings. We have the evidence from the last global pandemic from 100 years ago: relaxing the precautions led to a second wave of infections. This may be the first time any of us have experienced a pandemic, but it isn’t the first time it’s happened, so we have historical data.

But instead the Republicans, following Trump’s lead, ignored that advice in the hope of giving a boost to the economy.

Priorities!

How is this anything but criminal? If I kill someone so that I can get some money, that’s murder. But if I kill someone to boost the economy (and, by extension, help myself get re-elected), that’s just politics?

Nobody could have prevented this pandemic. I’m certainly not blaming Trump, Abbott, DeSantis, or anyone else for it. But it could have been handled in a way to minimize the suffering and death, as we’ve seen in other countries that treat this like the medical issue it is, rather than political football.