This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"random": [ | |
{ | |
"_id": "5f308f89582bc3c72e48d1d5", | |
"index": 0, | |
"guid": "5492dc3c-2610-4cae-98b6-103eb0ede71a", | |
"isActive": true, | |
"balance": "$3,390.36", | |
"picture": "http://placehold.it/32x32", | |
"age": 35, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"random": [ | |
{ | |
"_id": "5f308f89582bc3c72e48d1d5", | |
"index": 0, | |
"guid": "5492dc3c-2610-4cae-98b6-103eb0ede71a", | |
"isActive": true, | |
"balance": "$3,390.36", | |
"picture": "http://placehold.it/32x32", | |
"age": 35, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
window.CBOR_DATA = { | |
"random": [ | |
{ | |
"_id": "5f308f89582bc3c72e48d1d5", | |
"index": 0, | |
"guid": "5492dc3c-2610-4cae-98b6-103eb0ede71a", | |
"isActive": true, | |
"balance": "$3,390.36", | |
"picture": "http://placehold.it/32x32", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git include/boost/asio/impl/use_awaitable.hpp include/boost/asio/impl/use_awaitable.hpp | |
index d0da2a35..95d864f9 100644 | |
--- include/boost/asio/impl/use_awaitable.hpp | |
+++ include/boost/asio/impl/use_awaitable.hpp | |
@@ -237,7 +237,7 @@ T dummy_return() | |
} | |
template <> | |
-void dummy_return() | |
+inline void dummy_return() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const console_render = (state) => console.log(state.map(row => row.map(v => '☐◼'[v]).join("")).join("\n")); | |
function game_of_life(w, h, fps, render = console_render) { | |
const state = (w, h) => Array(w).fill(0).map(() => Array(h).fill(0)); | |
const randomize = (state) => state.map(a => a.map(b => Math.round(Math.random()))); | |
const neighbours = (state, x, y) => [ | |
state[x-1]?.[y-1], state[x]?.[y-1], state[x+1]?.[y-1], | |
state[x-1]?.[y ], state[x+1]?.[y ], | |
state[x-1]?.[y+1], state[x]?.[y+1], state[x+1]?.[y+1] | |
].map(v => v ?? 0); | |
const step = (state) => state.map((r, x) => r.map((v, y) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Brainfuck { | |
memory = new Uint8Array(30000); | |
ptr = 0; | |
input = { read() { return 0 } }; | |
output = { write(v) { console.log(String.fromCharCode(v)) } }; | |
run(code) { | |
for (let i = 0, len = code.length; i < len; ++i) { | |
let c = code.charAt(i); | |
switch (c) { | |
// move pointer right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Constants from glibc (GCC), with a period of 2**31 | |
const M = (2 ** 31); | |
const A = 1103515245; | |
const C = 12345; | |
const randomSeed = (max) => Math.floor((crypto.getRandomValues(new Uint8Array(1))[0] / 255) * (max - 1)); | |
/** Linear congruential generator */ | |
class PRNG { | |
constructor(seed = randomSeed(M)) { | |
this.state = seed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ts-check | |
/** @returns {(stdin: () => number, stdout: (c: number) => void) => void} */ | |
function compile(/** @type {string} */ source) { | |
let func = | |
"const memory = new Uint8Array(30000);\n" + | |
"let ptr = 0;\n"; | |
for (let i = 0, len = source.length; i < len; ++i) { | |
let c = source.charAt(i); | |
switch (c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[gchb]: https://gchandbook.org/ | |
[clawing]: https://blog.mozilla.org/javascript/2013/07/18/clawing-our-way-back-to-precision/ | |
[gsgc]: https://piumarta.com/software/gsgc/index.shtml | |
[migc]: https://github.com/playXE/migc | |
[yarpenruntime]: https://github.com/mdlugajczyk/yarpen/blob/master/runtime/yarpen_runtime.c | |
[bdwgc]: https://www.hboehm.info/gc/ | |
[bdwgcslides]: https://www.hboehm.info/gc/04tutorial.pdf | |
[bdwdescr]: https://hboehm.info/gc/gcdescr.html | |
[writinginterpretersinrust]: https://rust-hosted-langs.github.io/book/introduction.html | |
[gcandrustpart0]: http://blog.pnkfx.org/blog/2015/10/27/gc-and-rust-part-0-how-does-gc-work/ |
OlderNewer