Blog


Headless Chrome and Puppeteer

A headless statue

I did a small presentation on Headless Chrome this week at work and just wanted to write up a small blog post version of it. In includes an introduction to Headless Chrome and a small tutorial on using the it’s node API

What is Headless Chrome?

Headless chrome is a new(ish) feature of the chrome web browser which allows it to run without a head. This means that no graphical output is shown, and more importantly it is never even generated. This reduces the time normal browser actions take significantly.

Read more...

float.Epsilon ≈ 0 on PS4?

Just wanted to write up a quick post about an issue I ran into the other day at work. Not to be dramatic, but mathematics sort of fell apart.

The Problem

// This is Unity C# code that's targeting PC, PS4, and XB1
float i = 0f;
assert(i == 0f); // True everywhere.
assert(float.Epsilon != 0f); // True everywhere.
assert(i < float.Epsilon); // False on PS4, True elsewhere. This is how I found the problem.
assert(float.Epsilon != i); // False on PS4, True elsewhere.
Debug.Log( float.Epsilon.ToString('r') ); // 0 on PS4, 1.401298E-45 elsewhere.

So it seems that float.Epsilon on the PS4 is not only evaluating to 0, but also fails the transitive equality property since: 0 == i, i == float.Epsilon, but 0 != float.Epsilon.

Read more...