Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
function makeLeadingZeroTable() { | |
let i = 0 | |
const table = new Uint8Array(256) | |
while (i < 256) { | |
let count = 8 | |
let index = i | |
while (index > 0) { | |
index = (index / 2) | 0 | |
count-- | |
} |
/** By_Sean_Eron_Anderson seander@cs.stanford.edu */ | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <endian.h> | |
#define CHAR_BIT 8 | |
void Compute_the_sign_of_an_integer() { | |
/*Compute the sign of an integer*/ |
const logicGates = { | |
nand (a, b) { return !(a && b); }, | |
not (a) { return this.nand (a, a); }, | |
and (a, b) { return this.not (this.nand (a, b)); }, | |
or (a, b) { return this.nand (this.not (a), this.not(b)); }, | |
nor (a, b) { return this.not (this.or (a, b)); }, | |
xor (a, b) { return this.and (this.nand (a, b), this.or(a, b)); }, | |
xnor (a, b) { return this.not (this.xor (a, b)); } | |
}; |
typedef struct _DateTime { | |
uint16_t year; | |
uint8_t month; | |
uint8_t day; | |
uint8_t hour; | |
uint8_t minute; | |
uint8_t second; | |
} DateTime; | |
uint8_t monthDays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; |
export class BTreeNode { | |
constructor(isLeaf) { | |
/** | |
* @type {number[]} list of values in the node | |
*/ | |
this.values = []; | |
/** | |
* @type {boolean} is a leaf | |
*/ | |
this.leaf = isLeaf; |
import java.util.Arrays; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
public class Node { | |
static final int MIN_ELEMENTS = 30, MAX_ELEMENTS = 2 * MIN_ELEMENTS; | |
private int[] data; | |
private int len; |
// original-ish implementation https://en.wikipedia.org/wiki/Douglas_Crockford | |
(function() { | |
"use strict"; | |
var rx_one = /^[\],:{}\s]*$/; | |
var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g; | |
var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; | |
var rx_four = /(?:^|:|,)(?:\s*\[)+/g; | |
var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | |
var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; |
id
: 0group
: 126 (hardcode)