de en es fr nl pl pt sv zh

accidentally

`godoc` struct rendering

Accidentally Quadratic

godoc is Go’s tool for extracting doc comments from source code and rendering HTML documentation (loosely parallel Java’s “javadoc”). godoc processes Go struct definitions in two passes. First, it runs over the AST recursively building rendering documentation and declarations into a textual...

vim TAGS lookup

Accidentally Quadratic

A tags file is a classic UNIX format for storing an index of where symbols are defined in a source tree, for ease of finding a symbol definition from within an editor. Both vim and emacs have native support for loading TAGS files and using them to jump to symbol definitions. When performing tags...

Capistrano server definition

Accidentally Quadratic

Capistrano is a server automation and deployment tool written in Ruby. It provides a Ruby DSL for defining deployments and other operations on a set of servers, and executing those flows. A Capistrano environment defines a number of servers, each of which has zero or more “roles”, which help...

Ruby `reject!`

Accidentally Quadratic

The reject! method in Ruby selectively removes elements from an array in-place, based on a provided predicate (in the form of a block). Between Ruby 1.9.3 and Ruby 2.3, reject! was accidentally quadratic. The underlying bug was fairly straightforward. Every time the provided predicate returned...

UIKit Subviews with custom tints

Accidentally Quadratic

A few days ago, Benjamin Encz blogged an excellent writeup of disassembling and reverse engineering UIKit to track down an incident of accidentally quadratic behavior in Apple’s UIKit when adding subviews. I don’t have much to add, but readers of this blog would almost certainly enjoy his post!

Apache Spark

Accidentally Quadratic

Apache Spark is a cluster computing engine, essentially an alternative computation model to MapReduce for executing jobs across large clusters. Spark’s scheduler stores pending work on a number of arrays, to keep track of which work is available to be executed where in the cluster. In Spark 1.6,...

node.js left-pad

Accidentally Quadratic

If you’re a programmer, there’s a good chance you noticed the node.js left-pad fiasco of a few weeks back that temporarily broke most of the npm ecosystem. This blog doesn’t have an opinion on any of that. However, in the ensuing kerfluffle, several people observed that left-pad appears to be...

Linux `/proc/pid/maps`

Accidentally Quadratic

The /proc/ filesystem, if you’re not familiar with it, is a magical place full of all kinds of useful debugging tools for introspecting (and modifying) the state of a Linux machine – especially for inspecting other processes. /proc/<pid>/maps shows, for any process on the system, a list of...

Ruby `parser` gem

Accidentally Quadratic

The ruby parser gem is an implementation of a Ruby parser in Ruby itself, which allows for Ruby code to parse and introspect Ruby code. It’s used in a number of places, but perhaps most prominently by rubocop, a Ruby linter and style checker. In parser versions <= 2.3.0.4, the parser is...

`puppet apply`

Accidentally Quadratic

puppet is a popular configuration-management tool. Puppet’s basic model is declarative: You define a set of “resources” and the state they should be in. A “resource” can be basically anything that might be managed on a server: file on disk, a user account, a provisioned database instance, a...