Category Archives: cool

Cool, interesting, fun. Possibly not directly related to my job.

ROT cipher generator/cracker in R

The ever-clever Alex (my wife, dontcha know) sent me a sweet message of garbled gibberish letters with “ROT-13” at the end of it. Naturally, I googled. She used a ROT-13 cipher, which is a simple letter substitution cipher.

Of course, I could have just written the alphabet down on a piece of paper, taken two minutes, and read her (very sweet, as it turns out) message, but where’s the fun in that? Instead, I wrote an R function to generate or crack ROT-style ciphers.

To use this, you enter two arguments: the cipher text and then an integer indicating how many letters to the right (positive integer) or left (negative integer) the function should look for the “right” letter.

Example: My name, Darrin Rogers, is “yvmmdi mjbzmn” if I substitute each letter with the one 5 to the “left” of it in the alphabet. That message can be decrypted (after loading the function in R) with this code:

rot.n(“yvmmdi mjbzmn”, 5)

You can further test out the function with this string, each character encoded with the letter 9 positions away from it in the alphabet:

“evmvi xfeer xzmv pfl lg, evmvi xfeer cvk pfl xf”

Here’s the code.

Continue reading

And that’s why you never report point estimates without variability estimates

This piece tells a fascinating story: a farm in Kansas that has had very bad things happening to it for years, all because someone wrote an app that doesn’t report variability estimates when it reports point estimates.

In other words, this mapping app has a hard time figuring out where things are, sometimes–suicidal people, shady businesses, criminals, etc.–and so it reports its best estimate, but doesn’t mention that it is an estimate, and certainly does not report the level of uncertainty.

In other other words: when all it knows is that something is in the US, it tells the user that the thing is right at the center of the US. Reasonable, right? It’s a stats thing: use the center when you don’t know the value. But app users don’t know it’s an estimate, so they show up at a farm in Kansas and make the residents’ lives a living hell.

Point estimates need variability estimates.

Free Will is Bad for (the Study of) Psychopathology?

I clicked the title of this piece, despite it being in Psychology Today, which doesn’t always report as scientifically as I would like. Because I am interested in thinking and research about “free will.” I expected another piece saying what most of them say, but did not expect the very insightful discussion of how a belief in free will might play into mental illness–how we conceptualize it, how we study it, how we talk about it, and how individuals experience it.

Kudos to Stankevicius, for exploring a rarely-considered but perhaps very important implication of the “do we have free will?” issue.

Notes to students:

  1. This is written by a psychiatrist (i.e., an MD), not a psychologist. You might see a different style of thinking, and you will definitely see some psychiatry-specific terminology.
  2. Read the article at your own risk. The philosophical and scientific question of whether we have “free will” is a very deep rabbit hole. You don’t necessarily come out feeling comfortable.

American social/economic mobility: Interesting gender patterns

As usual, Five Thirty-Eight is awesome. This recent post about American socioeconomic mobility–the likelihood of an individual having a higher SES than her or his parents–is a great read for the demographically- or data-minded. Of particular interest are the male/female patterns in light of starting out wealthy vs. poor. Men and women have clearly different trajectories and opportunities. Fascinating stuff.

Diversity goes back a long way

Some scientists analyzed the remains of four people who lived (and died) 2,000 years ago in London. In just these four people they found evidence of life (and possibly ancestry) in Africa, ancestors in southern Europe, and a woman who was “genetically male.” I guess London has been cosmopolitan for quite some time.

Indigo Girls: November 14, 2015 – Babeville, Buffalo, NY

I’ve been an Indigo Girls fan since 1990, when a girlfriend gave me Closer to Fine on a mix tape. I followed their music–in recordings only–through their next two or three albums, and then on and off over the ones after that, but I’ve kept listening to those 1990s songs. I can sing along with most of their first record and Nomads, Indians, Saints. I love many of those songs, and think the rest are OK. So they were just a band to me, until last night. I had the sense that they were good in live shows, but that vague understanding didn’t approximate the reality: in recordings the Indigo Girls are really good–deeper, more meaningful music than most of what’s been out there for three decades–but in person they make sense. All sorts of things come together with a satisfying clicking sensation. Before last night I did not even quite know the difference between Amy Ray and Emily Saliers, but now it’s impossible not to know, and understand, that difference. Continue reading