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);
// 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. | |
// |
// 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 |
/* 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 |
Techniques of persuasion.
Has had a bad rap throughout ages. Appears necessary in democratic societies. Preserved under authoritarian systems for justice and theology, and for elite groups. In western republic democracies, mainly practiced by professional politicians (elective nobility) and lawyers. Porosity between the two groups.
More and more essential in the companies that want to emphasize group problem solving and collaboration. Practiced without knowing it, in a dry style, by engineers via their communications and documentations.
Skill
// Atan approximation | |
// https://www.dsprelated.com/showarticle/1052.php#tabs1-comments | |
#include <math.h> | |
#include <stdio.h> | |
double atan_approx(double z) | |
{ | |
double m = z<0? -1.0:1.0; | |
z *= m; |
#!/usr/bin/env bash | |
export C_INCLUDE_PATH=/usr/local/include/libusb-1.0 | |
export LIBRARY_PATH=/usr/local/lib | |
(O=canoscan ; cc canoscan_unit.c -o "${O}" -lusb-1.0 && printf "PROGRAM\t%s\n" "${O}") |
@url: https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/
pub fn cpuCount(fallback_allocator: *mem.Allocator) CpuCountError!usize {
switch (builtin.os) {
builtin.Os.macosx => {
var count: c_int = undefined;
var count_len: usize = @sizeOf(c_int);
A tree can be produced by counting the number of trailing zeros from an input integer index.
This count ('c') of trailing zeros (or position of the lowest bit) comes back every 2^c sample, i.e. corresponds to a frequency of 2^-c
Furthermore every sample corresponds with one and only one octave.
Some useful code written in ion