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
FROM ubuntu:latest | |
RUN apt update | |
RUN apt-get upgrade -y | |
RUN apt-get install -y autoconf build-essential git libjemalloc-dev mono-complete liblz4-dev cmake libssl-dev ninja-build zlib1g-dev | |
RUN git clone https://github.com/apple/foundationdb | |
# Yes, I've tried `7.3` too, including the `-clean` one. | |
RUN (cd foundationdb; git switch release-7.2) |
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
FROM ubuntu:latest | |
RUN apt update | |
RUN apt upgrade -y | |
RUN apt install -y autoconf build-essential ccache curl file g++ gcc gettext git golang libffi-dev locales maven ninja-build npm patchelf pkg-config python3 python3-dev python3-venv rsync | |
# Somehow, the repo contains files with names longer than 255 characters. | |
# I bypassed this locally with a virtual filesystem. | |
# The build problem is the same though, so I assume it's OK to just ignore those files for this Dockerfile-based test. | |
RUN git clone https://github.com/yugabyte/yugabyte-db && echo OK || echo "Long file names, but sigh, proceeding." |
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
/* | |
* Copyright (C) 2016-2023 Davidson Francis <davidsondfgl@gmail.com> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 memoizer(fn) { | |
if (typeof fn !== 'function') { | |
console.error('Need a function.'); | |
return () => {}; | |
} else { | |
return (() => { | |
const cache = {}; | |
eval(` | |
function memoized(...args) { | |
const impl = ${fn.toString().replace('{', `{ const ${fn.name} = memoized; `)} |
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
// To run: `g++ -O3 calc.cc && ./a.out`. | |
// Example values to run on are commented out in lines 8..10. | |
#include <cmath> | |
#include <iostream> | |
#include <iomanip> | |
long double const range = std::pow(2.0, 64); // std::pow(1.0, 32); // 1e6; | |
long double const desired_p_of_collision = 0.01; // 1e-5; 1e-2; // 0.5; | |
long double const desired_log_p = logl(1.0 - desired_p_of_collision); |
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
let function_bodies = {}; | |
let plans = {}; | |
const opa_builtins = { | |
plus: (args) => { return { t: 'number', v: args[0].v + args[1].v }; }, | |
minus: (args) => { return { t: 'number', v: args[0].v - args[1].v }; }, | |
mul: (args) => { return { t: 'number', v: args[0].v * args[1].v }; }, | |
numbers: { | |
range: (args) => { | |
let v = []; | |
for (let i = args[0].v; i <= args[1].v; ++i) { |
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
{ | |
"static": { | |
"strings": [ | |
{ | |
"value": "result" | |
}, | |
{ | |
"value": "a" | |
}, | |
{ |
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
al = 0 | |
si = 0x500 | |
ram[si] = al | |
++si; | |
++al; | |
ram[si] = al | |
cx = ram[0] | |
cx -= 2; | |
while (cx) { | |
al = ram[si - 1] |
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
N = 8; | |
ram = []; | |
for (let i = 0; i < N; ++i) { | |
ram[0x500 + i] = 0; | |
} | |
ram[0] = N; | |
al = 0 | |
si = 0x500 | |
ram[si] = al |
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
digraph test_setup { | |
rankdir = LR; | |
node [ shape = cylinder; label = "DB" ]; | |
db_indexer; | |
db_forwarder; | |
node [ shape = box3d ]; | |
{ rank = same; indexer; db_indexer; } | |
{ rank = same; forwarder; db_forwarder; } | |
generator [ label = "Generator"; ]; | |
indexer [ label = "Indexer"; ]; |
NewerOlder