Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
# Math | |
<Multi_key> <A> <A> : "∀" | |
<Multi_key> <E> <E> : "∃" | |
<Multi_key> <exclam> <E> <E> : "∄" | |
<Multi_key> <minus> <0> : "−" | |
<Multi_key> <KP_Subtract> <KP_0> : "−" | |
<Multi_key> <asterisk> <1> : "⋅" | |
<Multi_key> <KP_Multiply> <KP_1> : "⋅" |
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]
struct foo {
struct bar {
int x;
Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
#!/usr/bin/awk -f | |
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff | |
# My copy here is written in awk instead of C, has no compelling benefit. | |
# Public domain. @thingskatedid | |
# Run as awk -v x=xyz ... or env variables for stuff? | |
# Assumptions: the data is evenly spaced along the x-axis | |
# TODO: moving average |
If you have a LUKS-encrypted partition on another disk, it's easy to mount it inside WSL.
List your disks:
> wmic diskdrive list brief
Mount the whole disk inside WSL (using --bare
so WSL doesn't attempt to mount it automatically):
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <assert.h> | |
// We'll have 128 tokens. Each token can be up to 32 characters long. | |
char token[128][32]; | |
int lexer(char* input) { |
OS | Arch | Model | CPU | RAM | Storage |
---|---|---|---|---|---|
macOS | arm64 | 2020 Mac Mini | Apple Silicon M1 8 core 3.2ghz | 8GB | 512G SSD |
macOS | x86 | Late 2014 Mac Mini | Intel i7 8 core 3ghz | 16GB | 256G SSD |
linux | x86 | Beelink GTR5 5900HX | Ryzen 9 5900HX 8 core 4.6ghz | 32GB | 512G SSD |
windows | x86 | Beelink GTR5 5900HX | Ryzen 9 5900HX 8 core 4.6ghz | 32GB | 512G SSD |
windows | arm64 | Windows Dev Kit 2023 | Snapdragon 8cx Gen 3, 8 core ~3ghz | 32GB | 512G SSD |
linux | arm64 | Radxa ROCK pi 5B | RK3588 8 core ~2.4ghz | 16G | 512G SSD |
- Case: KENUCO SOHO Mini 10" Rack
// I'm tired of extensions that automatically: | |
// - show welcome pages / walkthroughs | |
// - show release notes | |
// - send telemetry | |
// - recommend things | |
// | |
// This disables all of that stuff. | |
// If you have more config, leave a comment so I can add it!! | |
{ |