Dual Numbers and Automatic Differentiation

Dual Numbers and Automatic Differentiation Forward-Mode Automatic Differentiation Dual Numbers and AD Terminology Change! Binary Functions Multiple Variables, Nesting What Return Values are Allowed? Differential Implementation Term List Algebra Addition and Multiplication Differential Type Implementation Accessor Methods Constructors Differential API Differential Parts API Comparison, Control Flow Chain Rule and Lifted Functions Derivatives of Differentials Generic Method Installation Dual Numbers and Automatic Differentiation This literate essay develops an implementation of a type called Differential. A Differential is a generalization of a type called a "dual number", and the glowing, pulsing core of the SICMUtils implementation of forward-mode automatic differentiation. ...

January 11, 2021 · 34 min

How to Publish CLJSJS Jars to Clojars

I’ve been doing a lot of work in Clojurescript lately, and the time finally came to pull in my first vanilla Javascript dependency. The default way to do this seems to be the CLJSJS project. CLJSJS publishes many Javascript packages in a form that you can consume from a Clojure project. For projects like React, you’ll find the latest versions of the JS libraries, packaged up and ready to go. For less active libraries like bignumber.js you might have to go bump a version and open up a pull request against CLJSJS’s packages repository… or maybe package and add the library from scratch, as I did recently with Complex.js. ...

July 28, 2020 · 4 min

Adding Mathjax to your (SBT-)Microsite

I’m obsessed with sbt-microsites. Sbt-microsites is a fantastic plugin for SBT (the Scala Build Tool) that makes it easy to generate a beautiful sidecar site for your software project, full of code checked by your CI! I recently built a microsite for ScalaRL, my in-progress functional Reinforcement Learning library, and found that adding support for Mathjax (a javascript math equation renderer) to the microsite was not obvious. It’s not hard… just not clear from the Mathjax docs how to get past some limitations with sbt-microsites. ...

September 26, 2019 · 5 min

Moving to Spacemacs for Scala and Python

I’ve just finished retooling my development environment, and the process was annoying enough that I thought I’d write it up here, for myself in the future, and for you in the present. tl;dr; I ended up porting my old Emacs config, based on the literate emacs24-starter-kit, over to Spacemacs, and ended up with a great Scala and Python setup. Read on for the details. Goals I’ve been an Emacs user since my first days with Clojure, and I’m hooked, fully in love. Those Clojure days were a long time ago; as I’ve spent more time developing in Scala and Python, I’ve made do with basically just code formatting and syntax highlighting, delegating to an external build tool like SBT in a terminal window to give me compilation feedback every so often. My Emacs config is crusty and old, and way out of date. ...

September 23, 2019 · 5 min

Cascalog + Hadoop Counters, Finally!

I’ve just merged a Cascalog pull request of mine that gives Cascalog operations access to the statistics that Cascading generates at the end of each job. I’ve also added global inc! and inc-by! functions that let you increment custom Hadoop counters from within your functions and operations without having to deal with all that prepfn nastiness we introduced in Cascalog 2.0. Here’s a link to the code. If you want to follow along, or just want to get the hell away from this blog and start playing with the code now, get yourself a copy of the new snapshot: ...

February 21, 2015 · 3 min

Cascalog 2.0 In Depth

Cascalog 2.0 has been out for over a year now, and outside of a post to the mailing list and a talk at Clojure/Conj 2013 (slides here), I’ve never written up the startingly long list of new features brought by that release. So shameful. This post fixes that. 2.0 was a big deal. Anonymous functions make it easy to reuse your existing, non Cascalog code. The interop story with vanilla Clojure is much better, which is huge for testing. Finally, users can access the JobConf, Cascading’s counters and other Cascading guts during operations. ...

January 3, 2015 · 10 min

Hardcore Cascalog: Dynamic Queries

A little side note before I get started - pivoting from my last post on ski mountaineering racing to this post on advanced Cascalog patterns has made me realize that I’m a full-fledged connoisseur of the esoteric. I’m embracing it! This is the first in a series of posts on hardcore Cascalog. If you’re stoked, leave me a comment telling me what you want to learn more about and we’ll go from there. ...

January 1, 2015 · 9 min

API Authentication with Liberator and Friend

I’ve just finished rewriting a number of PaddleGuru’s internal APIs using two great open-source libraries; Liberator and Friend. Liberator is a library for writing RESTful resources in Clojure. Friend is an authorization and authentication library written by the prolific Chas Emerick, Dominator, Esquire. You’ve certainly seen his stuff around if you’ve played with Clojure(Script) in any level of detail. Authentication and authorization are both really important in RESTful APIs. These libraries are made for each other, I thought to myself. I’ll just use them together and life will be wonderful. Right? ...

January 18, 2014 · 14 min

Upcoming Talks in 2013

This is the year I teach myself to become a better public speaker. I’ve spent the past year coding up a number of powerful Scala and Clojure projects, all the while avoiding the important and difficult work of teaching and writing about the import and use of those projects. Well, no longer. To mind that gap I’ll be giving a number of talks in 2013 on my recent work on Summingbird and Cascalog. If you’re in the Bay Area, Boston, or Northern VA (my home town!), I’d love to meet you. ...

August 24, 2013 · 3 min

Cascalog Testing 2.0

A few months ago I announced Midje-Cascalog, my layer of Midje testing macros over the Cascalog MapReduce DSL. These allow you to write tests for your Cascalog jobs in a style that mimics Cascalog’s own query execution syntax. In this post I discuss midje-cascalog’s 0.4.0 release, which brings tighter Midje integration and a number of new ways to write tests. I’ll start with a refresher on the old syntax before debuting the new. If you’re eager, add the following to your project.clj: ...

January 23, 2012 · 6 min