Never miss a beat

Join my newsletter.

Tag: clojure

What you need to know about the Gilded Rose interview problem

Published: 1/16/2019

A few years ago, I interviewed for a Dev Ops position at a pretty prominent CI shop in San Francisco. Part of the interview process involved a take-home code-assignment (of course). This particular assignment is known as the Gilded Rose. The Gilded Rose isn’t a fizzbuzz. It’s not “Implement a Trie” in whatever language you want. The Gilded Rose is a problem that involves adding some functionality into the worst code that a developer could ever write. I don’t mean any offense to whoever created…

Something NLP-ish in Clojure

Published: 7/17/2018

I started writing this article almost 2 years ago. While some things have changed (interests, time, priorities), I thought about this the other day and thought it was too neat to just let die. I came back into this article today and tried to fill out a few of the lesser detailed areas and decided to just hit publish to ensure the code, thoughts, and process was shared with you all. Sorry that it’s not of my usual quality. Hey all! I haven’t written anything in awhile and wanted to jump back in…

Adding Trigram Searching to a Clojure Webapp with YeSQL, Migratus, and Postgres

Published: 10/29/2017

A Trigram is a three character subsection of a string of text. This allows you to match text if you're close to the actual text you're looking for. For example, the string foobar can be represented as the following trigrams: foo, oob, oba, bar. Click here to learn how to use Trigrams to elevate your search capabilities!

Using Futures in Clojure

Published: 10/29/2017

It’s late at night so I’ll keep this post short. I’m going to quickly cover how to use Futures in Clojure and why you would want to use them. Let’s start with the why. What is a Future? A future is simply a function that executes code on a background thread and can be dereferenced to get the result of that code. Here’s what they look like! This code will start a new thread, print “foo” and then do the heavy-lifting of calculating 1+1. Keep in mind the result of a future has to be dereferenced…

5 Programming Languages You Should Really Try

Published: 6/28/2017

For some strange reason, the vast majority of my blog readers are Python Developers. I wrote two articles on Python a long time ago and honestly try to avoid python when I can. So here’s an article for you purveyors of Python — you sultans of snakes. Note: This article is still likely relevant even if you’re not a Pythonista . For those who aren’t aware, Linguistics and Grammars are particularly interesting to me. I really, really enjoy looking into new languages and comparing them to what I…

Clojure + Kibit & Eastwood

Published: 6/28/2017

I’ve been writing Clojure for a while now, but my day job is still predominantly JavaScript and Java. There are two tools that I use every single time I write JavaScript and Java code. Respectively, a linter and a static code analyzer. Recently, I set out to search for similar tools in the Clojure domain. Enter Eastwood Named after a fantastic actor, Eastwood is a linter for Clojure code. Also like the many roles the actor plays, Eastwood is pretty aggressive in the checks that it runs against…

KNN: My Nearest Neighbors

Published: 6/3/2017

Thanks for tuning in for another fantastic awesome hardcore slippery blog post! In this post, we’re going to cover KNN and it’s implementation in Clojure! What is KNN? KNN (K-Nearest Neighbors) is simply an algorithm, but you probably knew that at this point. For many, KNN is a terrifying first step into a domain that they’re often not too familiar with — machine learning. That being said, KNN gets looped into several much more complex things by categorizing it like so. Specifically…

An Informal & Practical Guide to Clojure.Spec

Published: 5/14/2017

Hello again! No witty intro this time, I’ve just been working with Clojure 1.9-alpha recently, and have decided to write about Clojure spec and some of the features it offers. Let’s get to it! Note: There’s a lot to Clojure Spec. I’m going to cover what I consider to be the practical aspects, or the aspects that I commonly use. My goal is to make this light and comprehensible. What is Spec? Clojure’s spec is a core part of the Clojure library as of Clojure 1.9. It allows you to declaratively…

Provisioning a Development Environment for Clojure Web Services via Ansible and Vagrant

Published: 4/12/2017

