Soren Bjornstad's attopublish stream

Filter by post type or topic:

This is the microblog of Soren Bjornstad. When I publish something interesting on the web, want to share someone else's interesting thing, or just have a thought that doesn't feel like it should stay confined to my head, it makes its way here. You might also be interested in Random Thoughts, which has similar content but a different audience (the audience is me, and I publish it in case it's useful to someone), my Zettelkasten, and my formal blog, Control-Alt-Backspace.

Housekeeping:

#50
The restroom account

The other night I dreamed that I was at a public restroom which required me to create an account in order to use the toilet. This seems like the epitome of technological bureaucracy in 2022, and is entirely believable!

#49
New stuff: Tea shop

I missed yesterday because I was busy working and writing a bunch of stuff in my Zettelkasten, but today I got back on the bandwagon with a visit to a little tiny tea store which I've passed by a few times and never gone into. You just stand in front of the counter and tell the lady what you're interested in, and she finds something to recommend and sells it to you.

I haven't actually tried the tea yet (I would do it now, but I don't need more caffeine at 10:30 pm), so I'll come back and update this when I have a report on whether it's any good! (I'm guessing loose tea from a store that sells only tea and that's about $0.50 per cup is going to be pretty good, but you never know.)

#48
Copilot almost groks awk

While I was writing examples for the on-line help of a new feature of Dreamdir, Copilot (quite remarkably) recognized what I was trying to do with the rather hackish awk pattern patsplit($4, arr, /,/) == 1 { print $0 } (split a string on commas, and use this operation's return value, informing us how many splits were made and thus how many commas were in the line, to decide whether to show the line or not – completely ignoring the actual split values). It even drily noted that “this is a contrived example,” which it certainly is!

Copilot can read awk commands!

Only, it's not quite right! The return value of patsplit here is 1 not if there is exactly one person in the column, but if there are exactly two people in the column, because there would be no comma at all, and hence zero splits, if there was only a single comma-separated value. It's interesting that it made exactly the sort of mistake that a human programmer would make here – I didn't even notice the error until I actually ran the command and looked at the output to be sure I hadn't made any syntax errors. Indeed, there's no particular reason awk would have to return 0 if there are no splits; it could easily have chosen to define the return value as the number of elements in the resulting array, in which case Copilot's explanation would be right; it just doesn't. (0 does have the benefit that the return value becomes falsy if the delimiter wasn't found, though, which could be convenient on occasion.)

(Incidentally, the { print $0 } isn't actually necessary: if an awk program consists of only one pattern with no body, the body is assumed to be { print $0 }. I left it in here in case people reading the examples don't know this!)

(Previously: #32, #24, #22.)

#47
New stuff: Lowry Hill

Today I went for a walk in the Lowry Hill neighborhood, as prompted by a nifty iPhone app called Randonautica which I use occasionally. This lets you select a radius around your current location, then randomly picks a spot you're supposed to go explore somewhere within it (using some amusingly woo-woo method). Inevitably, you find something interesting in the area it instructs you to visit, not of course because its “method” actually knows where interesting things are, but because interesting things are all around us, and we usually aren't paying attention.

There was a surprisingly nice view of the skyline right at the spot it pointed me to, although my phone camera didn't do the best job of capturing it:

Downtown Minneapolis seen from a high spot in the Lowry Hill neighborhood

On the way back, I went through Thomas Lowry Park, named after the streetcar magnate who made huge contributions to Minneapolis's transportation system (the streetcar tracks have been long since paved over, to the eternal regret of Minneapolis urbanists). I had not been there before, and had read the other day that it has a fountain made up of a series of cascading pools. Presumably these are them, though it was a wee bit cold for any fountain action today:

What is presumably the pools, covered in snow

And a little further on, in the middle of some really cool historic apartment blocks, was this nifty carved lamppost in front of a random house:

This nifty lamppost with animal heads in front of a random house
#46
New stuff: fancy soup

Today there's a winter storm warning, so I'm not going anywhere. Instead I made a really intense mushroom barley soup from an amazing soup cookbook called Dairy Hollow House Soup and Bread, written by a woman named (I kid you not) Crescent Dragonwagon. It's undoubtedly the richest vegan soup I've ever had – mixed dried forest mushrooms, button mushrooms, white wine, the typical soup vegetables (including parsnip for that little bit of bitter zest!) and a homemade roasted vegetable stock with extra mushroom stems.

Every recipe from the book I've tried is good, but many of them are quite a production – being recipes they make at Dragonwagon's inn's restaurant, it's rare to find one with fewer than fifteen ingredients, and there are usually lots of steps. This one had 19, and one of them was the stock, which itself had 10. But if you don't think vegetable broth is good, this one will change your mind! I would have happily sipped a cup of it if I hadn't needed all of it for the soup. Totally worth it.

I'm a mushroom lover, so this recipe couldn't really be bad. It came out a little sweeter than I would have preferred though – next time I'm going to try a very dry wine instead of the medium-dry the recipe called for. (It could be partly the fault of the vegetable stock I chose, which is a touch sweet because the veggies are caramelized.) Met expectations overall, though it only scores that low because I have high expectations of the cookbook.

#45
New coffee shop

When I started working from home (permanently, post-pandemic-restrictions), I had originally planned to go work somewhere else for part of the day most days. As of yesterday, I had somehow managed to do that exactly zero days on which I was otherwise based in my home office. While I'm introverted enough that I don't get lonely from being at home all day as long as I go hang out with other people a couple of times a week, it's definitely still better for me to get out of my apartment most days, so I'm planning to try out a bunch of nearby spots I could work and hopefully find a couple that I can become a regular at.

One problem with working away from home is that there are some tasks I can do way more effectively at my desk, with two 24-inch monitors, access to four different computers running different operating systems, and a whole office setup. I know what tasks I can do well with just my laptop, but I've often done a bad job of block-scheduling them. So in some sense, this will be a task-management experiment as much as a place experiment. (I do have a handy portable 15-inch monitor that folds up to the size of a laptop and can be used as a second screen, but I think it's a bit too nerdy to set up at a table in a coffee shop! You also kind of have to set up an external keyboard and mouse too if you want to run dual monitors without wrecking your ergonomics, which makes it even more impractical.)

