Low level optimization

I have been doing a lot of computer programming recently, and I am struck by how many of the same principles keep recurring. No matter what project you work on, some things always seem to be true.

One of those principles concerns optimization. Interactive computer animation needs to be fast. This is especially true when you are trying to compute a virtual reality scene at 90 frames per second for both a left and a right eye on a VR headset that’s not all that powerful, like the Oculus Quest.

So you’re always trying to optimize things. But you don’t want to do that in a way that is going to make your program big and unwieldy and complicated.

It turns out that a good principle is to push down all of the optimizations to the lowest level possible. You need to find the place in your code where things are simple and stupid.

I think it comes down to the fact that computers are really fast but also really stupid. And you need to respect both their speed and their stupidity. If you can manage to remember that, you’ll be ok.

Conjunction

Saw the Jupiter/Saturn conjunction last night. Last night, December 21, you could see Jupiter and Saturn nearer to each other in the night sky than we would have been able to see since about 800 years ago.

If you didn’t see it, you haven’t totally missed it yet. Tonight and for the next few nights they will still be nearly as close.

It was magnificent. I bought a telescope just for the occasion, and I am very happy that I did. As an extra bonus, the three largest moons of Jupiter were stretched out in a perfect line with Jupiter itself, and the whole thing was quite beautiful and thrilling.

Now I have caught the planetary astronomy bug, and I want to see more. I am going to need to need a bigger telescope.

I imagine a lot of other people are having similar experiences, something that probably happens every time there is a major celestial event.

Maybe we can all form a club, We could call it the Astronomical New Devotees (AND) society.

Which iI guess makes sense, because AND is a conjunction. 🙂

Best comeback ever

Recently some people I know were talking. One was telling about her experience having had an expired visa while visiting another country.

At some point during her stay there this was discovered, and she was promptly forced to leave the country. Apparently the government in question was not very nice about it.

As she was relating this, she played up the drama of the situation. “I mean,” she said at one point, “have you ever had an entire country mad at you?”

There was a pause, and then one of her friends said, “Well, I’m Jewish.”

When product placement goes wrong

I remember going to the movie theater back in 2011 to see the sci-fi thriller Source Code back when it first came out. In general, it was a well made movie, with a cool VR-related premise.

Jake Gillenhaal made for a very presentable action hero, as he hunted down bad guys within a computer generated virtual reality world. The entire audience seemed to enjoy the movie quite a bit.

But there was one moment that stood out. At some point our intrepid hero does an internet search. He looks at the phone in his hand, punches the screen a few times, and before you know it, he is looking up something on Bing.

The moment that Bing came up, the entire theater erupted in laughter. Nobody in the audience had expected that.

The moment totally broke the fourth wall. After all, who would use Bing to do a Web search, when they could use Google instead? Certainly not the bad-ass hero in a cyber-thriller movie.

After a while everybody settled back into watching the movie, but the moment lingered. It had clearly been intended as product placement for Microsoft, and it had clearly not gone over well.

This was not, I think, a referendum on the relative merits of the two search engines, but rather a referendum on cultural acceptance. Sometimes it just happens — product placement goes wrong.

Music in a dream

Sometimes, when I am asleep and dreaming, I experience orchestral music. It sounds like a wonderful symphony, but one that I have never heard before.

When I wake up, I have the distinct impression that I had been to a concert, experiencing the offerings of an exciting composer, as interpreted by a great orchestra. But that’s generally as far as the memory goes.

This raises questions in my mind. Did I actually experience music? Was there a structure within my head that was in some sense equivalent to a musical score?

Or was it all entirely an illusion, a trick of the mind? Was my brain merely creating some sort of short circuit process, pushing some inner button labeled “feels like symphonic music?”

Maybe I will never know.

Optimal emotional variance

I wonder whether we could look at the general concept of “happiness” in terms of variance. Maybe happiness is not a question of whether we are feeling up or down, but rather the size of our emotional range.

If you are always in the same mood, things can get boring. On the other hand, if you have out of control mood swings, things can get scary, or even dangerous.

I suspect there is an optimal emotional variance that gives us maximum satisfaction in life. But maybe it’s even more complicated than that.

Rather than a single value of emotional variance, maybe what we need is variation in our emotional range. Sometimes we need to retreat into a calm emotional monotone, and other times we need things to get just a little wild and crazy.

So maybe it’s not about optimizing for emotional variance. Maybe it’s about optimizing for variance of emotional variance.

Hmm. Maybe I’ll look into that more when I’m in the right mood.

Jewelry shop

Today I walked into a jewelry shop. The shop owner was very friendly.

I suspect he was happy for the business. These days I am guess anybody in retail is glad for the business.

We said our hellos, and then he told me they were running a special today. “Oh, really?” I asked.

“Yes,” he said pleasantly. “Half off all earrings. If you buy one earring, you get the other one for free.”

It took me a moment to realize it was a joke. But then I laughed, because somehow it struck me as very funny.

I thought about that poor man, all day in his shop day after day, in the midst of a pandemic, just waiting for a customer to come in. And I wondered how many times today he had occasion to try that joke out on somebody.

I hope he had the opportunity to tell it many times.

Breakout room

Today I was on a Zoom call with seven other faculty members. We were working together on a research proposal for the National Science Foundation on ways to improve online communication.

At one point, a faculty member suggested that he and one or two others form a breakout room, so they could work together on a particular part of the proposal. Someone else said “I know how to create breakout rooms in Zoom. I’ll do it.”

About a minute later I got an alert on my screen inviting me to the breakout room. “How nice,” I thought. “The two of them want me to join them in working on that part of the proposal.” So I clicked “accept”.

I immediately found myself in the Zoom breakout room, along with all of the other faculty members. Every one of us had received the invitation, and every one of us had clicked “accept”. We had simply moved the entire meeting from one place on Zoom to another.

When we realized where we were, we all started laughing. Somebody suggested that we send the NSF a video of what had just happened. That would surely convince them, if anything would, that more research is needed.