Derivation of the Klein-Gordon equation by Ciro Santilli 35 Updated +Created
The Klein-Gordon equation directly uses a more naive relativistic energy guess of squared.
But since this is quantum mechanics, we feel like making into the "momentum operator", just like in the Schrödinger equation.
But we don't really know how to apply the momentum operator twice, because it is a gradient, so the first application goes from a scalar field to the vector field, and the second one...
So we just cheat and try to use the laplace operator instead because there's some squares on it:
But then, we have to avoid taking the square root to reach a first derivative in time, because we don't know how to take the square root of that operator expression.
So the Klein-Gordon equation just takes the approach of using this squared Hamiltonian instead.
Since it is a Hamiltonian, and comparing it to the Schrödinger equation which looks like:
taking the Hamiltonian twice leads to:
We can contrast this with the Dirac equation, which instead attempts to explicitly construct an operator which squared coincides with the relativistic formula: derivation of the Dirac equation.
Emscripten by Ciro Santilli 35 Updated +Created
TypeScript by Ciro Santilli 35 Updated +Created
TypeScript is good. It does find errors in your JavaScript. But it is a form of "turd polishing". But Ciro Santilli would rather have a polished turd than a non-polished one.
Part of the reason TypeScript became popular is due to the universality of asset bundlers. Once you are already using an asset bundler, changing the .js extension into .ts to get a less shitty experience is an easy choice.
The other big reason is that JavaScript is so lose with type conversions, notably undefined happily converting to strings without problems, and any missing properties of Object happily being undefined. We should actually use ES6 Map everywhere instead of using Objects as maps.
Since TypeScript is not the default form of the language however, it inevitably happens that you need to add external types for a gazillion projects that are using raw JavaScript, and sometimes fight a lot to get things to work. And so we have: github.com/DefinitelyTyped/DefinitelyTyped. Not sure if this is beautiful, or frightening.
But in the end, as with other type of static linters, TypeScript generally transforms a few hard to debug runtime issues, into a bunch of stupid to solve compile time issues, which is generally a good thing.
The fact that this it parses comments JSDoc comments in JavaScript files is quite amazing.
Examples under typescript. Run each one of them with:
npx tsc example.ts
node example.js
Helper:
tsr() (
  # ts Run
  f="$1"
  npx tsc "$f"
  node "${f%.*}.js"
)
tsr example.ts
Some major annoyances of TypeScript:
IP address by Ciro Santilli 35 Updated +Created
Intel Research by Ciro Santilli 35 Updated +Created
"Intel Research Lablets", that's a terrible name.
Iterative in-order by Ciro Santilli 35 Updated +Created
This is a bit harder than iterative pre-order: now we have to check if there is a left or right element or not:
  • (START) push current
  • if there is left:
    • move left
  • else:
    • (ELSE) pop
    • visit
    • if there is right
      • move right
      • GOTO START
    • else:
      • GOTO ELSE