Welcome back! DevOps has always been an area of interest for me, however I’ve not really had much of a reason to get into it. At CARFAX and LinkedIn, there were teams dedicated to the DevOps side of things. However, I’m picking up steam with a couple of projects that have me at the helm, and I’m seeing a more and more prevalent need for DevOps in these projects. What problems does DevOps solve? Lots of them! Copious amounts of problems, in fact. Here are a few examples: Ensuring Developers can…

Threading Pipelines in Clojure

Published: 12/24/2016

Today we’re going to talk about the thread macro ( -> ) and how to manipulate functions to fit them into your “thread pipeline”. First, let’s figure out what exactly the thread macro is. The Thread Macro If you’ve used -> before, you’ve done some threading. Other languages refer to this as “piping”, although this can be often confused with piping from the command-line. Check out this code (that doesn’t use the threading macro). Now this isn’t complicated, per se, but it could be a bit easier…

Using NLP to Categorize Customer Feedback in Clojure

Published: 12/23/2016

First – an apology. It’s been a long while since I’ve written and I kind-of dropped my last series on it’s head and left it to rest. If you were particularly interested in the Zero-To-Hero for Android Development, let me know. I’ll pick it back up. The reason I stopped writing it was because the community sentiment was straight-forward — they wanted more Clojure! Then, I became a bit confused with my next steps as a developer and got mixed up in Rust. Turns out, that’s not for me and I’m in a…

Mighty Morphing Multimethods

Published: 8/2/2016

Type systems are a tricky thing. A lot of languages have very flexible type systems, such as F# with its inferred (and extremely well inferred at that) type system, or JavaScript with it’s untyped nature. Clojure hits a happy middle ground (for me, at least) – It’s dynamically typed (or “gradually typed”, if that’s your cup of tea). Why is the typing important? Polymorphism. Most of you probably learned polymorphism from your introduction to object-oriented programming course/book which was…

Understanding Clojure's Map & PMap

Published: 7/18/2016

Let’s be honest – Part of the reason you’re using Clojure is the higher order functions like map . They’re great, composable, and describe what you’re trying to do instead of defining what to do – this keeps code simple. Maybe you’ve been playing with map for a while now and have even tried using pmap . If you did, you probably noticed that pmap is often slower than map , and if you want to know why – read on. What is map ? Before we get into pmap lets go ahead and clarify our…

Why I Switched from Python to Clojure

Published: 7/18/2016

First – a bit of background. When I first started learning programming, I started with a course in high school that focused on Java. From there, I decided I wanted to work for a start-up and I had to learn python (I was naive). I started playing with Python and it just felt right – at first. I spent some more time with it and started to realize that I needed something more. Here’s a brief list of the reasons why I switched. Interpreted Language Python is a dynamic language . There’s a massive…

Introduction to Asynchronous Programming in Clojure

Published: 7/15/2016

I’ve been writing about my favorite language, Clojure, for a while now. I’ve also been gauging your interest in Clojure and, if you’re reading this, I think you’re ready to take this relationship to the next level. Let’s talk about asynchronous code in Clojure. Getting Started If you want to follow along with the code examples, start a new project. I’m going to be using Leinengen and we’re going to name this app “warehouse”. Let’s open warehouse/src/warehouse/core.clj and modify it so it looks…

Using JSON Web Tokens with Clojure

Published: 6/23/2016

Authentication is easy. Good authentication is difficult. We’re at a point in the world where our users expect to be able to sign up for your service or app, and receive a more personalized experience. If you can’t validate who the user is, you can’t achieve this. In the past, people have leveraged sessions, cookies, sending the user’s email and password on each request ( please don’t ever do this ), and many other techniques to validate that a user is who they say they are. A lot of these…

Understanding Clojure Macros

Published: 6/14/2016

Learning Clojure has been one of the most thought-provoking experiences of my life. Coming from a predominantly OOP background, it’s safe to say that it’s always been a bit of a challenge. Macro’s specifically, were a challenge that was hard for me to grasp, and I know cause a lot of pain points to new Clojuristas. To first understand a Macro, we must understand what a function does. What is a function? For the sake of this example – A function is a named procedure that tells a computer to do…