Trump, the conspiracy theorist

One of the most striking features of the GOP front-runner is his special fondness for conspiracy theories. From the (non-existent) connection between vaccines and autism to the “real culprits” behind 9/11, he shows the typical clustered endorsement of multiple conspiracy theories.

The question about whether this a form of pandering or a genuinely held set of perspectives is interesting, though barely relevant. In the former case, the abandonment of reason to achieve a political goal is an egregious fault. In the latter case, it sheds considerable light on crucial decision-making capacities. Endorsement of conspiracy theories requires a set of cognitive biases that fundamentally hobble evidence-based decision making.

The great polemic Christopher Hitchens called conspiracy theories “the exhaust fumes of democracy.” A lot of people are apparently intoxicated on those fumes.

The spread of anger in social networks and its implications for political violence

An ingenious study using the massive Weibo network revealed insights into the spread of certain emotions through social networks. Weibo is a social network platform not unlike Twitter. It is also hugely popular in China with millions of users making it an ideal platform for understanding how emotional states between socially-connected users correlate with each other.

But the highest correlation by far was among angry users. Rui and co say anger strongly influences the neighbourhood in which it appears, spreading on average by about 3 hops or degrees. “Anger has a surprisingly higher correlation than other emotions,” they say.

Network emotions

In the figure above, anger is depicted in red, and shows a greater pervasiveness than joy, sadness, and disgust. The study quantitatively looked at the correlation of emotion across the network and found that of all the emotions studied, anger showed the greatest diffusion.

Undoubtedly this mirrors the infectiousness of hate among like-minded people on other social network platforms and in the “real world.” The potential for each person to become a node in a network of anger and hate is what is frightening about the violent political spectacle that has come to characterize the U.S. presidential campaign of Donald J. Trump. Anyone who carefully listens to his rhetoric and its results cannot help but see the similarities to that of pre-WWII fascists. Furthermore, anyone who thinks that humans have fundamentally evolved in less than 100 years is mistaken. The latent potential for large numbers of people to do harm to under-represented scapegoats is still there.

This is a bad situation.

JavaScript in Anki cards

[N.B. 2016-03-26 Nathan Ifill pointed out that it is possible to use Anki’s built-in conditional replacement feature to do what I’m illustrating. I’ll have to work on another example!]

Anki is a widely-used flashcard application. If you’re learning a foreign language and you’re not using Anki, you should be.

If you are using Anki and are picky about the appearance of the cards, you should know that JavaScript can be used in the card template. This opens up a number of possibilities for dynamic cards. I’m just touching on the technique here.

In my Russian deck, I sometimes have example sentences in Russian with an English translation. The fields are sentence_ru and sentence_en. Here’s the catch, when a sentence is available, I want the card to display it. When there’s not a sentence, I don’t want any formatting artifacts on the card. Here’s an example of a card with no example sentence:

Example card

The hyphen separating what should be the Russian and English sentences still appears on the card. Let’s fix that. To do that will use JavaScript to detect if a sentence is present and modify the card’s HTML if it’s not. All of our work will be in the card template definition.

First, we’ll define some CSS styling for the sentence fields.

1
2
3
4
5
6
7
8
9
10
11
span.en {
font-family: Courier;
font-size: 16px;
font-style: italic;
}

span.ru {
font-family: CourierNew;
font-size: 16px;
font-weight: bold;
}

Next we’ll define the part of the card where the sentence (if available) should be displayed.

1
<span id="ru" class="ru"> - </span>   <span id="en" class="en"></span>

Now, if we have an example sentence pair, then we’ll see a Russian sentence and the English translation separated by a hyphen. To deal with the case where no example sentence is available, we finally get to use some JavaScript. At the bottom of the card side HTML, add a script:

1
2
3
4
var content = document.getElementById("ru").innerHTML;
if (content.length < 4) {
document.getElementById("ru").innerHTML = "";
}

This works by looking at the content of the Russian sentence tag. If the length isn’t long enough, then we conclude that it’s just the spaces and hyphen. So in that case, we just remove all of the content. You’ll need to enclose the script in <script></script> tags, of course.

Here’s what the card without example sentences looks like with our script applied:

Fixed card

By adding a sentence pair, we can see that the styling is applied and that the script finds our content and ignores it:

Fixed card with sentences

This is a simple example of how JavaScript can be used in an Anki card template. It looks like it could be a very useful way of dynamically styling cards.

Memorization has a bad reputation in education today, but it underpins the abilities of all sorts of high-performing people. I often refer to this article from 1999 about how to better organize information for memorization.

My favorite pieces of advice:

  • Do not learn (memorize) if you do not understand.
  • Stick to the minimum information principle.
  • Use imagery
  • Avoid sets and enumerations
  • Use mnemonic techniques.

Observation: Facebook groups don't work

I’m reluctant about using Facebook. Recently I returned after a 5 year sabbatical. It seems about the same as it was when I left. But I had never really used Facebook groups before. So when a friend launched a group around a topic of interest to me, I joined enthusiastically. While watching the numbers grow quickly in the first few days, I realized what a difficult platform it is for having any kind of meaningful discussion.

