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
uucidl / c4668-preprocessor-script.bat
Created Jul 11, 2016
Pragma disabling warning 4668 are not honored in time by the MSVC pre-processor
View c4668-preprocessor-script.bat
@echo off
REM a normal compilation runs through
cl.exe main.cpp /Z7 /nologo /c -DWIN32 -W4 -WX -Wall -wd4514
REM however the pre-processor fails because of -WX and C4668
cl.exe main.cpp /Z7 /nologo /c -DWIN32 -W4 -WX -Wall -wd4514 -E
@uucidl
uucidl / fastbuild-generator.patch
Last active Jul 18, 2016
(WIP) FASTbuild generator for gyp
View fastbuild-generator.patch
From 2c2a5e747a601ec655e5a94d935cca09599580d1 Mon Sep 17 00:00:00 2001
From: nil <nil@ableton.com>
Date: Mon, 9 May 2016 12:51:23 +0200
Subject: [PATCH 01/19] Import fastbuild generator
---
pylib/gyp/generator/fastbuild.py | 1095 ++++++++++++++++++++++++++++++++++++++
1 file changed, 1095 insertions(+)
create mode 100644 pylib/gyp/generator/fastbuild.py
View Programming Books Canon.org
  • A Discipline Of Programming by Edsger W. Dijkstra
  • Elements Of Programming by Alexander Stepanov and Paul McJones
View generality.org

https://youtu.be/CAlU_hs_rZ8?t=3069

It’s good to generalize when things get simpler in generality. I.e. general case vs case analysis

This seems to have similarities to the practice of Topology in Mathematics (of which I’m no expert of) in how they squash degerate cases.

Discipline Of Programming by Dijkstra:

  • there are useful and useless generalizations
View histogram.c
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
size_t
megabytes_size(uint32_t x)
{
return x * 1024 * 1024;
View problems-with-async.org

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
uucidl / grain-ratio.cpp
Last active Mar 3, 2017
grain-ratio.cpp
View grain-ratio.cpp
// @url: https://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html
// @url: https://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD361.html
// @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
@uucidl
uucidl / symbolserver_tips.org
Created Apr 28, 2017
Symbols; Symbol Server on Windows
View symbolserver_tips.org
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.
//
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
You can’t perform that action at this time.