Cow Tipping

Went down a long and winding rabbit hole and stumbled upon this:

Scientific studies have been conducted to determine if cow tipping is theoretically possible, with varying conclusions. All agree that cows are large animals that are difficult to surprise and will generally resist attempts to be tipped.

And so now you know as well. Source (such as it is): https://en.wikipedia.org/wiki/Cow_tipping

Also, should you be planning on attempting a cow-tip:

Estimates suggest a force of between 3,000 and 4,000 newtons (670 and 900 pounds-force) is needed, and that at least four and possibly as many as fourteen people would be required to achieve this. 

So make sure you have enough people with you.

Does Anyone Have a Pen?

I try to look at problems at the right level of abstraction. Here’s my illustration of why I think that’s important.

You’re in a group of people and someone asks: “Hey, does anyone here have a pen?”

What they are likely really asking is “does anyone have something to write with” because most of time a pencil would also be ok. Obviously there are exceptions — if they are signing a legal document. But most of the time people just idiomatically ask for a pen regardless of whether there is a strict requirement for a pen and not a pencil.

“Does anyone have something to write with” opens up the solution space and admits pencils, markers, crayons, and maybe even a lump of coal (lol) as possible answers. In contrast, “does anyone have a pen” presupposes the type of the solution within the question itself.

Go up a level of abstraction in your questions and thinking. Maybe go up multiple levels; even “does anyone have something to write with” could be too specific. Need to remember where you parked your car at the airport? You could write it down in a notebook. Or you could take a picture of the lot location with your phone. But maybe your phone is out of battery so you can’t … prompting you to ask a stranger to borrow something to write with. If whoever you are asking doesn’t have a pen but has a phone they could still help you (let’s ignore some privacy concerns for this illustration). They could take the picture with their phone and send it to you (to receive when you charge back up). Going up another level of abstraction to “how can I remember this” instead of “anyone have something to write with” admits even more potential solutions into the equation. At least we can think about them even if in this case we might decide not to share our phone number with a stranger.

Go as high up the abstraction chain as you can. That’s where all the good ideas come from.

Supreme Ruler of the Universe: Thermostats

When I am Supreme Ruler of the Universe, people who crank the room thermostat down to 50 because they think it will somehow cool the room off faster will be forced to live one week in a room that is 50 degrees, without any warm clothes, coats, or blankets.

Wildlife Cameras

Installed some new wildlife cameras. Haven’t seen anything new/unusual yet other than this “non-typical” deer:

It’s 50/50 – it either happens or it doesn’t!

There’s a cliche probability joke, where the answer to any question, no matter how complicated, is simply: “It’s 50/50 – either it happens or it doesn’t!” and now I’m proud to say I got that joke into a Couch Slouch column in WaPo: https://www.washingtonpost.com/sports/khris-davis-owns-sports-greatest-statistical-oddity-ever/2019/04/21/473ad022-6450-11e9-82ba-fcfeff232e8f_story.html

I also managed to work 52-factorial in as well, with full digit expansion! Enjoy.

python: Decoding multiple JSON strings in a file

I wanted to be able to decode a stream that had multiple, undelineated, JSON string representations in it. For example, a file like this:

[1, 2, 3] [4, 5, 6] [7, 8] [9, 10, 11, 12]

Which has multiple JSON arrays in it, separated only by (optional) whitespace. Perhaps they might be separated by other characters in other applications (e.g., comma separated JSON strings)

First stop, as always, was stackoverflow, which had some relevant answers, like this one:

https://stackoverflow.com/questions/6886283/how-i-can-i-lazily-read-multiple-json-values-from-a-file-stream-in-python

I decided to write a variant of the several “read it in chunks, try to JSONDecode it, keep reading more if it doesn’t yet parse” solutions. Here is my take at this problem, as a gist:

https://gist.github.com/outofmbufs/bcf3bccc1fe0bb0824871ec5e02cc60e

Posting this in the hopes, as always, that someday someone will be looking for something like this and stumble across it via google (if I’ve somehow worked enough key phrases into this posting)