Skip to content

Instantly share code, notes, and snippets.

#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
size_t
megabytes_size(uint32_t x)
{
return x * 1024 * 1024;
@uucidl
uucidl / 00_ProfilingAndDataAnalysisInSoftware.org
Last active November 10, 2022 07:58
Profiling and data analysis resources

Goals

Looking at software from a different angle as done during profiling and data analysis has numerous benefits. It requires and increases our understanding of the problems being solved by the software. It exposes us to unexpected discoveries and insights. It allows us to suggest improvements.

Since there is a great element of skills involved, and it is rarely taught in Computer Science degrees, the role of practice is very important to gain the necessary skills.

Exercises

Ex1: sequential processing

Problem Domains For Which Many Create and Publish Their Own Solution

I find that certain problems attract the creation of many solutions. We are overwhelmed with slightly similar yet incompatible and potentially incomplete solutions.

Why is that so? Which domains show this pattern?

My hypothesis is that these problems seem easy to approach from one idiosyncratic perspective while at the same time being hard to complete. Therefore no-one’s satisfied or able to judge existing solutions and end up creating yet another one.

In certain domains, incumbent solutions also may appear bloated, and therefore it’s easy to think one can do better, because the 50% solution appears leaner. Problem is, the remaining 50% is where the necessary risk mitigation, adaptation is. An example of that is the appearance of poorly made (but lean) databases in the age of NoSQL, which claimed to be leaner just because they did not discover yet all the things their historical competitors had discovered they had to do.

@uucidl
uucidl / language-pitfalls.org
Last active December 22, 2020 13:43
Language Specific Pitfalls And Things Not To Do Again

Python2

Don’t create generators with side effects:

import contextlib

@contextlib.contextmanager
def my_nice_context():
    try:
@uucidl
uucidl / grain-ratio.cpp
Last active March 3, 2017 17:22
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 / problems-with-async.org
Created March 3, 2017 17:13
problems with async

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 / 00_the-problem-with-UI.org
Last active May 3, 2024 22:38
The Problem Of UI (User Interfaces)

Links

Note: a lot of programmers talk about UI without mentionning the user even once, as if it was entirely a programming problem. I wonder what we’re leaving off the table when we do that.

@uucidl
uucidl / 00array.h
Last active December 14, 2017 08:01
Opaque struct example
#pragma once
/* @language: c11 */
#include <stddef.h>
#include <stdint.h>
#if defined(__cplusplus)
#define ARRAY_ALIGNAS alignas(8)
#else
@uucidl
uucidl / symbolserver_tips.org
Created April 28, 2017 08:21
Symbols; Symbol Server on Windows
@uucidl
uucidl / 0cpp_monsters.org
Last active November 5, 2017 17:40
CPP monsters

C++ monsters