On Facebook groups, the content scrolls by, eventually disappearing entirely, at least from the serious users’ perspective. Although comments are threaded to an extent, the depth is limited to 2 or 3 levels. After that, Facebook begins to automatically insert the name of the person being responded to into the comment but it doesn’t indent the comment or in any other way show where it fits into the hierarchy. At its best it’s confusing, and at its worst, it can lead to misunderstandings.

The technical solution for serious groups is a hosted forum where comments are threaded and the community leadership organizes and moderates the conversation. But the problem is that for some communities, that’s not where they “live” online. It’s Facebook or nothing.

Facebook has smart designers and engineers. Surely they see the problem that the user faces? The skeptic in me concludes that they profit by having people linger aimlessly on the site. The easier it is to find something, the briefer their experience. In other words, by making information harder to find, you end up bumping into stuff they want you to see by mental Brownian motion.

It’s easy to set up a Facebook group; but for users who want to see information organized in helpful ways, it’s a terrible experience. Very chaotic.

Scalia and the secret society

It was recently reported in the Washington Post that the late Supreme Court Associate Justice Antonin Scalia had ties to a secret society of hunters called the International Order of St. Hubertus and that several of the guests at the Texas ranch where Scalia died were members of this group.

Surely I’m not the only one that finds this a bit weird. A secret society of hunters? I don’t know the first thing about hunting but from I’ve seen, the only thing secret about hunting is sneaking up on an animal so you can kill it.

No. My guess is that the hunting story is a cover. I’m no conspiracy theorist but I’ll bet the real story is closer to the secret society in Kubrik’s “Eyes Wide Shut”.

Scalia and the secret society

The password is “Fidelio”.

Mak-kimchi 막김치

Years ago, my wife and I stayed overnight in Seoul on the way home from New Zealand. An amazing array of types of kimchi accompanied breakfast the following morning; and from then on, I was hooked on this Korean staple. For the last few years, I’ve gradually honed my kimchi-making skills. For simplicity, I tend to make mak-kimchi which means “roughly made kimchi.” In traditional kimchi, who cabbages are fermented intact (though usually split in half to permit the salt and later, spices to enter between the leaves.) However, getting the cabbages properly salted it very tricky and often neglected. So instead of making the more traditional kimchi, I’ve specialized in mak-kimchi. The main difference is in the way that the cabbages are handled. In this case, the cabbages are slided into approximately bite-sized pieces then salted, wilted, rinsed, mixed with the spices and allowed to ferment.

I’m not expert in kimchi-making though I’ve made it many times. Instead, I’d like to point out a few things that I’ve learned from using and adapting different recipes. My current version is somewhere between the following two:

You should feel free to follow either of the two recipes. For now, I’ll just highlight some of the issues involved.

Salting

For mak kimchi, the salting process isn’t quite as difficult and tricky as with traditional whole-cabbage kimchi. It is said that ordinary table salt is inadequate to properly wilt the cabbage. This is true of whole-cabbage kimchi; but I’m not sure about mak kimchi. Assuming that it is, I use crystalline Korean sea salt. If you have a Korean grocery nearby, you will find it there. I found my initial supply on Amazon.

Some recipes suggest sprinkling the crystalline salt between layers of leaves in the colander. From my experience, very little wilting occurs this way. The reason is obvious. There’s just not enough moisture to dissolve the salt and allow it to work. Therefore, both of the recipes mentioned earlier advise making a concentrated brine solution and pouring it over the leaves. I agree completely with this approach because you get much more complete and uniform wilting.

A few pieces of advice about this process:

  • Pour the bring solution very slowly over the leaves. If you pour too quickly, the liquid will run off and fail to cover the leaves.
  • You need to turn the leaves over and mix immediately after pouring the brine.
  • To keep the uniformity of the process, turn the leaves thoroughly every 30 minutes.
  • About 2 hours is enough salt exposure for mak kimchi. Or you can use the stiff white leaves as a guide. When they are rubbery and bendable, the salting can be concluded.
  • After washing off the salt solution (3 times is authentic) the leaves must be dried very thoroughly. Otherwise, the spices don’t adhere properly.

Mixing leaves and spices

I’ve made kimchi with a rice porridge base and without it. I think it is better with the porridge because of the action that the porridge has on the initial adherence of the spice mixture to the leaves. The recipe at Maanchi.com advises a porridge but the one at Korean Bapsang does not. It’s very easy to make and I believe that it does promote a more cohesive mixture at least initially before the fermentation process gradually breaks everything down and dilutes it.

Proportions

The cabbages I’ve used come in so many sizes that it’s hard to get a fix on the proportions. Although I have not yet done so, I think it makes sense to weigh the cabbages and work out a proportion for certain ingredients like the fish sauce, and ferment salted shrimp. (Korean Bapsang uses salted shrimp and Maanchi uses salted squid.) Controlling the amount of salt in the finished kimchi is difficult since we’re adding salt in the form of salted shrimp or squid along with fish sauce. I’ve come to the conclusion that you simply have to do it on the basis of taste. For that reason, reserving some of the salted fish and fish sauce to adjust at the end makes sense. On the subject of fish, although we are mostly vegetarian, consuming fish rarely, I’ve compromised on the topic of kimchi although there are vegetarian recipes around.