In the interest of not allowing a bunch of internet strangers to trivially triangulate my exact home address, I won't say too much about exactly what these places are or where they are in relation to me, but I'll drop in a little. The coffee shop I tried today (I had been once, but not to work, and before I actually lived in Minneapolis) somehow felt simultaneously really nice and not quite the right vibe for me. I could imagine getting used to it, but I'm not sure about it at this point either.

#44
New stuff: Bogart's, Foshay Tower

(For Sunday, the actual publication date.)

When I joined Costco last December, the guy at the customer service desk read my address and told me I had to try Bogart's Doughnut Co., which isn't actually that close to my apartment but was apparently his main association with Uptown. It's right on the way from my apartment to church, but I've never stopped, so today I did on my way home and got their brown-butter-glazed doughnut, which I was told was the classic. It wasn't, in my opinion, astoundingly good, as I had been made to believe from the way he and another woman there talked about it, but it was solidly excellent and I'll definitely go back if I'm craving a doughnut.

In the afternoon I went to the Foshay Tower downtown and went up to the museum and observation deck. I only saw four other people, on a holiday weekend, so the observation deck must be unusually unpopular for one situated in a major city; it's certainly odd that the way to go up is to walk into the hotel and ask at the front desk to pay $9 for an elevator key card (they even make you sign on the screen, on a line that says “I agree to pay all room charges and incidentals”).

The story of the tower, and Foshay himself, is fascinating, but I was a little underwhelmed by the museum as a museum. It lacks any kind of clearly presented story, and has only a couple of small slips of paper written by the curator, so that you have to read all the newspaper articles and artifacts yourself and try to draw your own conclusions, something which is difficult to do reliably given that some of the articles are nearly a century old and you don't know what motivations the writers might have had. I'm still unclear, for example, on exactly to what extent Foshay's company was a Ponzi scheme; he clearly lied about where the dividends he was giving out were coming from, but it seems like he also had a real business that would have been profitable sooner or later?

The observation deck was fun, but you do have to temper your expectations a bit since you're on the thirty-second story smack in the middle of a downtown that has quite a few taller buildings. You get a great close-up view of the buildings around you that you couldn't easily get from any nearby public space, and there are some gaps where you can see quite a long way, including a decent look at the skyline of St. Paul, but if there's a specific area of the city you're hoping to glimpse, or you want a panoramic overview, you're likely to be disappointed. I couldn't see into my own neighborhood at all; the AT&T Tower prevents you from seeing anything to the east of Lake of the Isles and west of Nicollet or so. Also, the telescopes at the corners were a nice touch, but a couple of them were so dirty they were basically useless.

For an hour and $9, it was totally worth it, and I'd definitely recommend it to guests.

#43
New stuff: Stone Arch Bridge

On Saturday, the weather was gorgeous and I rode the bus downtown and tried to visit Water Power Park and maybe read for a while. This is (apparently; as you will soon see I have not yet been there) a projection into the Mississippi River in downtown Minneapolis near the Upper St. Anthony Locks where you can relax and look out on the water. The park was, however, closed for unspecified maintenance activities, despite showing as open on Google Maps. Fortunately, I had had the idea of combining it with starting on the opposite side of the river and walking across the Stone Arch Bridge, which is a historic rail bridge connecting the former mills on the west side of the river to the mainline on the east side, so the trip wasn't wasted.

The whole area is beautiful and I can't believe I haven't been yet. I grabbed this picture of the skyline and the (being renovated) Central Avenue bridge from the point where I tried unsuccessfully to enter Water Power Park. The Stone Arch Bridge is not visible, but is off a few hundred yards to the left.

The Central Avenue bridge

On the way back, I stopped at a used bookstore that's less than three blocks from my apartment but which I've never been in, partly because it's only open on Saturdays and Sundays, and bought a big stack of books. I'm not sure how fast the inventory rotates, so I'll have to check back in a couple of months to see how often it's worth going.

#42
Doing new stuff: an experiment

In my reflections on living in Minneapolis for a year (see post immediately below), I noted that I want to try doing more different things, and generally drawing more samples across all areas of my life. In the last year, I've done about as many things around me and gotten to know about as many places as I would have in any of the smaller towns I've lived, which makes it seem like I'm not taking full advantage of the opportunities I have here. The new things I've gotten have been mostly minor, like being able to attend concerts fifteen minutes' drive from my home instead of an hour; I'm not sure I've even gone to a whole lot more of them than I otherwise would have.

