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
# Macros | |
ALL = program1 program2 program3 | |
SRCDIR = src/ | |
BINDIR = bin/ | |
EXT = cpp | |
CXX = g++ | |
CXXFLAGS = -std=c++14 -O3 -Wall -Wextra |
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
async function readlines(stream, callback, buffer_len = 16) { | |
const reader = stream.getReader() | |
const td = new TextDecoder('ascii') | |
let overflow = null | |
let buffer = [] | |
function flush_buffer() { | |
for (let b of buffer) { | |
callback(td.decode(b)) | |
} |