(defprofile lagénorhynque
:id @lagenorhynque
:reading "/laʒenɔʁɛ̃k/"
C++ links: Coroutines
https://github.com/MattPD/cpplinks / C++ Standard / C++20 / Coroutines
(draft; work in progress)
#coroutines (C++ Slack): https://cpplang.slack.com/archives/C5JS5JXT5
import 'dart:ui' show Path, PathMetric, Offset; | |
Path trimPath(Path source, double percentage) { | |
/// WARNING: computeMetrics returns a iterator that can only be used ONCE! | |
percentage = percentage.clamp(0.0, 1.0); | |
if (percentage == 0.0) return Path(); | |
if (percentage == 1.0) return Path.from(source); | |
final dest = Path(); |
In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.
It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").
The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).
The event loop almost always operates asynchronously with the message originator.
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
const( | |
MinUint uint = 0 // all zeroes | |
// Perform a bitwise NOT to change every bit from 0 to 1. |
#! /usr/bin/env stack | |
-- stack --resolver lts-18.8 script | |
{-# LANGUAGE OverloadedStrings #-} | |
{- | |
This is a handy illustration of converting between five of the commonly-used | |
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy | |
Text). |
version: "3.5" | |
services: | |
mongo: | |
image: mongo:latest | |
container_name: mongo | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: admin | |
MONGO_INITDB_ROOT_PASSWORD: admin | |
ports: |
Guillaume Papin(@Sarcasm) has a thorough article about compilation databases.
% mkdir build
% (cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..)
% ln -s build/compile_commands.json