The world is a really interesting place with a lot of people, places, and activities in it, and living in a city means you get a bunch of those things packed together closely enough that you have more of them available than you'll ever be able to explore within thirty minutes' travel. I'm not saying that I need to aggressively try to do everything I possibly can, constantly for the rest of my life, but especially being only around a third of the way through my expected lifespan, it seems like I should be exploring more than I am.

In an attempt to adjust for this, I'm going to try to do something new every day until the end of the year. At that point, I'll evaluate and see if I want to continue this, maybe in some altered form. I'm not only going to count events or places in the city, though I expect many of the items to fit in there; I'll also count things like cooking a new recipe or meeting someone new online. I won't, however, count reading books, visiting websites, or anything that I would likely already have done without this project.

To keep myself honest, I'm going to write something here every day about what I did under the “New Stuff Experiment” tag.

#41
🔗 A year in Minneapolis

As of today, I've been living in Minneapolis for one year and one day. I wrote up some thoughts on what's been different about living here.

#40
The McCollough effect

The McCollough effect is the creepiest perceptual phenomenon I know of. By staring at gratings made up of horizontal and vertical lines interspersed with red and green bars, you start to see images of the same gratings separated by pure white as having pinkish and reddish tints.

So far, this seems like a pretty normal afterimage demonstration, except that the colors are the same instead of inverted. Here's the weird part: if you do this some day, and then you put it away and come back in several months, you still see the same illusion without doing the induction again! (I just did a several-months-out test. It worked as advertised.) Somehow the simple expedient of looking at some colored images for a couple of minutes can create lasting changes in your visual perception. (If you find this scary, know that retesting yourself repeatedly over a short period of time will eradicate the effect; whatever adaptation occurred will promptly undo itself once you can give your brain enough new input showing that it's really white.)

Phenomena like this seem to me to provide tantalizing clues of a world – and a human consciousness – that's vastly weirder and more interesting than we can imagine.

#39

There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened.

Douglas Adams, The Restaurant at the End of the Universe
#38

Just you put good stuff into the universe and most of the time the universe will return good stuff to you. And even if it doesn't, you should still be enjoying it.

David Heinemeier Hansson, “You can either buy attention or earn it” [rt] [source]
#37
🔗 RabbitMark

I've been using my own little desktop bookmark manager called RabbitMark for about 8 years now, and I finally got a chance to clean it up and publish it. If you save a lot of bookmarks and are looking for a good solution to keep them under control, check it out!

#36
Droop Snoot

The Concorde featured a droop snoot, which meant the snoot would droop.

#35
C’mon, don’t leave early

If anyone knows of a more annoying everyday occurrence than missing a bus because the bus left the stop before the scheduled time, I'd like to hear about it.

#34
🔗 Renting is Throwing Money Away...right? (Afford Anything)

This is the best treatment I've ever found of this age-old and extremely complicated question. Rather than try to simplify, it lists out all of the considerations involved and shows how to crunch the numbers to see what actually makes sense for your situation.

#33
The fundamentality of metaphor

When I was in sixth grade, I, like many people, was tricked into believing that metaphors were some kind of obscure figure found mostly in fancy poetry. Nowadays, I believe that metaphors are the most important – and simultaneously among the most unrecognized – cognitive tools available to humanity.

How do you learn things? By relating them to things you already know. When you learn an unfamiliar concept, you find a concept you're familiar with, pretend they're the same thing, and then add corrections for the things that you notice actually aren't the same. Similarly, even once you know things, you often reduce problems to easier ones or ideas to ones you're more comfortable with. This happens both linguistically (the most traditional use of the word metaphor) and conceptually.

Incidentally, I also believe this is a prime reason that fiction and friends (legend, anecdote, etc.) are effective tools for communicating truth, or, on the flip side, for creating untrue and/or maladaptive beliefs. Nonfiction is honest about its metaphors, which makes it easy for the reader to accept or reject them. Fiction just creates them and lets your brain make its own connections while you aren't looking. Fiction is also free to use much more creative metaphors, which are more powerful and harder to predict the effects of.

Much smarter people than me have explored these ideas in much more detail (perhaps most notably Julian Jaynes; the Conceptual metaphor article on Wikipedia provides an interesting overview of some modern ideas), so I won't blab on any longer, but I was struck today by how undertaught this fundamental feature of the world is and wanted to make sure my readers had thought about this at some point!

#32
Copilot recommends self-immolation

Gnomish scrollkeepers, in my roguelike, are mischievous little creatures generated with 1–3 magical scrolls that do irritating things. A balance problem created by this (not that the game is far enough along to have meaningful balance yet!) is that if one doesn't find a use for all of its scrolls before you kill it, you get to pick up the extras, and if a lot of scrollkeepers show up, you get more scrolls than you probably should. To counter this, I decided to make scrollkeepers have a chance of successfully lighting their scrolls on fire as they died, to avoid their species' magic getting out and all.

Copilot had a…different idea:

The gnomish scrollkeeper lights himself on fire

