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 ROT cipher generator/cracker in R

So this just happened

Today it snowed somewhat heavily. The parking lot was a mess. I found a spot, though that put me less than a foot from cars on either side of me (you know how it goes in snowy parking lots). I’m assuming that’s what this is about. I got back to my car after a day of teaching and found a bag of garbage stuffed under my windshield wiper with a note stuffed into it.

I guess I can take comfort in knowing that at least this student can spell these basic words (good job, anonymous SUNY Fredonia student!). On the other hand, what if I actually were African American? I probably wouldn’t be so calm about this. I don’t think the person saw me at all, given the snowstorm while I was parking, but who knows?

This doesn’t seem like the kind of thing to report to the police, but it’s disconcerting knowing that a student who thinks this is OK is enrolled in my school.

So brave.
Penmanship demonstration #1

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.

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 Indigo Girls: November 14, 2015 – Babeville, Buffalo, NY

America’s STEM obsession is not only narrow, it is dangerous

In this excellent article, Fareed Zakaria argues that our recent practice of valuing STEM education at the expense of a more broad-based liberal education will screw America over, in the long (and perhaps not-so-long) run. For one thing, it is becoming obvious that critical thinking, creativity, “people skills,” etc. are what make economies flexible and successful (a point that emerging powerhouses like China are starting to emphasize)–and America has been a flexible, vibrant economy for a century, despite the fact that our students’ math and technical skill test averages have never been particularly good, compared to other nations’. Another point is that STEM skills are exactly those skills next on the chopping block for computerization. Computers will soon be able to write their own code, for instance, but they will not (yet) be able to write their own rich, engaging narratives. So we are pushing students increasingly toward those fields whose skills are most likely to be obsolete in a generation or two, and systematically strangling the university programs that teach the skills most likely to help our current and future graduates survive the economic and career upheavals that will only increase in frequency and intensity from here on out.


There are two increasingly cynical possibilities for why the American government and people are so willing to ignore the (potentially obvious) points Zakaria made: First, nobody currently calling the shots for higher education funding has any incentive to think about other people or about the long run, because they are blinded by their own short-term financial motivations and/or their own thinking, crippled by a lack of the benefits of a liberal education.  Second (and this one is much more cynical; I wish I could find the source, where it was said far better than this): The last thing people currently in power in this government want is a populace capable of imagining alternative systems. I’m pretty sure, however, that even the most Machiavellian government administrator is perfectly OK with a population full of highly skilled technicians who have never taken a humanities or social science course.

Validation! I’m not faking all those hours.

This article in Vox describes the typical academic’s work week through a variety of studies. Overall, they fit my experience. When things are at their slowest, my week is maybe around 45 hours. This sounds like a whine, but it’s not about my job: I really enjoy what I do, and don’t mind 45-50 hours most weeks. When my week goes over 60 hours, which happens fairly often, I occasionally question my life choices, and during those insane weeks (like grant preparation weeks) when I sleep 4-6 hours per night and do almost nothing else (i.e., taking time to pee or eat breakfast seems like minutes I can’t possibly spare) I want to beat myself into unconsciousness with a shovel. I’m really trying to avoid having those weeks ever again… but, realistically, maybe I can just keep them down to maybe once a year. Continue reading Validation! I’m not faking all those hours.

Blackboard Learn is of the devil. THE DEVIL.

Today’s first I-Hate-Blackboard experience: Availability Follies

I have a merged course in BbL. Although about 65 students are enrolled, I have 105 in Blackboard, and they (plus more) will all be there for the rest of the semester, because apparently it’s very difficult to remove them or something. So my gradebook has a pretty poor signal-to-noise ratio.

I’ve been assuming that about 65 of those students were my true enrollees and the rest were irrelevant to the course. The fact that 30 of the students have the course listed as “unavailable” in the gradebook seemed to bear that out. Now I find out that some of the students for whom the course shell  is not available are actually enrolled in the course and blocked from participating. I got a helpful email from the online learning tech folks showing me how to make the course available for those students. Here’s the process:

  1. Go to Users & Groups
  2. Choose Users
  3. Find the students whose availability is set (for reasons I still don’t understand) to “No”.
    • Note 1: the list, in my case, must be repaginated to display everyone at once–with a predictable increase in page load times–because BbL is incapable of remembering which page of the list I was on, otherwise).
    • Note 2: No, of course you can’t just sort the list by the “availability” column and put all the “No” users at the top. That would be crazy.
  4. One by one, for each name:
    1. Hover by the name so the little “options” button appears
    2. Click the button
    3. Select the option to change availability
    4. Wait for the new screen (a full screen takeover, not a pop-up) to appear
    5. Mouse to, and click, the availability selector drop-down
    6. Select “Yes” and click
    7. Mouse to the other side of the screen and click <submit>
    8. Repeat 30 times
  5. No, you can’t do this to multiple users at once–why would you even ask that?

Continue reading Blackboard Learn is of the devil. THE DEVIL.

Dear SPSS: We Have To Break Up

Dear SPSS (or PASW or whatever you call yourself these days),

It’s not working out. For the past few years I’ve tried to pretend everything was all right–and even before that I wasn’t completely satisfied, but I never really expected to be, because there’s no such thing as a perfect statistics application, right? So who’s to say what’s “good enough” in this crazy, mixed-up world? Maybe my standards are too high if I’m not content with your admittedly vast array of analytical features. I guess what I’m trying to say is, It’s not you; it’s me. Continue reading Dear SPSS: We Have To Break Up

Not Psychology – UTPA Mariachi at the White House

Having heard UTPA Mariachi perform, I can attest that they are awesome. The harmonies are tight, the vocals are bold and rich, and the instrumentation is gorgeous. So, imagine my surprise to see them turn up at the White House!

Come to think of it, perhaps that’s why the Tea Party won all those congressional seats. Perhaps the Mariachi distracted President Obama.

Listserv Flame War Results in Insight

A recent… ah… lively discussion on the APA [EARLYCAREER] listserv — prompted by a member’s marketing for her Mary Kay business — prompted a number of interesting and sometimes quite thoughtful responses. Here’s my favorite, from someone named “Michael”:

Hello all,

Speaking for myself, I’ve been by turns fascinated, angered, and frightened by the recent conversations here. But rather than focusing on the opprobrium, I think its probably important here to take a moment to reflect on the anxiety aroused by the recent horror stories posted here. In addition I’m supposing that many of us had a negative reaction to the “Mary Kay” posting as it seemed to violate the boundaries of what we consider to be our profession. However, in the context of the previous discussions, the strength of the feelings got me thinking. I find myself wondering if part of the moralizing reaction has something to do with the discomfort generated by the ways in which we view ourselves. Are we business people? Scientists? Medical professionals? Artists?

Most of us are quite bright, and could have been anything we wanted. Somehow, though, it seems as though we’ve payed handsomely to enter a profession where we must be everything. Of little help is the discomfort fomented by the exclusionary philosophical rivalries that exist in our discipline based upon the sturm und drang of our struggle for legitimacy in the public eye. Of course, besides what we give up during our years of training, it cannot be forgotten that we sacrifice so much of who we were to become, well, whatever it is we are. But beyond these concerns I can’t help but have the impression perhaps some of the anger is more about this confusion than anything else.

That hit me deep down. Yes, I could have done a number of things (certainly not anything) with my life, but I’m doing this: clinical psychology. I like the fact that my field allows me to wear a lot of hats. But it certainly makes for some interesting questions of identity, and when identity is threatened most people start behaving very weirdly.