Skip to content

Instantly share code, notes, and snippets.

@uucidl
uucidl / 0cpp_monsters.org
Last active November 5, 2017 17:40
CPP monsters

C++ monsters

@uucidl
uucidl / ghetto-trace.c
Last active December 7, 2017 15:26
Trace in a hostile environment (snippet to use for printf debugging)
// (Ghetto trace) (Trace in an hostile environment)
#include <stdlib.h>
#define UU_TRACE_BEGIN
#define UU_TRACE_END
#if defined (_WIN32)
extern "C" {
__declspec(dllimport) unsigned long __stdcall GetCurrentProcessId(void);
void __stdcall OutputDebugStringA(_In_opt_ char const *outputString);
__declspec(dllimport) int _snprintf( char* buffer, size_t buf_size, const char* format, ... );
}
@uucidl
uucidl / 00-solving-problems-with-computing-devices.org
Last active December 8, 2017 11:12
Solving problems with computing devices

Engineering

Good results in software engineering depend on robust decisions over the trade-offs involved in solving problems with computing devices. This can only be done through a good understanding of the problem being presented, and the context/platform that will support its resolution. Technical choices should not be elevated above that.

Note that both the problem and the platform’s definition should not only consist of inanimate objects. Both always incorporate human elements that must be understood.

By nature, engineering therefore involves learning, knowledge formation, skill development and acquisition.

Learning and knowledge formation

@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 / atan_approx.c
Last active January 4, 2018 00:12
Approximations
// 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;
@uucidl
uucidl / canoscan_build.sh
Created January 22, 2018 22:04
little program to use if you're canoscan lide30 scanner says "device not configured"
#!/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}")
@uucidl
uucidl / 00-Rhetorics.org
Last active January 25, 2018 10:32
Rhetorics

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

  • Magic/Mysterium. In classical times it was clear that it takes time to develop know-how. Practice. Initiation. Hence roles of schools as safe space for learning and practice.
  • Eloquence
@uucidl
uucidl / ZZ_CodeResources.md
Last active October 5, 2018 12:33
Task_api
@uucidl
uucidl / README.md
Last active October 29, 2018 09:01
Rokusa (Pure)

Some useful code written in ion

@uucidl
uucidl / test_metal_with_sdl2.c
Created November 11, 2018 21:42
Testing metal on my macs. My dear Mac Mini does not support it
#include "SDL2.framework/Headers/SDL.h"
#define sdl2_guard(__expr) \
if ((__expr) != 0) { \
fprintf(stderr, "SDL Error: '%s'\n", SDL_GetError()); \
assert(0); \
}
#include <assert.h>