(Previously: #24, #22.)

#31
Lazy-loading images on websites

As I started adding images to this microblog, I realized I had a problem: since the entire thing is a single page, after a while the page was going to start downloading dozens or eventually maybe hundreds of images every time someone browsed to it, most of which the reader would never look at unless they decided to go through the archives for all of time – hardly the lightweight site I'm aspiring to create. I could have written some JavaScript to load them when the reader came to them, but this also seemed ugly and not in keeping with the philosophy of the site.

Happily, it turns out HTML5 added an image attribute, loading="lazy", that causes exactly the right behavior here. The precise way the browser decides when to load images is up to the browser, but essentially it grabs the images for only the first couple of screens of content, and then as you scroll down it starts pre-requesting images that are 1–2 screens away. So unless you start scrolling really fast or have a really slow network connection, you'll never know the images aren't being loaded up-front, they'll just be there when they scroll into view.

This is supported on all major browsers except Internet Explorer, and if you're still using Internet Exploder in 2022 for anything except an old and broken enterprise website, I'm gonna say you deserve to download a bunch of useless images.

#30
When you're broke but still need some tea...

…you can now pay for your tea in installments.

The Bigelow website showing that you can buy tea in 4 installment payments
#29
Baby Jesus, the projectile

At choir rehearsal last night, we started Michael Praetorius's “Psallite”, which contained the temporarily puzzling Latin phrase:

Christo Dei filio…puerulo iacenti in praesepio!

Which the Latin-reading part of my brain decided to interpret as “baby Jesus, thrown into a manger.” (It would actually have to be throwing, present tense, and it would be more idiomatic to use the accusative for praesepium when motion is involved, but my brain glossed over this in its attempt to make sense of this silly reading.) I spent the next ten minutes with an image of someone chucking a baby across the room into a manger as if throwing a balled-up piece of paper into a wastebasket running through my head.

It was only when I got back to my dictionary that I finally realized I had made the classic mistake of confusing iacio, to throw, and iaceo, to lie (mnemonic: the lowercase letter i looks sort of like a person standing up). But in looking at the dictionary entry, I also realized I had arguably only been half wrong! The two words are closely related in both meaning and etymology; iaceo is an intransitive and stative counterpart of iacio. The sense is that when something is thrown or cast down, it ends up lying where it was cast. Which makes a neat metaphor: Jesus was sent forth, down from heaven, to lie in the aforementioned manger.

In full:

Psallite unigenito Christo Dei filio, Redemptori Domino, puerulo iacenti in praesepio!

Sing to the only-begotten son of God, the Christ, the Redeemer, the Lord, the little baby boy lying in a manger!

#28
Now hiring

About a year ago, I was at the Land's End outlet in Bloomington and went into the fitting room to try on a shirt. I learned that Land's End was hiring, and was evidently in particular need of taller staff who use the whole mirror:

A 'now hiring' sign pasted over a mirror, covering up the spot where my face would appear.

Yesterday I was back at the same store and found this in the fitting room, on the opposite wall from the mirror:

The same 'now hiring' sign on a wall, wrinkled and peeling from having been removed from the mirror and moved over here.

I'm not sure why it's funny that they fixed their mistake, but somehow the moved, peeling sign is just as funny to me as the first picture!

#27
🔗 Illegal condoms (unknown author)

More Obvious Contraception Nonsense: In the United States, it's illegal to manufacture or import a condom larger than 5.5 inches in circumference at the base – a size which is too small to properly fit as much as 10% of men. In addition to being uncomfortable, condoms that are too small are substantially more likely to break. Congrats to the FDA. (Previously: #12, #2.)

#26
🔗 Polish

Polish is a quality of excellent products created by style, attention to detail, and an uncompromising insistence on doing exactly what is supposed to be done the best it can be done. It's about getting all of the details right in a way that creates a great impression. More on my definition of the concept at the link.

#25
The different difficulty of playing the piano

I learned a little bit of piano as a child, then played basically never for about 15 years, aside from plonking out a few notes while practicing some other instrument or figuring out a chord progression. After moving apartments recently, I finally found space for an electric piano, and I'm starting to play a little bit again.

I've noticed several interesting things as a result. First, it's surprising how much I remember; I was worried that, for instance, I might have to relearn how to simultaneously read treble and bass clef, but the moment I sat down I had no trouble with this. I'm not sure I've lost much skill at all (not that I had a whole lot to speak of to begin with; my age was in high single digits when I last practiced).

The more curious thing to me is that the difficulty of piano, as a beginner to intermediate player, is completely different from that of most other instruments, in two ways: First, it is quite difficult to play all of the correct notes even in a simple piece with a reasonable tempo; on most instruments, playing the right notes is fairly trivial with even a small amount of skill, unless you're playing something virtuosic. Second, once you do manage to play all of the correct notes, it usually sounds quite good without having to do much else (except perhaps push the pedal a few times, which doesn't really require practice for simple pieces once you've learned how to do it once). Of course you can continue to improve your articulation and dynamics and so on for a lifetime, but so long as you can hit the right notes, you can accompany yourself or someone else and not be embarrassed.

Contrast this with, say, the violin, where someone with a couple of weeks of practice can easily play any melody and hit the correct notes (albeit out of tune), but will still sound like a dying cat for probably months.

Much of the difficulty of hitting the right notes on the piano is down to multitasking. There are just a lot more of them, to start with. And then there's combining two hands doing different things. Playing with one hand alone, I might have to stop and work out a few fingerings and land my fingers in the right place, but this tends to be straightforward; it takes a little bit of practice, but it isn't usually difficult. But as soon as I put two hands together – even when the rhythms are basically aligned, or with straight half notes in the bass – suddenly I start making all kinds of mistakes I wouldn't have made before.

Lastly, at my skill level, practicing is very rewarding: I can go from being completely unable to play something simple to sounding quite good in just a couple of days. This is hard to achieve on any other instrument I've played.

#24
Sometimes Copilot…suggests animal abuse?

(Previously: #22)

Copilot suggests that housecats 'can be carried around in a sack'
#23
Why I don't outline my essays

Many people seem to recommend making an outline, or some kind of prepared description of what one is going to write, before starting to write it.

This has never worked for me. I've tried many times, because it seems like it ought to be helpful, and many people say it helps keep them focused, but I've never found it helpful. In fact, I'm rarely able to make a useful outline to begin with, and that has always made me feel like a sloppy thinker – but I seem to get good results flying by the seat of my pants, and it's hard to argue with results.

As I was refilling the soap dispenser in my bathroom this morning, I suddenly identified the fundamental problem for me: the way I normally write, I don't know what I think about a topic, and thus what I want to say about it, until I finish writing – and not just a few words about each of the ideas of that topic, the actual, final form. If I already knew what I was going to say, in many cases I wouldn't bother to write it (it's handy that writing can be so easily shared and both help other people and generate new connections for the author, but the main reason I write is to figure out what I think). So too, there wouldn't be much point in outlining anyway, because if I already knew what I was going to say, why not just…write it down?

Or put another way, it almost never happens that I sit down to write something and don't end up getting up from the keyboard thinking something substantially different – and much more expansive – than I did when I sat down; and this is true even when I am pretty sure I know what I think. I certainly did not, for example, expect this post to be seven paragraphs long, or to talk about my penchant for leaving sentences unfinished or the way people are taught to write in school; I only discovered many of the important ideas here as I started describing my soap-dispenser revelation.

If I'm writing something much longer than an essay, I do routinely note down ideas that I think I want to include later so that I don't forget about them. But I wouldn't call this an outline; it's more like a to-do list, because I don't make any attempt to figure out how the structure fits together at this point, and I'm not necessarily planning to include all of the ideas. I also, in writing of all lengths, often leave sentences hanging and unfinished and go write something different on another line or in another paragraph, when I suddenly think of a new idea I should mention. In a way this is kind of like outlining in that I leave placeholders for things I want to expand later. But unlike traditional outlines, it encourages iterating in place, rather than trying to get the structure right the first time without any details. Here's an example of an earlier version of this post:

This whole thing strikes me as a manifestation of the waterfall writing process problem, where the way one is encouraged or required to write actively discourages changing one's mind or restructuring one's argument later. The way people are taught to write in school targets, essentially, content-farm writing, rather than writing that follows natural curiosity and leads to real insights and worthwhile output (I would call this creative writing, but that's an established term that means something different).

Maybe I'm just weird here? I do seem to think in language more naturally and preferentially than some people.

#22
Sometimes Copilot is amazing

GitHub Copilot is often stupid, making incredibly basic mistakes like referencing variables that don't exist (I'm surprised they haven't figured out how to integrate it with the IDE autocomplete – although maybe it does and the model just likes to ignore it sometimes). At other times, it instantly figures things out that a human would need some significant domain knowledge to work out, to the point that it's hard to believe it's just a fancy language model.

In my roguelike recently, moving up against the edge of the map was doing nothing. I wanted to add a message that said “You are at the edge of the world” when you did this. Here's what I got after adding a conditional for whether there is no adjacent tile in the specified direction:

you bump into the edge of the world

(Incidentally, my experience has been that Copilot works noticeably better with Python than with TypeScript. I suspect this is because I use docstrings extensively in Python and it's remarkably good at interpreting them.)

#21
Required optional types and non-covariate unions

I sometimes find myself wanting a “required optional” type in MyPy or TypeScript. That is, the variable can be either null or some type, but the code shouldn't compile if there's no way for the parameter or return type to be non-null; there has to be some code path in which it could have a value (to figure this out without actually running the code, a true Optional[T] would have to be illegal to assign to a RequiredOptional[T], but a RequiredOptional[T] could be assigned to an Optional[T] – this is nothing new, just as a T can be assigned to an Optional[T] but an Optional[T] can't be assigned to a T).

Here's a recent example of an error this could catch: I'm working on writing a toy roguelike, and a common need throughout is for various NPCs to move around. To handle this, I have functions called travel behaviors that are assigned to each NPC and can be changed at any time; the behavior function is called to determine where the NPC should move. Here's a generic one that tries to move to a specific tile:

def travel_towards_target(
        soul: Soul,
        target: Tile,
        when_target_reached: Callable[[Soul], Optional[Tile]]
        ) -> Optional[Tile]:
    if soul.tile == target:
        return when_target_reached(soul)
    path = shortest_path(soul.tile, target)
    return path[0] if shortest_path is not None else None

When the NPC gets a move, it (the soul parameter) tries to move to the next tile along the shortest path from its current tile to the target tile. If the target is unreachable, it returns None to indicate it won't move at all (in reality we'd probably also want to change behaviors here, but this is an example). This results in a return type of Optional[Tile], that is, either a Tile or None (Python's null value).

Of course, without some intervention, when an NPC reached the target tile, it would just get stuck there forever, so if it's already there, a callback function when_target_reached() is called. This function resets the NPC's travel behavior in some way, perhaps shows the player a message, and then returns the first action it's going to take under the new behavior (since it still has a turn). It does this by calling swap_travel_behavior(), which both changes the travel behavior function and returns it so that we can call it once immediately to get this turn's action.

def on_target_reached(soul: Soul) -> Optional[Tile]:
    # ...change the target
    say("Changed target.")
    return swap_travel_behavior(soul, my_new_behavior)()

But today, I inadvertently left off the return statement, resulting in an implicit return value of None:

def on_target_reached(soul: Soul) -> Optional[Tile]:
    # ...change the target
    say("Changed target.")

This is clearly wrong, and not just because I obviously forgot a statement. It doesn't make any sense for the body of this function to be incapable of returning anything other than None; if that was what I had wanted, I would have just set the return type to None. In other words, the return type of this function should be not “either a Tile or None, or both”, as it currently is, but specifically both, a union of None and something else (Optional[Tile] being essentially an alias of Union[Tile, None]), with both possibilities obtainable from the code inside the behavior function.

However, as far as I'm aware, there's no way to define such a type, which means this (actually fairly common) error can never be caught by the type checker. This is, I suppose, a more general limitation of unions; in both MyPy and TypeScript they're implicitly covariant as return types.

Ultimately, though, I doubt this would actually be a worthwhile feature! It's already hard enough to think about nullable types without adding a different kind of nullable type, and I suspect in most places this kind of checking would be perceived as overly pedantic rather than helpful. (Witness PowerShell's “empty null.” Choice quote: “There is one special type of $null that acts differently than the others.”)

#20
Precious sponges

My small urban grocery store doesn't carry the kind of sponges I like, so I ordered a $20 box of them on Amazon. Yesterday I got a message indicating that they were unable to deliver the sponges – the kind you get when the package requires a signature and you aren't there. Then today, they came back while I was out, and the driver called me to ask where he should leave it, as if it was some expensive piece of equipment that would get stolen and create a disaster if it was left out.

When I got back and opened the box, I found it was double-boxed, with twenty-four air packs around the inner box, to protect the fragile sponges from breaking.

The sponges in their safely packed box
#19
Physical audio controls

One of the best minor quality-of-life upgrades I've found lately has been buying a physical volume knob for my desktop computer. I ran the outputs for my headphones and my stereo system through a splitter switch, then through the volume knob on the way to the computer's output, so the volume knob can be used to adjust both outputs without having to unplug and reconnect anything. The knob is vastly superior to my previous methods (press a fiddly button on a remote control a gazillion times for the stereo, and go click on the audio icon in the system tray for the headphones; my keyboard doesn't have volume controls).

Volume control knob, splitter switch, and webcam switch on a desk.

The upper-right box is a USB switch that I use to disconnect the power to my webcam when I'm not working, to make sure nobody can see and hear in my living room at off hours accidentally. I used putty to easily affix all the controls to the desk so they don't slide around.

This whole setup was about $75, which might seem a little steep, but I'm playing music, podcasts, work calls, or something else through the computer pretty much anytime I'm in my office or kitchen (which also covers large portions of my off hours), and I often have to adjust the volume multiple times an hour, so it's approximately $0 per annoyance point removed once you multiply it out over a few weeks.

#18

In a series of daring experiments, Lockheed test pilots (wearing parachutes and with the doors open!) deliberately flew an Electra at maximum speed into the strongest turbulence they could find, in the wake of California’s Sierra Nevada Mountains, while a specialized device vibrated the wings, and then pulled up sharply in an attempt to get the wings to break off.

“Physics Strikes Back: The Crashes of Braniff Flight 542 and Northwest Orient Flight 710” [rt] [source]
#17
Braided cables are worth checking out

I'm a convert to the new style of braided cable that's become popular lately. They're definitely more expensive, and until these came along, I'd never seen any benefit in buying anything but the cheapest available cable – most of the high-end cables have been sold with marketing gimmicks instead of improvements anyone would ever notice. But these look better and last longer than traditional cables. They tangle much less easily, and they're less susceptible to electromagnetic interference (though I can't say I've ever had trouble with interference on a cable in my home, even a 20-foot audio cable). Give them a try next time you see one as an option!

#16
Meta-theft of services

Three Microsoft engineers and three Apple engineers are taking a train to a conference. At the ticket office, the three Microsoft engineers each buy a ticket as usual, but the Apple engineers, after conferring for a moment to decide how minimalist they can be, only buy one ticket among the three of them. The Microsoft engineers ask, “How are three people going to travel on one ticket?”

“Watch and you'll see,” say the Apple engineers.

So they board their train, the Microsoft engineers take their seats, and the Apple engineers squeeze into a restroom. The train starts moving, and shortly the conductor comes through the train taking tickets. When he arrives at the door of the restroom where the Apple engineers are hiding, he stops and knocks on the door and says, “Ticket, please!” One of the Apple engineers opens the door a tiny crack and hands the conductor the ticket.

The Microsoft engineers are watching this and think it's pretty brilliant, so as usual they decide to copy it on the way back. But this time the Apple engineers don't buy any tickets at all.

“How are three people going to travel without a ticket?” the Microsoft engineers ask.

“Watch and you'll see,” the Apple engineers say.

So they board the return train, the Microsoft engineers squeeze into a restroom, and the Apple engineers squeeze into another restroom further down the train. The train starts moving, and one of the Apple engineers comes out of the restroom, walks to the restroom where the Microsoft engineers are hiding, knocks on the door, and says, “Ticket, please!”

#15
Back from hiding

Back from a week alone at a lakeside off-grid cabin in northern Minnesota (no electricity or running water, but with gaslights, a wood stove, and a hand pump in the kitchen drawing mostly palatable water, the only thing I missed was a hot shower on the cold days). Passed the time hiking, rowing, thinking, and reading by the fire. Aside from relaxing and enjoying the outdoors, I find that in today's world, I can't disconnect enough during my daily life to get all the reflecting I need done, so it's important to wander off out of reach of my notifications and daily life and do that. More thoughts on boredom-conducive contexts in my Zettelkasten.

I wish I could tell a funny story here, but almost nothing unexpected happened, good or bad. That means the trip served its purpose, I suppose.

Here's me in my boat, Awkward Annie, on the lake:

Soren rowing Awkward Annie
#14

Those two women will never agree. They are arguing from different premises.

satirist Sydney Smith, on seeing two women arguing through their attic windows [rt]
#13
🔗 Understanding Percentages

Figures expressed in percentages are ubiquitous, and interpreting and doing calculations with them is an important part of the basic mathematical literacy useful in everyday life. Yet few points of arithmetic are as confusing and full of traps for the unwary as percentages. I recently got fed up with being unable to think clearly about percentages myself, so I figured I’d write this article to force myself to understand them completely. Hopefully it will help you, too!

#12
🔗 Condom Failure (Pervocracy)

Postscript and counterpoint to my contraceptives article (see #2): as this article highlights, the primary cause of “condom failure” is not using one. To be clear, this doesn't contradict anything I said in my article; I was then and am now in favor of using condoms, ceteris paribus, and the 98% perfect-use effectiveness rate this article crows about is not so great once you multiply it out over many years (which is the focus of my article). I think most people who regularly have sex that could result in someone getting pregnant should use something more effective instead of or in addition to condoms, if practical. Nevertheless, this article epitomizes a broadly important point, that, in this realm as in the rest of life, most people leave shockingly easy gains on the table; simply, you know, using the condoms at all will reduce your chances of unintended pregnancy well past those of an average person.

#11
Topic: A word or phrase for this maladaptive pattern of motivation

I'm searching for a concise way to describe a pattern I've started noticing, in which someone wants to achieve a particular goal A, or likes a particular process or activity in total, but is incapable of, scared of, or strongly dislikes a necessary component or step of that goal/process/activity A′, creating an infuriating tension and an obstacle to progress.

For example:

  • Alice joined a fantasy football league for the first time last year. She enjoyed it, but really didn't like the research and draft process. She's not sure if she can get herself to go through it again, so she might not play this year.
  • Bob really wants to get married and start a family, but he hates dating, so he's struggling to make any progress.
  • Carol is considering accepting a promotion and would like to continue climbing the ladder, but she doesn't want a particular responsibility that's an integral part of the next step. She consequently has major qualms about accepting, but also can't stand turning it down.

This could conceivably be phrased as an emotional condition of the person, or as an attribute of step A′: Alice, Bob, and Carol are experiencing ________ —or— The draft is a ________ for Alice's enjoyment of fantasy football.

This concept is distinct from laziness in that the reason is much more deep-seated than not wanting to put in work; it's not that the task requires more effort or time than one wants to expend, it's that it's somehow distasteful. It's closer to akrasia, in which one acts against one's better judgment or will, but different in that there are two distinct components to the mystery concept; in akrasia one knows one should do A and doesn't want to do it, while here one knows one should do A and actively wants to do it, perhaps desperately, but doesn't want to do A′, which is a necessary component or dependency of A.

Is there an existing term or concept representing this idea or something close to it? Or can you think of a clever way to describe it?

Suggestions

I occasionally offer awards to internet strangers who send me recommendations I love. If I am so moved, your choice of:

  • $10 USD sent via PayPal
  • a personal thank-you note via snail mail
  • grab a drink with me sometime you're in Minneapolis (or I'm near you) and talk about the recommendation or anything else
Gratitude and brownie points awarded in all circumstances!
#10
Topic: Fiction involving shared consciousness

I'm fascinated by fiction about or involving telepathy or sharing of consciousness between characters, especially when used creatively or to enjoy/strengthen a relationship with someone. Looking for leads on more stories fitting this description!

Doesn't have to be exclusively humans, can also involve supernatural beings, aliens, alters, computers, or something weirder I haven't imagined yet; but the motivations of at least one participant should ideally be recognizable as human-ish. I'm hoping for a significant part of the story to involve the personal experience and/or interpersonal or sociological consequences of such capabilities/contacts. Stories merely including the trope in some corner are probably not what I'm looking for.

A few examples:

  • His Dark Materials, Philip Pullman (people have animal-formed companions called daemons who are mentally linked to their humans)
  • Slapstick, Kurt Vonnegut (Wilbur and Eliza are fraternal twins who are mentally disabled when apart, but explosive geniuses when they are close enough to share their minds)
  • Inception, Christopher Nolan (people can share their dream worlds with others)
  • Being John Malkovich, Spike Jonze/Charlie Kaufman (people can temporarily join John Malkovich inside his head)

(Not sure about Ender's Game. I've only read the first novel, which hints at interesting ideas but doesn't yield up much on the personal experience or interpersonal/sociological consequences; the consequences for the plot of the Buggers'/Formics' collective consciousness are also entirely predictable. Is there enough in later books to be worth reading with this theme in mind? If so, which ones?)

Suggestions

Dave
2022-09-27 17:42
Heinlein's "juvenile" SF novel _Time for the Stars_ is very much centered around telepathy between twins. The story takes a rather, uh, surprising turn by the end - also driven by telepathy...and Heinlein's proclivities.

https://en.wikipedia.org/wiki/Time_for_the_Stars

The indy comic book series _Elfquest_ features telepathy ("sending") between specific elven characters and their animal companions. The series may seem dated, but I re-read it pretty recently I think the story has held up extremely well.

https://en.wikipedia.org/wiki/Elfquest

The Pinis have also made Elfquest free to read online: https://elfquest.com/read/digitalEQ.html
Hannes
2022-10-20 12:34
I quite enjoyed Mother of Learning which features a variety of mental communications. Don't want to spoiler anything, but there is an extensive wiki, if you are interested in the concepts primarily and don't want to read 800k words. IMO it's worth it though.

https://www.royalroad.com/fiction/21220/mother-of-learning

I occasionally offer awards to internet strangers who send me recommendations I love. If I am so moved, your choice of:

  • $10 USD sent via PayPal
  • a personal thank-you note via snail mail
  • grab a drink with me sometime you're in Minneapolis (or I'm near you) and talk about the recommendation or anything else
Gratitude and brownie points awarded in all circumstances!
#9

There is no secret math. The biggest mistake people make with statistics is to distrust their intuition. In reality, once you do all the math, the things that seemed like they’d be problems are in fact problems. If anything, the math just turns up more things to worry about.

“The Cathedral of Statistical Control”, Dynomight [rt] [source]
#8
🔗 Short Posts and Short URLs

Control-Alt-Backspace post announcing the creation of this microblog, as well as a move to short URLs on CAB.

#7
🔗 Shortest date, and ketchup (Derek Sivers)

Pro tip: don't start a date by insulting the other person's interests (this may also end the date). Also, I've spent a grand total of ten hours in New York, most of them asleep, and I was able to pinpoint 35th Street and 8th Avenue on Google Maps in fifteen seconds.

#6
🔗 Searching for outliers (Ben Kuhn)

As explained in the popular consciousness by Nassim Nicholas Taleb, some things are more or less evenly distributed and you can think about them in averages, while other things are very unevenly distributed, to the point where only the outliers matter. Kuhn usefully terms these “light-tailed” and “heavy-tailed” distributions and points out that many if not most of the important distributions in an individual’s life are heavy-tailed (jobs, romantic relationships, business ideas, leisure activities, etc.). Then he explores strategies for improving your chances of obtaining a good outcome from heavy-tailed distributions in your life.

#5

One way I often like to think about behavioral questions is this: if everyone followed in these footsteps, would it make the whole organization (or community) overall better or worse?

Sophie Alpert, “Yak Shaving and Fixing” [rt] [source]
#4
🔗 Effective Flashcard Writing: Decomposing half a chapter of Thinking, Fast and Slow

I find it is often helpful to watch experts do things, whether they explain their thought process or not. In this video, I make some spaced-repetition flashcards in RemNote and explain why I'm making the choices I'm making.

#3

Has someone tried unplugging the United States and plugging it back in?

sign in front of an independent computer shop in Lindstrom [rt]
#2
🔗 Understanding the Long-Term Risks of Contraceptive Failure

Most people don't have an intuitive understanding of how small risks add up over time. When sex, bad statistics, and bad public-health messaging are thrown into the mix, people end up making bad decisions. In this article, spreadsheet simulator, and demo video, we explore the chances of unintended pregnancy over a person's lifetime – which are almost certainly higher than you think if you're never looked into it – and what you can do to reduce them. (I got interested in this topic on a whim after reading a history of AIDS had me thinking constantly about sexual health messaging for about a solid week.)

#1

Since I quit regularly using most social media, I haven't missed the ads or political screaming one bit, but I have found I miss being able to easily share random interesting things with the world. I'm hoping to resolve this and recapture a bit of the energy of Web 1.0 by posting on a simple website instead; perhaps a few people will still be interested enough to follow a website or RSS feed (remember those? I still use them!). This weekend, I wrote a tiny, likable tool called attopublish to manage the posts, and I'll tweak it as needed. attopublish will also be available as an open-source tool sooner or later for anyone who's interested.