An Anki note type with 5 audios and 5 transcriptions for a single word/phrase, from which one is selected randomly whenever the card is shown. The card has only a front side with the audio, and a collapsible section with the audio's transcription and more info (e.g., definitions, image, etc).
| /** | |
| * Heap implementation. | |
| * | |
| * Adapted from a Python implementation in the "Beyond Cracking the Coding Interview" book. | |
| */ | |
| type PriorityCompFunc <T> = (a: T, b: T) => boolean; | |
| class Heap <T> { | |
| readonly heap: T[]; |
| // Trie.js - simple Trie implementation | |
| // Based off Wengrow's A Common-Sense Guide to Data Structures and Algorithms in Python (Chapter 17). | |
| class TrieNode { | |
| constructor() { | |
| this.children = {}; | |
| } | |
| } | |
| class Trie { |
As general concept, iteration can be defined as the process of doing some repeated action over something in order to generate a sequence of outcomes. At a more detailed and programmatic level, iteration is the process of visiting all the elements of an iterable object using another object known as an iterator.
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <sys/wait.h> | |
| /* | |
| * C program that implements the pipeline | |
| * | |
| * ls -l /tmp/ | wc -l | |
| * |
Original document: http://www.wall.org/~larry/natural.html Author: Larry Wall
Editor's Note: No changes to this document, aside for converting it to Markdown.
Working with binary data is kind of like solving a puzzle. You’re given clues by reading a specification of what the data means and then you have to go out and turn that data into something usable in your application.
— Young and Harter’s NodeJS in Practice
Text files, images, videos and anything you can store in a computer have a thing in common: all of them are stored as binary data. We make sense of what a sequence of binary data refers to purely based on how we interpret the binary data, and whether it conforms to what we expect it to be. If some chunk of binary data holds any meaning, we can tell it apart from another chunk by using a binary format specification, which describes how some binary data ought to be interpreted. For example, in the dBASE specification the first 32 bytes make up the header, which contains information such as date of last update, number of records in the database file, etc. Every binary file format you can ima
The JsonLineParser class implements a transform stream (using Node.js v20.2.0's Stream API) to parse a file that contains JSON objects separated by newlines (See data.ndjson). It's adapted from Young and Harter's Node.js in Practice book, especifically Technique 31: Implementing a readable stream.
The best way to get the right answer on the Internet is not to ask a question; it's to post the wrong answer.
Without a clear indicator of the author's intent, any parodic or sarcastic expression of extreme views can be mistaken by some readers for a sincere expression of those views.

