Louie or Charlie?

Like many children, I was exposed to Alice and Wonderland and many other fantastical creations of Louis Carroll via book and screen. I found the stories palatable but not among my favorites. It was not until I was a bit older that I began to better appreciate the cleverness behind much of the writing

During my junior year of high school I encountered Gödel, Escher, Bach: an Eternal Golden Braid by Douglas R. Hofstadter. The book interweaves math, art, and music in a study of cognition and, to my delight, alternating chapters were written in a Louis Carroll-ish style using curious creatures engaging in odd activities and conversation to depict various theory. Gödel, Escher, Bach influenced me in a variety of ways, but germane to this post was it made me reevaluate actual Louis Carroll texts.

The next year I wrote my Senior Paper about the logic in the writings of Lewis Carroll. I learned that “Lewis Carroll” was actually a pen name for logician and mathematician Charles Lutwidge Dodgson. Within his various “children’s” stories are representations of and allusions to many different logical concepts and I excitedly delved into different occurrences. The story didn’t matter as much as the concepts behind the story.

Years after that, while studying literature as both an undergrad and graduate student, I revisited some Lewis Carroll texts. This time I was focused on his word usage and structures. Sometimes in invented new words. Sometimes he deliberately misused words. Sometimes he embedded different poetic structures into texts. I generally refrain from diving too deeply into this sort of realm, but nevertheless found that just beneath the layer of silliness was a significant depth.

Originally I thought Lewis Carroll to be a writer for children. Later I thought Charles Dodgson to be representing math and logic. After that I found him to be careful crafter of clever and cryptic composition. Sometimes I wonder if I infer more that was intended by by the author, but perhaps that doesn’t really matter. In the words of Lewis/Charles: “Words mean more than we mean to express when we use them: so a whole book ought to mean a great deal more than the writer meant.”

Getting local address in Go

Awhile ago I had some tests that would spin up a server and then hit some “localhost:8080” endpoints and verify the responses. The tests worked great in my IDE, but when the tests were invoked as a step during a Docker build, they could not find the server. This post is about how I got my tests to run within a Docker container.

There are a variety of ways to get the local address in a Docker container, but many of the solutions I found online involved running one or more command line utilities and I wanted something that “just worked” in Go. After various kicking and swearing (and searching), this is what I came up with:


package main

import (
    "fmt"
    "net"
    "os"
)

func main() {
    fmt.Println(getLocalAddress())
}

func getLocalAddress() (string, error) {
    var address string
    _, err := os.Stat("/.dockerenv") // 1
    if err == nil {
        conn, err := net.Dial("udp", "8.8.8.8:80") // 2
        if err != nil {
            return address, err
        }
        defer conn.Close()
        address = conn.LocalAddr().(*net.UDPAddr).IP.String() // 3
    } else {
        address = "localhost" // 4
    }
    return address, nil
}

The above is a complete main.go which can be compiled and ran, but the most important piece is the getLocalAddress() function which returns the local address (or an error if something goes wrong, but I haven’t had problems). Here are some of the key points of the code:

  1. Checking if the “/.dockerenv” file exists is an easy way to check if the code is running in a Docker container.
  2. We create a net.Conn instance
  3. I first tried using
    address = conn.LocalAddr().String()
    to get the local IP address, but it included a port that I didn’t want. Instead of doing string manipulation, I found the returned LocalAddr was a pointer to a net.UDPAddr and so a simple casting provided easy access to the IP.
  4. If not running in Docker, “localhost” is good enough.

And that’s about it. When I have checked, the local IP address of the container has been in the 172.17.0.x range which I believe is a Docker default. Since doing this, there haven’t been any problems running the test, but I’m not sure if this is an industrial strength solution suitable for production environments.

Another Desk Sheveling

I was planning to wait until next National Clean Your Desk Day (10 January 2022), but it had been 16 months since I last did a proper desk “sheveling” and I realized it was time.

