Using macOS NSSpeechSynthesizer to generate audio content for Anki cards

As I’ve written before, I use Anki for Russian language learning. One of the skills to master in learning a foreign language is to quickly speak and recognize numbers. With a little help from macOS, I’ve developed a way of rapidly creating audible content of spoken numbers for my Anki cards.

That’s the good news. The bad news is that as of right now, you’ll have to have Xcode and build the app yourself. Someday, I’ll deal with all the official certificate stuff again (I’ve not developed apps seriously for iOS or macOS for several years now.)

My month without news

“The unexamined life is not worth living.” - Socrates

This year I decided to take a different approach to making New Year’s resolutions. Although many people make resolutions, less than 10% regard themselves as successful at achieving them.

I decided to overhaul the idea of New Year’s resolutions. Rather than committing to an entire year of change, I set up a schedule of 12 mini-resolutions in the form of experiments. My first experiment for the month of January was to work out daily. My February experiment was to determine whether avoiding the news and time-boxing my social media interactions would make me happier.

Background

For the entire month of February, I committed to avoiding browsing the news. Since the U.S. elections, I found myself unusually angry, anxious, and unhappy. I hypothesized that the constant stream of bad news about the America’s flirtation with authoritarian rule was seriously distorting my days.

Methods

First, I set limits on my social media use - no Twitter, and only 5 minutes Facebook time per day. I committed to avoiding the primary news sources both on the Internet and elsewhere.

Results

For the month, I did not use Twitter. Setting a 5 minute timer, I limited my Facebook time considerably. By blocking news-heavy feeds, I rarely saw anything political. Throughout the month, I did read a handful of essays that treated the current socio-political session in a more analytical way; so I had a vague idea of what was going on in the U.S. For the most part I was successful in limiting my time on Facebook. Rarely if I was tired or felt in need of a distraction between tedious work, I did look at Facebook more than once during a day.

Over the course of the month, my emotions definitely changed. I felt less angry about the U.S. political affairs. Rather than being outraged, I felt like the process of focusing more on analysis slowed down the whole process for me in a way that made me much less anxious. My productivity was definitely higher by avoiding the distraction of the news.

Discussion

Overall, this was a successful experiment, one that I’d like to continue. For news-junkies, this is anathema. The goings on in Washington, D.C. are, of course, important. But I’m limited in my responses. I can write or call representatives. But I’m registered to vote in Minnesota where all of my representatives and senators are Democrats anyway. The White House shut down its phone lines and I’m pretty sure the current occupants aren’t really interested in what I have to say anyway. And you can’t call Congressional leaders unless you happen to be in their district. I don’t live in the U.S. so I can’t easily march or protest. For me, it has been better to focus on my own circle of influence where I have a sense of agency.

If you’re feeling frustrated over the steady stream of bad news, I’d recommend this experiment.

Using rrdtool to chart Indigo data

Indigo currently shipping version 7 is a leading Mac home automation software package. One of it’s mostly widely-used features is its ability to execute user-provided Python scripts of AppleScripts. In my previous introduction to scripting Indigo with Python I showed how to use the Indigo plugin host to execute Python scripts. In this post, I’ll describe how I use a third-party charting package rrdtool to graph data from Indigo by taking advantage of Indigo’s ability to execute arbitrary Python scripts. This tutorial is focused on using Python as a bridge between Indigo 7 and rrdtool. If you are interested in a solution that takes advantage of AppleScript and bash scripts to do the samee thing, see this thread on the Indigo forums.

The right way to resist Trump

An interesting perspective on resisting Trump by focusing on policy and not personality:

“The Italian experience provides a blueprint for how to defeat Mr. Trump. Only two men in Italy have won an electoral competition against Mr. Berlusconi: Romano Prodi and the current prime minister, Matteo Renzi (albeit only in a 2014 European election). Both of them treated Mr. Berlusconi as an ordinary opponent. They focused on the issues, not on his character. In different ways, both of them are seen as outsiders, not as members of what in Italy is defined as the political caste.”

Don't feed the troll

In internet speak, “to feed the troll” means to try to engage people online who are just trying to stir up discord for no other reason than to provoke people. Trolls are almost always insecure, psychologically-damaged people, if not full-blown psychopaths who lack the usual social barriers that most of us possess. Thus, a common piece of advice tossed about on the Internet is: “don’t feed the troll.” This is sound advice.

AppleScript and iTerm2

Among the many reasons I use iTerm2 in lieu of the macOS Terminal is its AppleScript support.

I recently had the need to automate some tasks on my Amazon Web Services EC2 server in a way that takes advantage of iTerm2 AppleScript functionality.

Use case

I’ve found recently, that my screen sessions were disappearing. Although I haven’t completely excluded other causes, some have suggested that infrequently-reconnected sessions can be cleaned up. Since I’m not a Unix sysadmin, I’m not sure about this. However, I decided to test the hypothesis by writing an AppleScript that logs into my EC2 server, attaches to each screen session, detaches and closes the connection.

Law and order

“The Trump Administration will be a law and order administration.”

- whitehouse.gov January 25, 2017

NYT: Women who voted for Trump

Some insight into women who voted for Trump.

“I think he’s a really good man, deep down. This guy has such potential, and I truly believe he cares about our country and wants to help everyone.”

Well, by everyone, you mean “those exactly like me.” Actually, how about “just me”.


“But I had an 8-year-old who was totally on the Trump train. He talked me into taking him to a Trump rally.”

Trumpku No. 1


vicious neurotic,
blue blood coursing in black heart.
eyes piercing with lust.