When & How to Solve Problems with Genetic Algorithms

Genetic algorithms are a class of algorithms designed to explore a large search space and find optimal solutions by mimicking evolution and natural selection. Potential solutions are randomly found, evaluated, and bred with one another in hopes of producing better solutions.
Read more on When & How to Solve Problems with Genetic Algorithms…

Making Unexpected Friends at Work by Prepping for External Events

When I joined Atomic many years ago, it was a small group of tight-knit developers. With fewer than 10 developers working in an open office environment, it was easy to build and maintain a sense of camaraderie. Now that the number of Atoms is around 60, it’s not so easy to get to know one another. We’ve done many experiments to help build and foster the family feeling here at AO, but we’re always looking to improve. Read more on Making Unexpected Friends at Work by Prepping for External Events…

Active Record Aggregate Fields via Sub-Selecting Scopes

I was recently working on a piece of code from a legacy Rails application. An unusually large number of queries being run on a particular page let me know there was an N+1 query lurking.

The application was an online assessment platform dealing with assessments, questions, and responses. The question listing page was simply asking each question if it’s locked—which happens if it has any responses. So what’s the best way to query for lots of questions and their locked status? Read more on Active Record Aggregate Fields via Sub-Selecting Scopes…

Building Better Board Games with Clojure and Gorilla REPL

A while back, my six-year-old daughter and I were on one of our regular daddy-daughter date nights when we decided to create a board game. We sat at a restaurant table with paper, crayons, and a small collection of Dungeons and Dragons trinkets. To my surprise, we built a fun little game that my daughter named Turtle Burglars.
Read more on Building Better Board Games with Clojure and Gorilla REPL…

Ember.js Components with DOM Dependencies

Ember.js is a great framework for building single-page applications. Its mantra of “data down, actions up” sets a clear guideline on how to structure most of your application.

Your route gets some data and tees it up for your controller/component to render it. When something changes the UI (say entering text), you fire an action with the updated values and use it to update your data. This approach also helps with rendering speed under the hood. Your view is totally driven by your model. Perfect. Unless…
Read more on Ember.js Components with DOM Dependencies…

Testing Data Migrations in Rails

When working on a Rails project, you will inevitably need to move data around in your database. Some join table value will need to be moved into its own table or what have you. When approaching these kinds of migrations, there are two major complications: future-proofing and testing. In this post, let’s walk through an example migration.
Read more on Testing Data Migrations in Rails…

Embedding Ember in Existing Apps

My current project, an online student assessment tool, involves adding features to a Rails app built in the 2011/2012 Rails 3 era. The app was also built using Backbone.js, a custom templating language, and raw JSON responses. It was developed using good development and design practices (such as TDD, SRP, etc.), but many of these technologies have been superseded by modern frameworks such as Ember.js or Angular. Active development on this project was not going to be easy or fun.
Read more on Embedding Ember in Existing Apps…