As always, it was a bit of an adventure and also a trip down memory lane. Here are some things I found:

  • Weed eater line (now in the shed)
  • New health, dental, and vision insurance cards (insurance changed with the new job–cards now in wallet)
  • Various receipts (now recorded and filed)
  • Covid vaccination card (I knew it was somewhere on the desk)
  • Parts of a microscope from a Saturday Academy gala
  • Two small screwdriver sets
  • A one year anniversary card from Circle (card was from April)
  • 26 pages of notes from my previous job
  • My solution for a Mind Your Decisions problem (I solved it)
  • Various swag from gopuff (my new employer)
  • Instructions for my outdoor grill (a Father’s day present)
  • 9 guitar picks
  • Precision knife set (like x-acto) that I couldn’t find last month
  • Diagrams, rosters, etc. for the fall SWSC Microsoccer Jamboree
  • Plastic Easter egg
  • Small, wooded treasure chest filled with gold and silver candy
  • A :(){:|:&};: mug from a friend at Data Machines
  • Root beer and ginger beer bottle caps
  • R2D2 Happy Meal toy
  • Two Raspberry Pis and an ESP8266

For extra credit I updated the printer firmware.

Dear Circle

Dear Circle,

In thinking back over the past year and a half, I realize that we shared many happy adventures together. I wanted to send you this note to thank you for the great experience and let you know how much I’m going to miss you. This has been the first job I ever had that I was able to explain to my Mother what I did and what you do. Everyone understands the problem we’ve been working together to solve.

You may recall that I joined shortly after COVID became a thing and we were still in lock-down for a “just a couple weeks” to “flatten the curve”. Everyone was friendly as I came on board and was trying to figure out how things worked. A couple weeks later I went to the office for the first time to get a laptop upgrade and I inadvertently set off the alarm–sorry about that.

I think Focus Time was a big step in helping families like mine. My family was probably the first to use Focus Time in a real setting. I remember in the early (prerelease) days when my kids would frantically barge into my office because some random site was blocked and they needed to access it “now” in their class. My family had a lot of discussions about Focus Time and screen time in general–some of those discussions helped Focus Time improve and other discussions helped my family improve.

Do you remember the Release Bonanza on 21 October 2020? We took a risk with that, but we worked hard, planned carefully, and we had a smooth execution. Perhaps it’s not remembered since it ended up almost a non-event, but I’ve always felt that was an important turning point in our doing better cloud releases. I still have the T-Shirt.

And what about the online party on 12 February 2021 where we counted down to 6:00 pm and cheered? I know people had different reasons for celebrating. I was happy that the 10 pm-4 am release windows (who thought that was a good idea?) were finally a thing of the past. That was another important turning point and we were finally able to dedicate more time and energy on important things.

I appreciate how you let me use Innovation Time to experiment and try new things. You were patient with my zany POCs that didn’t go very far (perhaps someone else with finish some of them). We also worked together to make ideas like usage emails and recommendations into features that benefit our users.

I now have an opportunity to try something new and I hope doing that is the right choice for me and my family. I wish you continued growth and success and will be watching your progress as I continue to be a user. I’m going to miss you and all the neat things we’ve done together, but I hope we both continue to do neat things.

Cheers,

Nathan
https://www.linkedin.com/in/nathanbak/
http://www.nathanbak.com/

Breakfast Sandwiches

Upon unwrapping one of my presents last Christmas I found myself still unenlightened as to its purpose. It required further investigation (and reading) to learn that I was now the proud owner of a breakfast sandwich maker. It seemed a novelty of sorts and my initial assessment was that it probably wouldn’t work very well. But in the 10 months since then I think I have used this dumb device to make about half my breakfasts.

My sandwich maker doesn’t have any buttons or switches. I plug it in to turn it on and unplug it to turn it off. When it is on (plugged in) an orange light illuminates . A second light (this one green) lights up when it is preheated. There is no screen, Bluetooth connectivity, no settings, no app. It’s the right level of complexity for me when I may not yet be fully awake.

