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
View compilation_times.md
View bitwise-notes-62.md

Bitwise Day 62: Indexed Arrays

Per worked 20h since Day 61.

How do we get a good story for dynamic arrays? What we called stretchy bufs (buf_... API)

Added many new intrinsics to gen_intrinsic:

  • apush, kadd, kdget, kdel
  • hget, hdel
@uucidl
uucidl / ibbq-thermometer-protocol.md
Last active Jan 22, 2019
ibbq-thermometer-protocol
View ibbq-thermometer-protocol.md

Example devices:

  • Inkbird IBT-2X

  • EasyBBQ FCCID: FCC ID 2AI4MPRO3 (SHENZHEN HYPERSYNES CO.,LTD Smart Wireless Thermometer PRO3)

  • @ConnectTimeout: 60 seconds

  • @BatteryPollingInterval: 5 minutes

The iBBQ is a Bluetooth LE Gatt Device

@uucidl
uucidl / traverse_children.ion
Last active Dec 9, 2018
Traversing Hierarchies
View traverse_children.ion
// Depth first traversal algorithm.
//
// (credit to Alexander Stepanov in Elements Of Programming)
//
// One of the benefits is that the visitor can implement pre or post traversal algorithms, and combine them in one single piece.
//
// @generic in T, the node value type
func traverse_children_recursively(tree_root: T*, step_visitor: func(step: TraversalStep, node: T*))
{
step_visitor(TraversalStep_PRE, tree_root);
@uucidl
uucidl / test_metal_with_sdl2.c
Created Nov 11, 2018
Testing metal on my macs. My dear Mac Mini does not support it
View test_metal_with_sdl2.c
#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>
@uucidl
uucidl / README.md
Last active Oct 29, 2018
Rokusa (Pure)
View README.md

Some useful code written in ion

@uucidl
uucidl / 00ctztree.md
Last active Oct 24, 2018
Octave Tree
View 00ctztree.md

CTZTree

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.

View ZZ_CodeResources.md
@uucidl
uucidl / canoscan_build.sh
Created Jan 22, 2018
little program to use if you're canoscan lide30 scanner says "device not configured"
View canoscan_build.sh
#!/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 / atan_approx.c
Last active Jan 4, 2018
Approximations
View atan_approx.c
// 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;
You can’t perform that action at this time.