Fermentation equipment

Harsch crock The fermentation needs to occur in an air-tight container. I use Harsch water-seal ceramic crocks for the fermentation. I have both a large and a medium crock. I saw recently that Harsch no longer makes these crocks.However, there appear to be many other suppliers that produce a similar product. The medium gets most of the use because it easily holds the amount of ingredients from two cabbages. Both were purchased from Amazon. Be sure to buy the weighting stones. These are essential for keeping everything pushed down so there are no air pockets inside. The traditional vessel for fermenting kimchi are onggi (옹기). Unfortunately, I haven't been able to find traditional onggi either in the U.S. or Canada; but since I'm satisfied with the German-made crocks that I use, I have not looked very thoroughly. One final note about loading the fermentation crock. Be cautious about overloading it because you will struggle to get the pressing stones into the crock due to lack of space. If you first compact the kimchi with your hands you'll have a little more room. You'll nearly the height of the stones to wiggle them into the crock.

Fermentation process

I prefer fairly well-fermented kimchi; but tastes vary. Currently, I’m leaving the fermentation crock out in the kitchen for three days. As the fermentation gases build up in the pot, you will hear a characteristic “plop” as the pressure overcomes the water-seal. After the room temperature fermentation, I put it in the root cellar if available for another day, then into the refrigerator. After a total of a week under water-seal, I remove it from the crock and store it sealed in ordinary storage containers in the refrigerator.

At some point I need to document my actual recipe since it is somewhat uniquely positioned between the two referenced versions.

Automate hexo blogging tasks with Grunt

In my never-ending journey to find the optimal blogging platform, I wandered into the hexo camp. Among its many attributes is speed. Compared to Octopress, site generation is very fast. However, deployment has been tricky. Since I host my blogs from an Amazon S3 bucket, I tried to use the aws deployer commonly used with hexo; but I could never get it to install properly on OS X 10.11. So I wrote my own deployer that essentially just runs an AppleScript that handles the synchronization task. It is very slow. So I’m always on the lookout for faster deployment schemes. It looks like a Grunt-based system is the ticket.

Starting point for hexo automation

Chitrang Shah wrote a series of articles on setting up a blog using hexo, Amazon S3 and Grunt. His piece on automating deployment with Grunt was the starting point that I needed. His solution relies on the grunt-s3 plugin which unfortunately is no longer supported and doesn’t work with current versions of Grunt. But the concept is sound.

First more about Grunt:

About Grunt

As the Grunt page says, it’s a JavaScript task runner, meant for automating repetitive tasks like testing, deploying, etc. It installs easily:

1
npm install -g grunt-cli

The above will install grunt globally on the local machine. To use Grunt to automate your blogging tasks, you need to install the grunt shell plugin in the top level of your blog’s directory.

1
npm install grunt-shell --save-dev

Install Grunt plugins for sitemap and robots.txt

Install two additional plugins grunt-sitemap and grunt-robots-txt.

1
2
npm install grunt-sitemap --save-dev
npm install grunt-robots-txt --save-dev

Install Grunt plugin for S3 deployment

Here is where this solution diverges from Chitrang Shah’s. Instead of grunt-s3, I’m using grunt-aws.

1
npm install --save-dev grunt-aws

To use this plugin, you’ll have to modify Shah’s Gruntfile.js. Create the Gruntfile.js at the root level of your blog’s local directory. This file specifies the actions that are available from the command line.

1
2
3
4
5
6
7
8
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
aws: grunt.file.readJSON('grunt-aws.json'),
// additional Configuration
});
// load and register tasks
};

Loading the npm tasks is straightfoward:

1
2
3
4
5
//Load NPM tasks
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-robots-txt')
grunt.loadNpmTasks('grunt-sitemap');
grunt.loadNpmTasks('grunt-aws');

Then we just need to string the tasks together in logical sequence.

1
2
3
4
5
6
7
//Grunt tasks
grunt.registerTask('default', ['shell:clean', 'shell:generate', 'sitemap:dev',
'robotstxt:dev', 'shell:server']);
//grunt.registerTask('staging', ['shell:clean','shell:generate','sitemap:staging',
'robotstxt:staging', 's3:staging']);
grunt.registerTask('deploy', ['shell:clean', 'shell:generate', 'sitemap:production', 'robotstxt:production',
's3']);

I’m ambivalent about staging for a small blog; so I’ve left it out. YMMV.

Use a separate file that is not checked into version control for your AWS credentials. My grunt-aws.json looks like this:

1
2
3
4
5
{
"accessIdProduction" : "...,
"accessKeyProduction" : "...",
"bucketProduction" : "..."
}

The complete Gruntfile.js for this blog is available as a gist.

Finally, to use our new blog automation to clean, generate, and serve the blog locally, it’s just grunt. To clean, generate and deploy, it’s grunt deploy. This is a very straightforward way to automate your hexo blog and speedily deploy it to S3.