Author Archives: Benjamin Atkin

2018 New Year’s Resolutions

I’m setting three resolutions for the next year:

  1. Go for a 10 mile run each month
  2. Study Spanish for at least 10 hours each month
  3. Run my first triathlon

Each of these are things that I think are very achievable, and likely not to be achieved if I don’t resolve to do them. They also don’t take up so much time and effort that they prevent me from coming up with new goals during the year.

Perfectionism

Perfectionism is stifling.

A perfectionist should look for good strategies to get work done despite their perfectionism.

Some strategies, such as trying to fake being a non-perfectionist, are not good ones.

Under this strategy, the perfectionist works against their advantages, while making a pathetic attempt at denying their true nature.

DigitalOcean FTW

In the past, DigitalOcean had a big security issue, and I told people that I don’t recommend using them. They responded to the issue pretty well, but I felt that the issue they had should not have happened in the first place.

Some time has passed since then without any major issues, and they hired an all-star systems administrator. Recently I was working on a project using AWS, and in my search for information, I came across some useful tutorial pages on their site. Because of this, when the time came to switch hosts for my personal site, I started using DigitalOcean and have had a great experience. I can heartily recommend them now.

Of course, they may still have major security issues, but I expect that they’ll have better than average security going forward.

jschain: angular directive and a test (#15)

I built a random-color angular directive with a test on the same page. I started by using plunkr but gave up and used Bower because my connection was unreliable. I learned that angular-mocks is a counterpart to Jasmine in that it exports global variables for convenience. Also, angular-mocks must be loaded after Jasmine. I learned this the hard way.

jschain: converting strings to and from binary (#14)

Encoding to binary:

'hello'.replace(/./g, function(c) {
function pad(n) { return (n > 0) ? ('0' + pad(n - 1)) : ''; }
var s = c.charCodeAt(0).toString(2);
return pad(8 - s.length) + s;
});

Decoding binary to a string:

'011101110110111101110111'.replace(/.{8}/g, function(s) {
return String.fromCharCode(parseInt(s, 2));
});

jschain: meanjs (#11)

I like building up a project from small parts but sometimes it’s good to try using a full framework to see what parts I’m missing. Today I tried starting a mean.js app with yeoman. It comes with a lot preconfigured, including five different authentication options, and since I chose it, an articles model. I removed four of the five authentication modules and changed the name of Article to Bin. In the process I found where things are stored in mean.js. It seems to do a good job of following the rails mantra of Convention Over Configuration.

  • The Code (unfinished, and most of it isn’t mine, the commits show what I did)

I want to return to this experiment and get it working the rest of the way and deployed on Heroku. The basic idea is a minimalistic jsfiddle.

jschain: map with d3 (#10)

I used d3 to make a map. It was good practice. I had forgotten how d3?s chaining API works. When a function mutates an element, it returns the same element back. When a function appends something to an element, it returns the new element back.

I also tried using patterns in svg. I still have to learn some more to understand them and to get the results I want, and I also need to brush up on biezer curves.

Update: I adjusted the vertical offset of the pattern to remove gaps between states.

doge-usa