Thankful to live in Massachusetts

Happy Thanksgiving, everyone. I’m going to take today and following few days to slow down and relax, look around me with a careful and thankful eye, and reflect on what I have to be thankful for.

I am thankful for my friends and family—for their love, loyalty, and support. I am thankful for where I live. I am thankful for a warm, dry home, access to good, healthy food, clean water, and a fuzzy, sometimes-affectionate cat named Donut.

I am thankful for my community. Cambridge is a great place to live. We have wonderful public and social services, a thoughtful municipal government, a vibrant and diverse population of interesting and often friendly people, good jobs, good bars—here’s looking at you, the Abbey— fun when you want it, quiet when you need it, tall trees, wild turkeys, fluffy bunnies, and four full seasons. I’m thankful for all of it.

And I am thankful for my state. I am both proud and horrified to say that Massachusetts was the only state in the lower forty-eight to vote Democrat everywhere on the county-level in the last presidential election. (Apparently, Hawaii did, too.)

As all parts of the country, folks in Massachusetts are hurting, too. I am thankful that my neighbors across the state voted against solutions that promote finger pointing, blame, and hate to ease their pain. I am thankful that in Massachusetts we voted to protect our environment, to fight for women’s rights, black rights, immigrant rights, Muslim rights, gay rights, and general civil rights, and to dignify people with the basic rights to health care, equal pay for equal work, and higher wages.

Are you thankful for you local and state governments?

On this day of thanksgiving, I hope you are, too!

Ask the Globe to investigate Trump’s appointees

I love the Boston Globe newspaper. I’m a subscriber. They do really good work, like this very readable informational piece on assault riffles.

So I thought, I don’t know much about Trumps appointees. And I can imagine a Thanksgiving conversation with my family going like this:

Do you know anything about this Harold Hamm guy Trump wants on his cabinet? —No? Me, neither.

And that’s no good. I don’t know anything about billionaire, oil-tychoon Harold Hamm. Instead, I’d like the conversation to go more like this:

Do you know anythign about this Harold Hamm guy Trump wants on his cabinet? No, let’s pull up his biography on the Boston Globe.

What! Hamm tried to get university scientists fired because he didn’t want them to report on earthquake activity associated with gas and oil extraction in his state?

Investigating Trump’s appointees and communicating their history is exactly what a good functioning, independent, free press can do. It’s a role critical to democracy because, in the end, lies and misinformation are no match for the truth. And an good informed citizenry makes for a stronger republic. So I called the Boston Globe news room to pitch my idea. Here’s what I said:

Good morning! My name is Joshua Reyes and I’m a subscriber to the Boston Globe. First, I’d like to that you for the good work the Globe does.

I have something that I like the Globe to do. I’d like you to write biographies of Trump’s appointees. I don’t know much about them. So when I talk with my family about politics, I’d like to say, “Let’s just look up their biography on the Globe.”

Can the Boston Globe investigate the appointees and publish individual bios of them?

The person who answered was really friendly and seemed to like the idea. She said she’d pass it on to their political editor.

You can call, too! The news room number is (617) 929-3100.

The press needs help your help. Investigations take time and money to do well. Reporters need a livelihood, too. In this society, you get the news you pay for. So you should buy a subscription to your favorite local paper. If you need a suggestion, though, go for the Globe.

What does Charlie Baker like about Steve Bannon?

Charlie Baker has once again proven he is a weak coward. He failed the Bannon test.

Bannon has a history of domestic violence, intimidation of victims, and the promotion of hate speech against gays, Jews, and blacks. Charlie Baker has said that he is concerned with Trump’s appointment of Bannon, but that he’s going to wait-and-see before pre-judging.

Baker, what more information would you like before making an assessment? I called yesterday to find out.

Here’s roughly what I said:

Hi, good morning. How are you?

My name is Joshua Reyes. I live in Cambridge, MA. And I have a few questions about some of the governor’s recent comments.

I’d like to know what he likes about Bannon’s past? Baker said we should not pre-judge his appointment. So please tell me what about Bannon does Baker approve of?

Baker’s aide told me that he had not commented on Bannon, but rather on the entire Trump administration—which is simply not true, Baker did comment on Bannon explicitly. After the aide told me she cannot speak on behalf of Charlie Baker, I asked:

How can I find out more about what he thinks? Will you tell him I’d like him to clarify his position?

Then I politely ended the conversation:

Thank you for your time. Have a good day.

You can call, too. It takes two minutes! You will feel big and strong and powerful! (617) 725-4005

Charlie Baker, what more do you need to learn about Bannon to judge him?

Governor Baker is a political coward

Throughout the past presidential election Massachusetts governor Charlie Baker has repeatedly and publicly proven himself a political coward. He perpetuated the false equivalence between Trump’s vague, hateful, disgusting, and violent demagoguery against Americans and Clinton’s sensible, articulate vision of governance.

Most damning, however, Baker did not vote. Baker is a coward.

