Using Git Log to Show Last Month’s Commits

Every month, I have to produce a short bulleted list of tasks I worked on from the previous month. Usually I end up straining my memory trying to remember everything I did. The last time I had to make this list I realized that our git repository contained all this information. I had to find a good way to extract it. git log is the right tool when you need to explore commit history. Showing My...
read more

Letting Go

I love deleting code. It’s one of my favorite maintenance tasks. Every unnecessary line of code in an application weighs on my mind like an unpaid bill. I feel a sense of glee when I get a chance to delete a feature we don’t need anymore. Every line, function, class, and feature has a cost. It costs additional time to maintain. It’s more lines to read through and debug....
read more

Iterating over consecutive items with Underscore.js

Ruby Enumerable’s each_cons Ruby’s Enumerable module has a useful method called each_cons. It’s useful when you need to perform an operation over N consecutive items. Here’s an example: a = [1,2,3,4,5,6] a.each_cons(3) { |l| puts l.inspect } # output [1, 2, 3] [2, 3, 4] [3, 4, 5] [4, 5, 6] It’s like a moving window, N items wide, that returns each...
read more

Jason Gilman Speaking at DC Ruby Users Group February 13th

Jason will be speaking at the DC Ruby Users Group next Wednesday, February 13. Register now to save your spot. Jason will be talking about debugging with visualizations and showing off some awesome examples from his work with NASA. We all build complicated applications that do amazing things. They juggle state for thousands of objects, perform complicated algorithms across multiple threads, and...
read more

Follow Up to Determining if a Spherical Polygon Contains a Pole

A follow up to Determining if a Spherical Polygon Contains a Pole A reader wondered if my algorithm could handle a polygon with a point directly on the pole. This was something that I had overlooked in my original implementation. The algorithm, as described, did not handle a point on the pole. It also could not handle a polygon with an arc that crossed over a pole. This is an image of the polygon...
read more

Determining if a Spherical Polygon Contains a Pole

I’ve been working on a library for NASA that validates polygons describing areas on the Earth. The polygons are metadata for Earth Science data, such as images from an orbiting satellite. A polygon is represented by a list of points in counter clockwise order defining an outer boundary. The polygon can also have holes which are represented by additional lists of points. One component of...
read more