Skip to main content

5 posts tagged with "reference"

View All Tags

· One min read

Just spitballing something I have been thinking about increasingly often.

Many problems arising from humans interacting with computing systems occur because at a digital level it’s impossible to identify if a human or a computer caused an action to occur. Think of spam, banking fraud, or even DDOS sttacks.

Of course, expecting a boolean answer to the question "was this action caused by a human or a computer", doesn’t cover all the intricacies. For example, of a recurring bank transfer, or mailmerge.

What if we could measure how much human attention was consumed for something to be generated?

For example, generating a template for a mail merge would need 10 braincycles, since a human would need to work on it for a while.

But the action of mail merging the template and generating N mails, means that the content of each email is worth only 1 braincycle (or some fraction of the 10 braincycles of the template).

At the very least, this would be a good metric to sort my inbox -- if your email contains only 1 braincycle, it means you didn’t spend that much time (attention/braincycles) to generate it, therefore I shouldn’t spend much time either.

· One min read

A record of every reference a function utilizes.

Here's a small example:


function example(x, y) {
let sum = x + y;
document.getElementById("span-for-result").innerHTML = sum.toString();

The closure is [x, y, document].

· One min read

A continuation reifies a program's control state.

It's a data structure that represents the computational process at a given point in the process's execution.

Continuations are useful for encoding other control mechanisms in programming languages such as exceptions, generators, coroutines, and so on.

The "current continuation" or "continuation of the computation step" is the continuation that, from the perspective of running code, would be derived from the current point in a program's execution. The term continuations can also be used to refer to first-class continuations, which are constructs that give a programming language the ability to save the execution state at any point and return to that point at a later point in the program, possibly multiple times.

· One min read

Every attack on information infrastructure takes the following form:

  • Reconnaissance
  • Weaponization
  • Delivery
  • Exploitation
  • Persistence
  • Actions on Objectives

Lockheed Martin popularized this list as a Cyber Killchain.

The key is that it's a chain, therefore weakening any part of it, weakens the chain. The "defense in depth" directive of any infosec approach is informed by this fact.

· One min read

An operation (function) is idempotent if and only if, multiple applications (executions) of it do not change anything beyond the first application (execution).

Consider, console.log('test'), for example.

It isn't idempotent, because multiple applications of it change the state of the screen beyond the first execution.

However, given the following function, idempotent_log('id_0', 'test') is idempotent:

const logged_keys = [];
function idempotent_log(idempotency_key: string, args: any...) {
if (logged_keys.indexOf(idempotency_key) == -1) {

I always like to think of idempotency in terms of a "lifetime"1. A lifetime is a property of every datum. Specifically, a datum's lifetime begins when it is created and ends when it is destroyed.

In the aforementioned example, idempotent_log('id_0', 'test') is idempotent within the lifetime of logged_keys.

Lastly, please note that the closure of idempotent_log('id_0', 'test') is ['id_0', 'test', logged_keys, console].