Categorically Fun

How would you answer if someone asked, "In essence, what is a function?" We're talking programming here. How does something like, "a compound operation that can be given a name" fit the bill? Maybe something about parameters or output or side effects or maybe how it's a subprogram, or even just a dictionary. It has always been a bit unsettling for me not to have some grounding definition of what a function is in it's essence.

Ris-k

I have been playing a lot of Risk with my family recently and got to wondering what the chances of success are per battle. The internet says the following: What might it look like to generate these results on our own using simulated dice throws and battles? Because this is one of those toy problems that is quite math-y, let's use k, or kona to be precise. It will allow us to be terse almost to the point of having executable formulae that define our problem.

How To Run A Bar

how market makers work incomplete / draft Imagine a man in a bar. He looks up to order a beer and notices something strange. Written next to the Miller Lite he wants to order there are two prices; $3.00 and $3.10. He asks the bartender if there some kind of special, or perhaps a mistake on the menu. "No mistake" the bartender answers, "If you want a Miller Lite it costs $3.

Surfing With Clojure

I was honored to present at Clojure/north 2020. Due to Covid 19, it ended up being a virtual conference, but was a blast nonetheless as the organizers did a fantastic job pulling it all together. The talk was centered around an application that I have been working on in my spare time which I call DeepSwell that allows me to better visualize the surf forecast for my local area. The basic idea is to continually monitor and record the forecasts provided by NOAA as well as video snippets from the surf cams for those times.

Lazy

Most sequence functions in Clojure, such as map, range, filter and others, return lazy sequences. This can be used to write methods that take advantage of lazy sequences where you would normally reach for loops. The benefits typically associated with lazy sequences are Only calculating what you need when you need it (if ever) Being able to represent infinite sequences that would not fit in memory After working with them a bit I'd add

( DFS )

Useful for finding cycles and is often used as step in the process for things like topological sorts (as demonstrated below) and finding strongly connected components. DFS is generally run to learn about a graph's structure and, unlike BFS which is ordinarily seeded with a single root vertex, DFS will iterate over all vertices. The discovered and finished times have a parenthesis structure where the intervals \([d[u], f[u]] \:and\: [d[v], f[v]]\) are either entirely disjoint, or one is entirely contained within the other.

( BFS )

Given a graph G = (V, E) and a distinguished vertex s, BFS explores the edges of G to discover every vertex that is reachable from s. It computes the distance (smallest number of edges) from s to each reachable vertex. It produces an breadth-first tree with root s that contains all reachable vertices. For any vertex v reachable from s, the path in the breadth-first tree from v to s corresponds to a shortest path from v to s in G.