The actual usage of it is as follows:

  1. Plug in sandwich maker
  2. Wait for green “Preheat” light
  3. Put half and English muffin, a slice of cheese, and some ham or sausage in the bottom ring
  4. Crack an egg in the top ring and top with the other half of the English muffin
  5. Wait for five minutes (I have Alexa keep track for me)
  6. Unplug sandwich maker
  7. Slide out disc that separates top and bottom rings
  8. Flip up rings
  9. Slide breakfast sandwich onto plate

So why do I like this dumb device? It makes breakfast easy for me. I could make something similar without the minor appliance, but it would take longer. Cleanup is easy–about once a week the rings section goes in the dishwasher and the other part gets wiped down. A quick spray of avocado oil after cleaning keeps the eggs from sticking.

There are so many high-tech kitchen appliances out there now that do all the things: digital air fryers, sous vide gadgets, Instapots, etc. My breakfast sandwich maker only really does one thing, but that thing happens to be what I often want for breakfast.

Warning: Banned Content

Recently the family has been watching The Muppet Show on the Disney+ platform. As has been widely publicized, some of the episodes are preceded with a content warning and so we have made it a game to try to determine the offending portion of the episodes that would merit the warning. For example, in the Steve Martin episode, was it when he sings in “Chinese”? Apparently the Swedish Chef is OK–he appears in many episodes without the warning including one where he speaks “Mock Japanese”.

Months before, while perusing the Internet, I came across a list of banned books (past and current) and found it contained a lot of great books. Going through the list I saw many that are already part of the home library, but also identified some gaps that needed to be filled. In particular there were a few books that I know my wife would enjoy so I obtained nice, hardbound copies.

On the list were also various books that I have read before and have no desire read again. There were also various books that for which I have no desire to read even once. I don’t want those books in my home. It’s interesting to lookup why some of the books are banned and also to compare different lists of banned books. Overall, I have found various lists to be a good source of ideas of things to read, but definitely not a comprehensive or even reliable source of quality books. Some banned books are not worth reading (but perhaps shouldn’t be banned).

Many of the banned books are time-tested classics and thinking about such great literature being banned evokes images of historical factions burning books because of the radical ideas contained within. However, in the few months that we’ve had our banned book display in the foyer, my kids saw in the news about certain books being pulled off school and public library shelves–in a couple cases they found our home copies and added to the display.

I find the Disney+ content warnings for The Muppet Show to be silly, but I appreciate that Disney still makes the content available instead of withholding the entertaining shows for various ill-defined reasons. As for books being banned, there are a lot of books out there that I might find offensive–I choose not to read them. There are also books that I do choose to read in spite of the opinions of others.

A Changing Castle, a Change in Theme

I am not the target audience for Tuesdays at the Castle or the other books in the series. Likewise, the books are of little interest to my three sons. My wife describes them as “cute and predictable”. However they do tell stories which interest my daughter who gets excited when she is interested in something and who loves to share her excitement.

I suppose I should be honored that my daughter brought Tuesdays at the Castle to me as soon as she finished reading it so that I could [presumably likewise] enjoy the text. While I thought the concept of a castle that irregularly changes on a regular basis to be interesting, overall I think my impressions were that of a reader who is reading a book target towards young girls and is not part of said target audience. Nevertheless, it is not the worst thing I have read and it allowed for various conversation with my daughter. At her urging I think I have read all but one of the books in the series.

For many years (even predating the birth of the girl-child), my family has read various books at the table after dinner. With three older brothers, the books selected are frequently not the books my daughter would choose. Or sometimes, such as when we read Where the Red Fern Grows she does get really into the book only to become emotionally scarred. So when she proposed reading Tuesdays at the Castle as an after dinner book, it seemed only fair.

Even with an only marginally interested audience, the reading went quite well. Despite knowing what was going to happen, my daughter would get excited and her enthusiasm tends to be infectious. She was also a good sport and did not get offended at [amusing but snide] comments by brothers or the less-than-flattering voice affectation I employed for the characters. So despite it not being a preferred text for the majority, a good time was had by all.

