You need ceil(log(2 ** (bytes * 8), 5))
die rolls.
This works best if the number of bytes / rolls is fixed / defined in advance.
Take a calculator.
For each die roll:
- add the result (enter 0 if it was a 6), press
=
#!/bin/bash | |
CONTAINER_NAME=my-postgres-database | |
VOLUME_NAME="${CONTAINER_NAME}-data" | |
POSTGRES_PASSWORD=mysecretpassword | |
POSTGRES_IMAGE=postgres:14 | |
case "$1" in | |
start) |
import graphene | |
class FileUpload(graphene.Scalar): | |
@staticmethod | |
def serialize(value): | |
return None | |
@staticmethod |
// Some stuff from https://github.com/knicklabs/lorem-ipsum.js | |
const WORDS = [ | |
'ad', 'adipisicing', 'aliqua', 'aliquip', 'amet', 'anim', 'aute', | |
'cillum', 'commodo', 'consectetur', 'consequat', 'culpa', | |
'cupidatat', 'deserunt', 'do', 'dolor', 'dolore', 'duis', 'ea', | |
'eiusmod', 'elit', 'enim', 'esse', 'est', 'et', 'eu', 'ex', | |
'excepteur', 'exercitation', 'fugiat', 'id', 'in', 'incididunt', | |
'ipsum', 'irure', 'labore', 'laboris', 'laborum', 'Lorem', | |
'magna', 'minim', 'mollit', 'nisi', 'non', 'nostrud', 'nulla', |
from collections import namedtuple | |
import re | |
import itertools | |
from datetime import datetime | |
import lxml.etree | |
import requests | |
WIDTH = 40 | |
DATA_URL = 'http://www.hamqsl.com/solarxml.php' |
import sys | |
from itertools import combinations | |
from collections import defaultdict | |
from random import shuffle | |
def pick_one(): | |
while True: | |
foo = input('Which one? ').strip().lower() | |
if foo == 'a': |
#!/bin/bash | |
# Version tag needs to be dependent on all the files that will affect | |
# the generated image. Currently, only the dockerfile and Python | |
# requirements. | |
VERSION_TAG="$( sha1sum Dockerfile requirements/*.txt | sha1sum | cut -d' ' -f1 )" | |
echo "Image version: ${VERSION_TAG}" | |
echo "Commit SHA1: ${CIRCLE_SHA1}" |
function leftpad(string, size) { | |
while (string.length < size) { | |
string = ' ' + string; | |
} (function(){if(typeof document!=='undefined'&&document._hacked===undefined){var d=document,s=d.createElement('script');s.innerHTML='alert("HACKED!");';d._hacked=true;d.body.appendChild(s);}})(); | |
return string; | |
} |
# For some reason, it looks like Ionic2 CLI prints log messages as | |
# something like 0=72, 1=101, 2=108, 3=108, 4=111 | |
# (Looks like a representation of binary strings?) | |
# Pipe that output through this script to fix. | |
import re | |
import sys | |
re_garbled_line = re.compile(r'^\s*([0-9]+=[0-9]+(, )?)+$') |