start new:
tmux
start new with session name:
tmux new -s myname
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
| #!/usr/bin/env python | |
| import os | |
| import requests | |
| import subprocess | |
| import sys | |
| from pprint import pprint as pp | |
| TOKEN = 'YOUR_TOKEN' |
Both command sourcing (CS) and event sourcing (ES) rely on determinism for correctness.
The correctness condition for ES is the determinism (purity) of the function State -> Event -> State. Given that this function is deterministic, aka it always maps the same inputs to the same ouputs, we can rely on it to reconstitute state at any point in time. Determinism is typically achieved by ensuring that the Event has all required information to make the state transition, ie no side effects. The Event then is a sort of "closure" of all pertinent information about the event.
The correctness condition for CS is the determinism of the function State -> Command -> Event. Herein lies one of the distinctions between command sourcing and event sourcing - a program can control its output, but it not its input. Since one can't control the input, aka command, one can't in general, enrich it with all required information to make the above function deterministic. A consequence of this is that you can't simply replay a
| #!/bin/bash | |
| #small encoding fixer by benedikt wolters<benedikt.wolters@rwth-aachen.de> | |
| #either write iconv output conversion to dev null or pipe it to conversion | |
| #Debug mode? | |
| #set -x | |
| echo Will fix encoding for text files... this may take a while depending on mess level | |
| BAD_FILES=$(find . \ | |
| -type f \ | |
| -print| \ |
| let map = new Map(); | |
| map.set("a", 1); | |
| map.set("b", 2); | |
| map.set("c", 3); | |
| let obj = Array.from(map).reduce((obj, [key, value]) => ( | |
| Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't. | |
| ), {}); | |
| console.log(obj); // => { a: 1, b: 2, c: 3 } |
| import argparse | |
| import cv2 | |
| import dlib | |
| import json | |
| import numpy | |
| import skimage | |
| from pathlib import Path | |
| from tqdm import tqdm | |
| from umeyama import umeyama |
| <template> | |
| <div> | |
| <textarea :id="id">{{ content }}</textarea> | |
| </div> | |
| </template> | |
| <script> | |
| import tinymce from 'tinymce/tinymce' | |
| import 'tinymce/themes/modern/theme' |
With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.
For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.
In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone: