-
The REPL: Issue 39 - October 2017
Floating Point Visually Explained
Sooner or later every software engineer runs into issues with floating point arithmetic precision. Fabien Sanglard explains how floating point numbers are stored and how the approximate real numbers. The post talks specifically about numbers in C, but the lesson is applicable generally.
API design: Choosing between names and identifiers in URLs
Martin Nally covers the ins and outs of using human-readable names or ids in URLs. Both have their place, even in the same systems.
10 new features in Ruby 2.5
Ruby 2.5 is expected to be released this Christmas, like it always does. Here are a few new features that will be included. There are no major changes. The language is relatively mature now and the core teams seems to be focused on performance improvements.
-
Pipe Atom Text Into Any Command
On my day-to-day software engineering tasks, I sometimes have the need to pass the file or selection through another program and replace it with the output. The uncomfortable workflow on my Mac is:
-
The REPL: Issue 38 - September 2017
Developing with Kafka and Rails Applications
In this article, Sam Goldman gives an overview of how Blue Apron uses the
ruby-kafka
gem to produce and consume Kafka topics from Ruby. In addition, he shows how to leverage docker and docker compose to create a local development environment, which would otherwise be relatively complex since it needs 4 different supporting services (zookeper, Kafka broker, a schema registry and a REST proxy).Introduction to Concurrency Models with Ruby
This post (part 1) and it’s follow-up (part 2) explain the different ways to work with concurrency in Ruby. It covers Processes, Threads, the GIL, Fibers and more abstract models like Actors, Sequential Processes, Software Transactional Memory and the new proposal for concurrency in Ruby: Guilds.
Using Atomic Transactions to Power an Idempotent API
@brandur writes a detailed post on how to treat HTTP API requests as transactions and build them in a way that they are idempotent – they can be called multiple times, without affecting the result. The author does a great job of covering the database, MVC framework code and even how to work with background processes. The diagrams illustrate elegantly how race conditions can occur and how to mitigate them.
-
Bug-Driven Development
The Bug
-
Ruby stdlib: Base64
Base64 is a widely-used mechanism to represent binary data in an ASCII string format. There are a few different Base64 schemes that share most of the implementation. The encoding strategy consists of choosing 64 characters that are common to most other string encodings and are also printable. For example, MIME’s Base64 implementation uses
A
-Z
,a
-z
, and0
-9
for the first 62 characters. Other variations share this property but differ in the characters chosen for the last two values and an extra one for padding. Each base64 digit represents exactly 6 bits of data.