# Sapiens and Collective Fictions

Recently I read Sapiens: A Brief History of Humankind by Yuval Harari. The basic thesis of the book is that humans require ‘collective fictions’ so that we can collaborate in larger numbers than the 150 or so our brains are big enough to cope with by default. Collective fictions are things that don’t describe solid objects in the real world we can see and touch. Things like religions, nationalism, liberal democracy, or Popperian falsifiability in science. Things that don’t exist, but when we act like they do, we easily forget that they don’t.

## Collective Fictions in IT – Waterfall

This got me thinking about some of the things that bother me today about the world of software engineering. When I started in software 20 years ago, God was waterfall. I joined a consultancy (ca. 400 people) that wrote very long specs which were honed to within an…

View original post 1,627 more words

# Arithmetic Gas

Prime numbers can be considered as the building blocks of natural numbers. For example, 12 can be factored in a unique way as \$latex 2^{2} cdot 3\$ where 2 and 3 are primes. Thus, prime numbers can be compared to elementary particles, which are the building blocks of matter in physics. The concept of arithmetic gas provides an interesting connection between statistical physics and number theory, for which the Riemann zeta function plays the role of a partition function.

View original post 957 more words

# Seam Carving: Using Dynamic Programming to implement Context-Aware Image Resizing in Python

The following problem appeared as an assignment in the Algorithm Course (COS 226) at Princeton University taught by Prof. Sedgewick.  The following description of the problem is taken from the assignment itself.

The Seam Carving Problem

• Seam-carving is a content-aware image resizing technique where the image is reduced in size by one pixel of height (or width) at a time.
• vertical seam in an image is a pathof pixels connected from the top to the bottom with one pixel in each row.
• horizontal seam is a path of pixels connected from the left to the right with one pixel in each column.
• Unlike standard content-agnostic resizing…

View original post 774 more words

# Calculating the Distance Between Points in “Wrap Around” (Toroidal) Space

Let’s say you are trying to find the distance between two points in 2D, but that these points are in a universe that “wraps around” like old video games – leaving the screen on the right, left, top or bottom side makes you re-appear on the opposite edge.

This universe is actually shaped like a toroid, also known as a doughnut. If you imagine yourself being on the inside surface of a hollow doughnut, it would behave exactly this way. If you go “down” you end up where you previously considered “up”. If you go far enough “left” you end up where you previously considered “right”.

How would you calculate the distance between two points in a universe like this?

Let’s imagine the situation below where we are trying to find the distance between the red point and the green point:

One way to do this would be to pick…

View original post 666 more words