Another good thing that came out of this was a renewed effort by the boys to find “good fit” reading material for the girl child. With a better understanding of what she likes, they raided the bookshelves and found several books they thought their sister would enjoy (and they did a pretty good job). This led to my daughter being exposed to even great books.

I’m glad that the family read Tuesdays at the Castle together and that I read the books as well. In both cases the change in reading material theme brought about happy memories and positive interactions.

Homeschool PE

I’ve been fortunate to work for companies that are supportive of families. While I was working for Datastax, the company supported employees and their families in various ways including reimbursing up to $1000 for expenses related to physical and mental health. And as for my current employer, Circle’s mission is to make families’ lives better online and off.

When Covid-19 quarantining started and everyone was home, my wife and I quickly realized that it was too easy to fall into into a slothful pattern of lounging around in soft pants all day and never leaving the house. While there are merits to said lifestyle (particularly during inclement weather), it didn’t seem conducive to a health family life. So we instituted “Homeschool PE”.

Every weekday at 11:00am, the family would head outside and do something. Examples include:

The Datastax health expense reimbursement paid for a lot of Homeschool PE equipment and members of my team refrained from scheduling meetings during my family’s Homeschool PE block. When I started at Circle, the first time I met the [woman who would soon become] CEO was when she dropped off a computer at my house while I was playing table tennis in the driveway with my kids. She commented that at her house they played table tennis on the back patio. She responded favorably when I told her about Homeschool PE and I later learned even suggested it to other employees.

As online school started up in the fall and the weather became less amenable, regular Homeschool PE faded away, but during the spring and summer it was definitely a good thing for my family. Sometimes it was hard to get everyone to get up and outside, but once we started playing it was generally a good time all around. I’m grateful for the fun experiences and happy memories from Homeschool PE and appreciate my employers who support me and my family.

Why is it funny?

I have already written about how Randall Munroe ruined most web comics for me, but apparently I am in the minority since there hasn’t been a significant transformation of web comics or comics in general. It makes me wonder why I find it funny–particularly since I don’t always recognize (or perhaps just not appreciate) other types of humor. Different people have different styles of humor and may appreciate various comedic situations to varying degrees. This brings to mind Margo Leadbetter:

Nobody tried to explain to Margo why “it” was funny which is just as well since, despite her genuine desire to understand, an explanation would not have helped. But when the screen hit the statue (not an idiom) she got “it” (which was a related but different “it” amusing the others).

Getting back to why I find Munroe so hilarious, it may be that I am a suitable audience for the content. This appeared on the xkcd website for more than a decade:
Warning: this comic occasionally contains strong language (which may be unsuitable for children), unusual humor (which may be unsuitable for adults), and advanced mathematics (which may be unsuitable for liberal-arts majors).1

I am too old (and too big) to be a child, not mature enough to be an adult, and studied Japanese Literature and Computer Science (separately) in college so the content isn’t immediately unsuitable for one such as myself. There is a website that explains each xkcd comic, but reading the explanations of why it is funny typically just doesn’t do it for me. Reading Randall Monroe amuses me without anyone explaining to me why it is funny. Perhaps that is enough.

Sheveling Again

Before sheveling

Apparently its been more than two-and-a-half years since I last had a completely sheveled desk. When it comes to horizontal office surfaces, my tidiness level remains an abysmal constant, but a lot of other things have changed during that period and my desk has evolved. Below are a few highlights of changes I pondered while sheveling.

  • I’ve changed jobs twice since the last sheveling which means switching out work computers (I’ve gone through four work laptops) and using a Mac.
  • Working from home used to be more rare and meetings were often on conference calls. Now most people in the tech industry work from home and meetings are video chats. So out with the phone and in with the external web cam.
  • On top of her job, my wife increased her volunteer activity and also started a graduate school program–the nine-year-old printer couldn’t handler the increased load had had to be replaced.
  • I really need to clean my desk more frequently.
After sheveling