Improve your code with *one easy trick!*

When you’re writing OpenCV code in C++, you’ll eventually want to pass whatever Mat objects you have into a function or a class method. For the purposes of this post, let’s say we want to write a utility function that prepares a BGR888 Mat for edge detection. This typically involves converting the image to grayscale, as well as blurring it to remove superficial details.

Why not?

Lately, I’ve helped contribute to Slide for Reddit, an open-source Reddit client for iOS written in Swift. We’re reconsidering some aspects of our UI customization options, and I’m of the opinion that the user just doesn’t have the tools they need to make the app as ugly as humanly possible. As a joke, I wanted to randomize all the colors throughout the app just to see what it would look like. That led to an interesting question: is it possible to write an extension for UIColor that forces all instances to be randomized when they are used?


At the end of my Intro to GIS course in grad school, I ran into a problem. The professor assigned us a term project where we were to choose a spatial data set and perform some kind of analysis upon it. Unfortunately for me, this assumed we were all in fields that were already working with spatial data; economists, sociologists, marine biologists, and so on. As a humble code monkey, I had no topical data to work with.