Recently I took part in an episode for WIRED magazine, called Wired: Five Levels, where five people (a child, a high school student, a college student, a grad student and an expert) are asked to discuss the same science topic. This particular episode was about fractals, and I was the designated “expert” level interviewee.

I found the entire experience to be very inspiring. In fact, being asked on that shoot was what inspired me to implement that little Mandelbrot fractal explorer I posted some weeks ago.

I think they did a great job putting it all together. You can check out the episode here.

Cosmic joke

This morning I was somewhere where a random playlist of 1980s pop songs was playing. At one point The Bangles’ hit Manic Monday came on.

“Did you know,” I said to the person I was with, “that this song was written by Prince?”

“I can definitely hear that,” she said.

A few minutes later the next random pop song started. It was “1999” sung by the Purple One himself.

We just looked at each other. There was no reason even to say anything.

It was like we were hearing the same song again. Only with different lyrics and a more Princely arrangement.

I wonder what were the odds of those two songs coming up back to back? It felt like a good cosmic joke.

Tanks but no tanks

When I was a kid I was fascinated by the M4 Sherman, more commonly known as the Sherman Tank. That powerhouse military tank, topped off by a 75mm gun on a fully rotating turret, was used very effectively by the U.S. in World War II.

Those things were pretty much invulnerable, and were awesome if your goal was to ride into town and utterly destroy everything in sight. In a Sherman Tank, you could knock down or blow out entire buildings without missing a beat.

But I don’t think I would want one in my local neighborhood. A Sherman Tank would tear up the road, roll over and destroy cars, knock down traffic lights, and pretty much make any place unlivable.

And if some enthusiastic tank owner ever decided to shoot off a round or two, you might find your entire house reduced to rubble. Hopefully you and your kids would be lucky enough not to be home at the time, because otherwise you would all be dead.

Basically, if there is a Sherman Tank in your neighborhood, you are constantly under siege. You have essentially been reduced to being a helpless prisoner in a war zone — not a great quality of life.

Recently the NRA met in Texas, and various famous people got up and essentially claimed that there is no difference between a car and a Sherman Tank. Conveniently, nobody talked about Aaron Salter.

If I understand their reasoning correctly, I have a suggestion for the next NRA slogan: “The only thing that stops a bad guy with a Sherman Tank is a good guy with a Honda Civic.”

Stranger Things, season 4

Bingeing the long awaited new season of Stranger Things today. It’s even better than I had remembered!

And the great retro references are not quite about nostalgia, because it’s not so much that I miss the ’80s. It’s more that it’s so much nicer to see the ’80s happen to other people. 🙂

The Bible, The Bard and The Beatles

Since today is the anniversary of the release of Sgt. Pepper’s Lonely Hearts Club Band, it’s a good day to talk about a conversation I had with my brother recently. We are both Beatles fans, and I recently purchased a book, on his recommendation, which dives into detail about the music theory underlying the Beatles’ songs.

He and I agreed that if all hell broke loose in the world, that book, together with the complete Shakespeare and the Bible, would be good ones to grab from the bookshelves. Which of course hearkens back to H.G. Wells’ famous riddle.

At the end of The Time Machine, George grabs three books to bring forward with him in time for the benefit of the Eloi. His colleagues are left wondering which books he chose, and we never find out.

1895 was a bit too early for the Beatles of course. But if the story were taking place today, that book could very well be in the main character’s personal library.

So there you have it. If you want to kick-start a civilization, one option is to choose the three B’s: The Bible, The Bard and The Beatles.

Widget Wednesdays #21

Continuing the theme from yesterday of “simple is good”, today I’m going to talk about the concept of “hello world”. As most programmers know, one of the first programs you ever implement when you learn to program is one that just prints out the phrase “hello world”.

The idea is that you want to start programming something very simple, and then — once you’ve gotten your first program working — build from there. The nice thing about a “hello world” program is that it is very short and easy to write.

For example, in Javascript (the native language of the Web) a “hello world” program looks like this:

      console.log(‘hello world’);

It doesn’t get much simpler than that. Which got me wondering, what is a “hello world” program for interactive computer graphics on the Web?

So today I implemented one, which you can run here. All it does is let you move around a black square against a white background.

It works whether you are on a computer or a SmartPhone. The entire program file consists of 13 lines:

<center><canvas id=C width=1280 height=800></canvas>
<script>
let c = C.getContext('2d'), r = C.getBoundingClientRect(),
    w = C.width, h = C.height, p = [w/2, h/2],
    s = (u,v) => p = [u - r.left, v - r.top];
C.addEventListener('mousemove', e => s(e.x, e.y));
C.addEventListener('touchmove', e => s(e.changedTouches[0].pageX,
                                       e.changedTouches[0].pageY));
setInterval(() => {
   c.fillStyle = 'white'; c.fillRect(0, 0, w, h);
   c.fillStyle = 'black'; c.fillRect(p[0]-50, p[1]-50, 100, 100);
}, 30);
</script>

If you want to program interactive computer graphics for the Web, you can start with something this simple. From there you can keep building and building, and eventually create worlds of your own.

Simple is good

I spent quite a bit of time today trying to fix a bug in my computer program. I systematically broke everything down to cases, treated each case differently, tried to make sure that this one was parallel to that one, yada yada yada.

Nothing worked quite right.

Then, all at once, I realized that I could replace the entire elaborate structure by a single short line of code. And that one line of code worked like a charm.

I was now a happy man. I’m sure there is a lesson in here somewhere.

Future public transport

One of the problems with taking planes or buses or trains is that they are very unpleasant, on a purely sensory level. You are basically packed into a can with a bunch of strangers, and forced to just sit tight while you are collectively shipped off from point A to point B.

I wonder whether VR will at some point become mature to the point where it can have a transformative effect on such experiences. We get on board, put on our glasses, and spend time in the idyllic experience of our choice.

One person may opt for a day at the beach, watching the waves lap upon the shore. Another my choose to hop a ride on Harry Potter’s broom for a rousing game of Quidditch. Everybody follows their bliss.

There may come a point when people will decide to go somewhere on public transportation just for the entertainment value. Wouldn’t that be nice?

The utility of pets

If you have a dog, you know that a dog is pretty useless for anything practical. Basically it eats drinks, pees and defecates, and then spends most of the rest of the time just sort of napping.

Which means that from a certain perspective a dog is useless. It doesn’t do the dishes, take out the trash, help the kids with their homework, or anything else really.

Yet all across the world, many millions of people have dogs. From this we can conclude the following with certainty: Whatever it is that dogs do, it is clearly incredibly important.

Ironically, the clearer the evidence that dogs are useless, the more obvious it becomes that they are vitally useful.