This document now exists on the official ASP.NET core docs page.
- Application
- Request Handling
interface Logging { | |
fun log(message: String) | |
} | |
interface Prompt { | |
fun promptUser(): String | |
} | |
fun <Ctx> Ctx.exampleFn() where Ctx: Logging, Ctx: Prompt { |
#include <iostream> | |
#include <memory> | |
#include <type_traits> | |
#include <utility> | |
namespace not_std | |
{ | |
template<typename T> | |
constexpr T default_getter(const T& val) noexcept | |
{ |
This document now exists on the official ASP.NET core docs page.
I'm going to do something that I don't normally do, which is to say I'm going to talk about comparative benchmarks. In general, I try to confine performance discussion to absolute metrics as much as possible, or comparisons to other well-defined neutral reference points. This is precisely why Cats Effect's readme mentions a comparison to a fixed thread pool, rather doing comparisons with other asynchronous runtimes like Akka or ZIO. Comparisons in general devolve very quickly into emotional marketing.
But, just once, today we're going to talk about the emotional marketing. In particular, we're going to look at Cats Effect 3 and ZIO 2. Now, for context, as of this writing ZIO 2 has released their first milestone; they have not released a final 2.0 version. This implies straight off the bat that we're comparing apples to oranges a bit, since Cats Effect 3 has been out and in production for months. However, there has been a post going around which cites various compar
import java.lang.reflect.Method; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import org.graalvm.polyglot.Context; | |
import org.graalvm.polyglot.Value; |
Date | 05-05-2021 - 10-17-2023 |
Revision | R3 |
Author | Guillaume Dua |
Reviewers | Loïc Joly, Antoine Morrier |
fun Any.prettyPrint(): String { | |
var indentLevel = 0 | |
val indentWidth = 4 | |
fun padding() = "".padStart(indentLevel * indentWidth) | |
val toString = toString() | |
val stringBuilder = StringBuilder(toString.length) |
# Addresses an issue where language servers won't know what to do with header files | |
# since compile_commands.json typically only includes .cc/.cpp/.c files. | |
# | |
# Include this file from your main Makefile, or just paste the snippet in. | |
# To use: | |
# make compile_commands | |
# Requires bear and compdb | |
# bear [osx]: brew install bear | |
# compdb [see https://github.com/Sarcasm/compdb]: pip install compdb |
-- how to model threaded comments (e.g. reddit comments) in SQL with a simple 'ancestors' column | |
-- The comment tree: | |
-- [1] | |
-- / \ | |
-- [2] [4] | |
-- / \ \ | |
-- [3] [7] [6] | |
-- / | |
-- [5] |
/****************************************************************************** | |
* Implementation of `Nonempty` validator which checks that the provided type | |
* has at least one defined property, excluding `{}`. | |
******************************************************************************/ | |
type Nonempty<T extends { [key: string]: any }> = { [P in keyof T]: T }[keyof T]; | |
declare function wantsNonempty<T extends { [key: string]: any }>(x: Nonempty<T>): true; | |
wantsNonempty({ x: 1 }); | |
wantsNonempty({}); // error expected |