Skip to content

Instantly share code, notes, and snippets.

Nicolas uucidl

Block or report user

Report or block uucidl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
uucidl / repro.c
Last active Aug 20, 2017
Reproduction of an optimizer bug with Visual Studio 2017
View repro.c
/* Repro optimizer issue with Visual Studio 2017 */
/* @language: c99 */
# Visual Studio 2015 (working)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
cl.exe -Fe:repro.exe repro.c -nologo -FC -EHsc -Z7 -Oi -GR- -Gm- -O2 -Z7 -W4 -WX -DEBUG
View adl_barrier_idiom.cpp
// What you do when you want to prevent ADL from kicking in, and force your
// users to use fully qualified names.
namespace module
struct Foo { int a, b; }; // struct defined in one namespace
namespace functions
void Flaggerbify(Foo* foo); // function defined in another
uucidl /
Last active Sep 1, 2017
Maintaining APIs: Resist adding that boolean parameter!

Resist adding that boolean parameter!

Also known as: “The Boolean Trap” “Boolean parameters are wrong”

Consider a trivial software interface with one entry point proc:

// Transforms a value (type T0) into another value (type T1) with effect E0
T1 proc(T0);
View cursors.cpp
// Passing container explicitely to all its functions, and using typed cursors (i.e. indices)
// rather than all-knowing iterators (i.e. pointers) allows to use the same return type for
// iteration, look-up etc.. regardless of what's going to happen next.
// Downsides:
// A cursor requires an indirection when looking at the data in the debugger.
// I.e. a `char*` member shows you directly what you should be looking at,
// whereas if you have the pos, you need the container and to use debugger expressions
// to see the content.
uucidl /
Created Apr 28, 2017
Symbols; Symbol Server on Windows
uucidl / 00array.h
Last active Dec 14, 2017
Opaque struct example
View 00array.h
#pragma once
/* @language: c11 */
#include <stddef.h>
#include <stdint.h>
#if defined(__cplusplus)
#define ARRAY_ALIGNAS alignas(8)
uucidl /
Last active May 9, 2019
The Problem Of UI (User Interfaces)

Asynchronous updates are somewhat useful to distribute computations.

However this makes behavior composition hard (callback/promise etc) and callstacks start losing their effectiveness when a crash occurs, since scope is unclear.

uucidl / grain-ratio.cpp
Last active Mar 3, 2017
View grain-ratio.cpp
// @url:
// @url:
// @quote{
// For besides the need of precision and explicitness, the programmer is faced with a problem of size
// that seems unique to the programmer profession. When dealing with "mastered complexity", the idea
// of a hierarchy seems to be a key concept. But the notion of a hierarchy implies that what at one
// level is regarded as an unanalyzed unit, is regarded as a composite object at the next lower lever
// of greater detail, for which the appropriate grain (say, of time or space) is an order of magnitude
// smaller than the corresponding grain appropriate at the next higher level. As a result the number
// of levels that can meaningfully be distinguished in a hierarchical composition is kind of
You can’t perform that action at this time.