Getting Started With Let's Encrypt

by Jeff Bradberry

Let's Encrypt is a new certificate authority, run in a cooperative effort with the goal of making it easy for everyone to obtain and renew the certificates needed to enable secure encrypted connections for their domain. It's free to use, uses open standards and open source software, and provides certificates via a fully automated process. Major sponsors of Let's Encrypt include the Mozilla Foundation and the EFF.

Let's Encrypt entered public beta on December 3rd, so there was no longer any good reason to hold back from obtaining a certificate for my site. This blog post will go over the steps I took to get set up with a Let's Encrypt certificate, and to get everything working.

The documentation for the Let's Encrypt client can be found here:

I prefer to run my site on Debian, with nginx as the static file server and as a reverse proxy for my Django apps, which run on top of Apache. Since the nginx plugin for Let's Encrypt is currently 'highly experimental', I decided against using it. Additionally, my config files are jinja templates kept in version control, and are populated and pushed by Ansible …

Continue reading

Minimum Paragraph Widths, Revisited

by Jeff Bradberry

There's a great little demo up on, demonstrating a technique that uses CSS pseudo-elements to prevent paragraphs from becoming too squeezed when flowing around floated images.

The thing is, it didn't work when I tried to do it myself.

At least, not in my preferred browser, Firefox. And what was really puzzling was that the demo did work in the exact same browser.

Then I found Apparently, Firefox has had a bug until recently where elements with overflow: hidden set (perhaps scroll and auto as well) would fail to establish a new block formatting context when the element was at the top of the container. The demo works, then, because of the 1px red border. If you turn off that css using Firebug (or whatever), you'll be able to see the problem there as well.

My workaround? I've added a 1px top padding to my <p> elements.

I hope that this post spares someone else the frustration I experienced tracking this down.

Introduction to Monte Carlo Tree Search

by Jeff Bradberry

The subject of game AI generally begins with so-called perfect information games. These are turn-based games where the players have no information hidden from each other and there is no element of chance in the game mechanics (such as by rolling dice or drawing cards from a shuffled deck). Tic Tac Toe, Connect 4, Checkers, Reversi, Chess, and Go are all games of this type. Because everything in this type of game is fully determined, a tree can, in theory, be constructed that contains all possible outcomes, and a value assigned corresponding to a win or a loss for one of the players. Finding the best possible play, then, is a matter of doing a search on the tree, with the method of choice at each level alternating between picking the maximum value and picking the minimum value, matching the different players' conflicting goals, as the search proceeds down the tree. This algorithm is called Minimax.

The problem with Minimax, though, is that it can take an impractical amount of time to do a full search of the game tree. This is particularly true for games with a high branching factor, or high average number of available moves per turn …

Continue reading