- La charge de la preuve incombe à celui qui avance une hypothèse.
- Une affirmation extraordinaire requiert des preuves extraordinaires.
- Une déclaration sans preuve peut-être rejetée sans preuve.
- Il faut d'abord mettre en évidence un phénomène avant d'en rechercher les causes.
- Rasoir d'Ockham ou principe d'économie : l'hypothèse la plus simple doit être préférée car elle est la plus probable.
- En science on est révolutionnaire que si la nature nous force à l'être. (https://youtu.be/rAvj7VEBDN0?t=4240)
- Un énoncé est tenu comme vrai s'il n'a pas pu être réfuté.
- Sont exclus les énoncés irréfutables (critère de Popper).
- « La science est un jeu dont la règle du jeu consiste à trouver quelle est la règle du jeu. » François Cavanna
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 UNINITIALIZED = {} | |
export function createSelector() { | |
const nInputSelectors = arguments.length - 1 | |
if (nInputSelectors <= 0) { | |
throw new Error('invalid number of inputs') | |
} | |
const transform = arguments[nInputSelectors] |
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 groupBy(iterable, prop) { | |
const dict = { __proto__: null }; | |
for (const item of iterable) { | |
const group = item[prop]; | |
(dict[group] || (dict[group] = [])).push(item); | |
} | |
return dict; | |
} | |
export function multiGroupBy(iterable, props) { |
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
"use strict"; | |
exports.deprecate = function deprecate(fn, message) { | |
let warned = false; | |
return function deprecated() { | |
if (!warned) { | |
warned = true; | |
console.warn(new Error(message)); | |
} | |
return fn.apply(this, arguments); |
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
#!/bin/sh | |
set -eu | |
if [ $# -eq 0 ] || [ "$1" = -h ] || [ "$1" = --help ] | |
then | |
cat <<EOF | |
Usage: $0 file prefix | |
Add a prefix to a file. |
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 ensureArray = (value) => | |
Array.isArray(value) ? value : value === undefined ? [] : [value]; | |
exports.MultiKeyMap = class MultiKeyMap { | |
#data = new Map(); | |
#objects = new WeakMap(); | |
get size() { | |
return this.#data.size; | |
} |
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
export class MultiMap { | |
#entries = new Map() | |
#size = 0 | |
get size() { | |
return this.#size | |
} | |
clear() { | |
this.#entries.clear() |
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
// based on implementation in https://github.com/ForbesLindesay/throat | |
export class Queue { | |
#head // stack to push to, reverse order | |
#tail = [] // stack to pop from | |
get size() { | |
return this.#head.length + this.#tail.length | |
} | |
constructor(iterable) { |
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
#!/bin/sh | |
case "${1:-}" in | |
vm) | |
uuid=$(cat /sys/devices/virtual/dmi/id/product_uuid) | |
echo "/vm/$uuid" | |
;; | |
*) | |
echo 'xenstore-read error: ENOENT' >&2 | |
exit 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
#!/usr/bin/env node | |
const [, , host, port = 443, ca] = process.argv; | |
require("tls") | |
.connect( | |
{ host, port, rejectUnauthorized: false, servername: host }, | |
function() { | |
console.log(this.getPeerCertificate()); | |
this.destroy(); |
NewerOlder