Round a direction vector to an 8-way compass

lemire.me
round-a-direction-vector-to-an-8-way-compass

Modern game controllers can point in a wide range of directions. Game designers sometimes want to convert the joystick direction to get 8-directional movement. A typical solution offered is to compute the angle, round it up and then compute back the … Read more

Negative Incentives in Academic Research

lemire.me
negative-incentives-in-academic-research

In the first half of the XXth century, there were relatively few scientists, and these scientists were generally not lavishly funded. Yet it has been convincingly argued that these scientists were massively more productive. We have entered a ‘dark age’ … Read more

Go generics are not bad

lemire.me
go-generics-are-not-bad

When programming, we often need to write ‘generic’ functions where the exact data type is not important. For example, you might want to write a simple function that sums up numbers. Go lacked this notion until recently, but it was … Read more

Parsing JSON faster with Intel AVX-512

lemire.me
parsing-json-faster-with-intel-avx-512

Many recent Intel processors benefit from a new family of instructions called AVX-512. These instructions operate over wide registers (up to 512 bits) and follow the Single instruction, multiple data (SIMD) paradigm. These new AVX-512 instructions allow you to break some … Read more

Enforcement by Software

lemire.me
enforcement-by-software

At my university, one of our internal software systems allows a professor to submit a revision to a course. The professor might change the content or the objectives of the course. In a university, professors have extensive freedom regarding course … Read more