Governor, you are an elected, public official. Voting is an honor and an obligation, Baker. You yourself hold office because other people voted for you. You must lead by example. Be a leader. Have a reasoned opinion and defend it. If you discover you are wrong, have the courage to admit your mistake and explain your new stance.

I don’t want my leaders to be perfect. But I do want them to lead.

Speak up. Vote.

Wayfinding among the Sacred

On a recent trip to the used books section of the Harvard Book Store, I asked a friend of mine, who is training to become a minister, to suggest an introductory title to religion. He picked out Mircea Eliade’s The Sacred and The Profane: The Nature of Religion. The staff had flagged this book as one of their picks, too, and previously caught my eye. So last week I went home with a copy of my very own.

In the introduction, the author explains that for the purposes of this book, the sacred is merely the opposite of the profane, which makes sense given the title of the book. It’d be surprising if they were secretly the same thing, wouldn’t it? At this point the text only hints at what that relationship between these “two modes of existence” actually is.

Shortly thereafter, the book dives in on sacred space. According to this account, sacred places mark identifiable fixed points in the landscape, against which a person can orient himself relative to the rest of the world. In contrast, profane space is “homogeneous  and neutral”. I suppose that because profane space has no distinguishing features, it’s impossible to navigate. But I find that counter to my intuition and to my experience. Landmarks have existed for a long time, and not even most of them are temples.

I live in Cambridge and visitors stop to ask me directions all the time. “Follow this street until you pass three stop lights, then make a left. Continue until you see Chinese restaurant on the right side. If you pass a supermarket parking lot on your left, you’ve gone too far.” Now, in these directions I’ve mentioned lots of landmarks to help strangers find their way. Yet I’d be hard-pressed to find much that is sacred in the stop lights, restaurant, or parking lot. Landmarks do afford familiarity to otherwise unfamiliar space. And they might signal safety or danger. (Don’t walk around that pond at night!) But sacrality? I think that they can, but aren’t required to. I’d be willing to concede that I’m wrong.

If everything that I use to orient myself is in some sense sacred, I’d be okay with that. But that means that just about every space I’ve visited is sacred. That absolutely everything carries with it some sort of special spark is a very, very old idea that I might be willing to admit to if you asked me directly. On the other hand, that makes sacred spaces, when considered as a whole, a  large homogeneous space itself. And that sounds suspiciously profane. (Unless, of course, each sacred space is sacred in its very own snowflake kind of way. Now, I may be simply confessing my my own limited capacity to experience the sacred, but a lot of my transcendent experiences have felt more or less the same to me. That shared feeling is, in part, how I know that they’re transcendent.)

In chapter one, I think that Eliade overstated his case or I misunderstood it. In some instances I do believe that sacred spaces help people orient themselves in the world, but I do not believe that every thing that helps people—even very religious people—orient themselves is sacred. It’s like how all squares are rectangles, but most rectangles are not squares. So too with signposts: most of them are profane, but a few of them are sacred to some.

Please tell Mary Fallin not torture, experiment on human subjects

Oklahoma has secrecy laws that makes it virtually impossible to find out where it gets the drugs executioners use to kill prisoners sentenced to death.

The drugs that executioners used for years are not available because manufacturers (in Europe) refuse to sell them in American markets. As a result, state executioners use drugs made in small batches, which may not be pure or even what they purport to be. State legislatures create protocols to administer drugs in untested doses and untested combinations. They are very literally experimenting on human subjects.

Last night, the state of Oklahoma experimented Clayton Lockett. And the experiment went terribly wrong. For forty-three minutes, the state of Oklahoma tortured Clayton Lockett. From James Downnie at the Washington Post:

Tuesday night, Oklahoma tortured a man to death. At 6:23 local time, a doctor began to inject Clayton Lockett with a sedative. Seven minutes later, convinced Lockett was sedated, the doctor then began to inject the second and third drugs in the lethal cocktail that were supposed to end Lockett’s life. But Lockett “began to twitch and gasp” after having been declared unconscious. He called out “man” and “something’s wrong.” He then “struggled violently, groaned and writhed, lifting his shoulders and head from the gurney before the blinds to the [execution] room were lowered 16 minutes after the execution began.” The doctor “intervened and discovered that ‘the line had blown,’ said the director of corrections, Robert Patton, meaning that drugs were no longer flowing into his vein.”

A fuller account can be found at the New York Times.

Being outraged, I wrote a letter to Oklahoma Governor Mary Fallin, who demanded the execution take place despite a stay by the Oklahoma State Supreme court, to show compassion and stop executions in her state until it can be done responsibly.

Here is what I wrote:

Dear Governor Fallin,

Please show true Christian love and a confirmed faith in the American democratic process by stay executions in Oklahoma an independent third party has determined a proven medically safe way to kill prisoners.

An independent third party cannot include anyone on your staff or who reports to someone in the state legislature.

(1) Will you agree to form an honest, independent party to review your state’s execution protocols?

(2) Will you agree to stay executions until a proven, safe, humane protocol to kill prisoners has been established?