The control flow can be slightly simplified if we allow NULLs: www.geeksforgeeks.org/inorder-tree-traversal-without-recursion/
WebGL by Ciro Santilli 35 Updated +Created
HTML snippet:
new class extends OurbigbookCanvasDemo {
  init() {
    super.init('webgl', {context_type: 'webgl'});
    this.ctx.viewport(0, 0, this.ctx.drawingBufferWidth, this.ctx.drawingBufferHeight);
    this.ctx.clearColor(0.0, 0.0, 0.0, 1.0);
    this.vertexShaderSource = `
#version 100
precision highp float;
attribute float position;
void main() {
  gl_Position = vec4(position, 0.0, 0.0, 1.0);
  gl_PointSize = 64.0;
}
`;

    this.fragmentShaderSource = `
#version 100
precision mediump float;
void main() {
  gl_FragColor = vec4(0.18, 0.0, 0.34, 1.0);
}
`;
    this.vertexShader = this.ctx.createShader(this.ctx.VERTEX_SHADER);
    this.ctx.shaderSource(this.vertexShader, this.vertexShaderSource);
    this.ctx.compileShader(this.vertexShader);
    this.fragmentShader = this.ctx.createShader(this.ctx.FRAGMENT_SHADER);
    this.ctx.shaderSource(this.fragmentShader, this.fragmentShaderSource);
    this.ctx.compileShader(this.fragmentShader);
    this.program = this.ctx.createProgram();
    this.ctx.attachShader(this.program, this.vertexShader);
    this.ctx.attachShader(this.program, this.fragmentShader);
    this.ctx.linkProgram(this.program);
    this.ctx.detachShader(this.program, this.vertexShader);
    this.ctx.detachShader(this.program, this.fragmentShader);
    this.ctx.deleteShader(this.vertexShader);
    this.ctx.deleteShader(this.fragmentShader);
    if (!this.ctx.getProgramParameter(this.program, this.ctx.LINK_STATUS)) {
      console.log('error ' + this.ctx.getProgramInfoLog(this.program));
      return;
    }
    this.ctx.enableVertexAttribArray(0);
    var buffer = this.ctx.createBuffer();
    this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER, buffer);
    this.ctx.vertexAttribPointer(0, 1, this.ctx.FLOAT, false, 0, 0);
    this.ctx.useProgram(this.program);
  }
  draw() {
    this.ctx.clear(this.ctx.COLOR_BUFFER_BIT);
    this.ctx.bufferData(this.ctx.ARRAY_BUFFER, new Float32Array([Math.sin(this.time / 60.0)]), this.ctx.STATIC_DRAW);
    this.ctx.drawArrays(this.ctx.POINTS, 0, 1);
  }
}
AIDS by Ciro Santilli 35 Updated +Created
Goldstone's theorem by Ciro Santilli 35 Updated +Created
Abraham by Ciro Santilli 35 Updated +Created
B Reactor by Ciro Santilli 35 Updated +Created
Reactor of the Hanford site of the produced the plutonium used for Trinity and Fat Man.
This was the first full scale nuclear reactor in the world, and was brought up slowly to test it out.
Video 1.
Hanford B Reactor tour by Studio McGraw
. Source. 2016.
gwern.net by Ciro Santilli 35 Updated +Created
One thing that annoys Ciro Santilli about that website are the footnote overload. Ciro likes linear things.
Graphene by Ciro Santilli 35 Updated +Created
A single layer of graphite.
Where 2 Technologies by Ciro Santilli 35 Updated +Created
Google acquisition by Ciro Santilli 35 Updated +Created
Peptidoglycan by Ciro Santilli 35 Updated +Created
From the Wikipedia image we can see clearly the polymer structure formed: it is a mesh with:
Genesis block message by Ciro Santilli 35 Updated +Created
Inscription added by Satoshi Nakamoto on the Genesis block containing:
The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
which is a reference to: www.thetimes.co.uk/article/chancellor-alistair-darling-on-brink-of-second-bailout-for-banks-n9l382mn62h wihch is fully titled:
Chancellor Alistair Darling on brink of second bailout for banks
The "Alistair" was slikely removed due to limited payload concerns.
Through the newspaper reference, the message proves a minimal starting date for the first mine.
And it hints that one of Bitcoin's motivation was the financial crisis of 2007-2008, where banks were given bailouts by the government to not go under, which many people opposed as the crisis was their own fault in the first place. A notable related stab is taken at Len Sassaman tribute.
We can extract the image from the blockchain ourselves by starting from: blockchain.info/block-height/0?format=json.
From that page we manually extract the hash 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f and then:
wget -O 0.hex https://blockchain.info/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f?format=hex
xxd -p -r 0.hex
and that does contain the famous genesis block string:
EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks
The JSON clarifies that the data is encoded in the script field of the transaction input:
{
      {
         "script":"04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73"
The extra E (0x45 in ASCII) in EThe Times is just extra noise required by the script, we can break things up as:
04ffff001d0104 45 5468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73
where:
  • 54 is T
  • the 04ffff001d0104 part just doesn't show up on the terminal because it is not made of any printable characters.
The initial 04 is OP_RETURN.
TODO what is actual the meaning of the ffff001d010445 part? @defango twitter.com/defango/status/1642750851134652417 comments:
04ffff001d0104 is a hexadecimal string. It is commonly used in the Bitcoin network as a part of the mining process. Specifically, it is used as the target value for a block to be considered valid by the Bitcoin network.
This value represents the level of difficulty required for a miner to generate a block that meets the network's criteria. The first four bytes, 04ffff, represent the maximum possible target value. The next three bytes, 001d01, represent the current difficulty level
while the final byte, 04, is a padding byte. In summary, this value sets the difficulty level for mining a new block in the Bitcoin network.
TODO the output of the transaction has a jumbled script, likely just a regular output to get things going, can't be arbitrary like input.
Covariance by Ciro Santilli 35 Updated +Created
Generally means that he form of the equation does not change if we transform .
This is generally what we want from the laws of physics.
E.g. a Galilean transformation generally changes the exact values of coordinates, but not the form of the laws of physics themselves.
Lorentz covariance is the main context under which the word "covariant" appears, because we really don't want the form of the equations to change under Lorentz transforms, and "covariance" is often used as a synonym of "Lorentz covariance".
TODO some sources distinguish "invariant" from "covariant": invariant vs covariant.

Unlisted articles are being shown, click here to show only listed articles.