A concerned American,
Joshua A. Reyes

Please write to her, too. You can email her here.

Round and round the robin goes

Recently I found it useful to implement a round-robin tournament. Here’s a little Python generator that produces schedules for you, for your enjoyment.

from collections import deque
def round_robin(size):
  if size < 2:
    yield []
    raise StopIteration

  teams = range(1, size)
  rounds = size - 1
  if size % 2:
    rounds = rounds + 1
  roster = deque(teams)
  half = (len(roster) + 1)/2
  for round in range(rounds):
    positions = [0] + list(roster)
    backwards = positions[::-1]
    yield [(positions[i], backwards[i]) for i in range(half)]

Arkansas Rep. Nate Bell is Heartless, Unpatriotic

Christ. Do some people really agree with hateful vitriol like this?

There are about forty-eight things wrong with the representative’s tweet. Here are two that struck me fairly immediately.

First, no one I know was cowering. Boston is a tough city. As someone more eloquent than I has noted, Boston was founded “by people so badass that they needed to buckle their hats to keep them on their God damn heads.” A million people obeyed officials’ requests to stay put to make the search for a sadly misguided 19 year-old more effective and safer for those of us at home and safer for the brave folks who are performing the search. Bostonians are patient, dignified, and humane. We are not hysterical, blood-thirsty, or craven. We do not need individual arms to maintain order.

Second, no one I know thinks an AR-15 with high-capacity magazines would make the situation safer. Instead, I’m glad that my tax dollars go to support the heroes we call police officers, fire fighters, and first responders. And I’m thankful that these well-trained, lion-hearted men and women are willing to put their lives on the line so that I don’t have to. I am proud to be from Boston and I am proud of how our state, its officials, and our civic champions are handling the situation.

So, Nate Bell, as far as I can tell, the answer to your profane question is zero. Nobody was cowering. Nobody wanted an AR-15 with high-capacity magazines.

I support mandatory universal background checks, a ban on high-capacity magazines, and compassion. I am against senseless violence, acts of terror, and simpleminded legislators.

I feel this way, Representative, because guns don’t keep people safe. That’s why it takes so much courage to be a police officer, firefighter or first responder. Situations involving guns are dangerous. Guns are designed to cause injury. It seems like no one explained to you how guns work before.

I hope that you never feel like you need to cling to a gun for safety. The lonely individualism of your Tweet makes me sad. I hope you and your constituents do not feel alone or afraid without a gun. I am confident that my neighbors, community, and government are working hard to keep one another safe everyday—not just in times of crisis. I wish the same for you and your constituents.

Further, nonviolent community vigilance works. It resulted in a peaceful arrest tonight. Had a scared, armed individual taken justice into his own hands instead of calling the authorities for help, we would certainly have had one or more deaths on our hands. I am very pleased that entire Boston community worked together, acted dispassionately, and ended this string of tragedies without further casualty.

In case you don’t read my blog, Representative Bell, I have written you directly and and plan to call your office Monday so that you don’t need to wonder any more. For anyone who wishes to join me, here is his contact information:

Phone 479-234-2092

Here’s hoping that this crisis ends quickly and peacefully.

Render D3.js-driven SVG server-side!

Recently I’ve been working on a congressional tweet aggregator to get a handle on what our legislators are saying. To make that easier to see, I figured I’d start adding some charts and lists and other snazzy dataviz gizmos that are so hot these days.

I like D3.js as a graphing library. It makes clean, interactive, data-driven charts a snap to make in just a few lines of Javascript. Then it does its magic to render the data in crisp SVG, which I am quite fond of. On my site, I wanted to turn the crank on the back-end for charts that don’t update all that frequently, inject them into my templates, and spare the viewers of my site the heavy-lifting required for multiple charts—not to mention my poor server that has to execute several complicated queries to do the appropriate counting to generate the data to back the charts.

After a little poking around on the internet, I stumbled on to PhantomJS, which bills itself as a full-stack headless WebKit. Perfect. It can ping my website periodically, load the chart pages, and extract the SVG, I thought.

Not so fast. The Phantom is excellent at reading SVG, and it’s even good at rendering it to PDF or PNG. But that’s not what I wanted! I just wanted it to spit out the SVG for me after D3 was finished making it, untouched. And since SVG elements don’t have an innerHTML property, I needed to think harder to find a solution; i.e., ask Google. But Google didn’t seem to know, either. So I wrote a tiny script to extract page elements by ID. Maybe one of you will find it useful, too.

var system = require('system');

if (system.args.length != 3) {
    console.log("Usage: extract.js  ");

var address = system.args[1];
var elementID = system.args[2];
var page = require('webpage').create();

function serialize(elementID) {
    var serializer = new XMLSerializer();
    var element = document.getElementById(elementID);
    return serializer.serializeToString(element);

function extract(elementID) {
  return function(status) {
    if (status != 'success') {
      console.log("Failed to open the page.");
    } else {
      var output = page.evaluate(serialize, elementID);
}, extract(elementID));