Skip to content

Instantly share code, notes, and snippets.

View tttapa's full-sized avatar
📖
I may be slow to respond.

Pieter P tttapa

📖
I may be slow to respond.
View GitHub Profile
@tttapa
tttapa / Dockerfile
Created April 2, 2019 23:14
Building a GCC 8 Cross Compiler for ARMv6 (Raspberry Pi)
# https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/
# Ubuntu 18.04 at the time of writing (2019-04-02)
FROM ubuntu:latest
# Install some tools and compilers + clean up
RUN apt-get update && \
apt-get install -y git wget gcc-8 g++-8 cmake gdb gdbserver bzip2 && \
apt-get clean autoclean && \
apt-get autoremove -y && \
@tttapa
tttapa / Dockerfile
Created April 17, 2019 22:43
Docker build crosstools-NG
# https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/
# Ubuntu 18.04 at the time of writing (2019-04-02)
FROM ubuntu:latest
# Install some tools and compilers + clean up
RUN apt-get update && \
apt-get install -y git wget \
gcc g++ cmake make autoconf automake gperf diffutils bzip2 xz-utils \
flex gawk help2man libncurses-dev patch bison python-dev gnupg2 texinfo unzip libtool-bin && \
class PeakDetector:
def __init__(self,
threshold: int, hysteresis: int):
self.threshold = threshold
self.hysteresis = hysteresis
self.previous_peak_maximum = 0
self.current_maximum = 0
def __call__(self, value: int):
@tttapa
tttapa / CN.md
Last active June 24, 2019 09:27

Computer Networks

1. Introduction

Slides: (61)

  • A Brief History of Networks
  • Computer Networks Today
  • Layering and Protocols

Reading:

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
<compounddef id="d7/d4f/MIDIOutput_2Control-Change_2CCIncrementDecrementButtons_2CCIncrementDecrementButtons_8ino-example" kind="example">
<compoundname>MIDIOutput/Control-Change/CCIncrementDecrementButtons/CCIncrementDecrementButtons.ino</compoundname>
<briefdescription>
</briefdescription>
<detaileddescription>
<para><heading level="1"><ref refid="d3/d60/classCCIncrementDecrementButtons" kindref="compound">CCIncrementDecrementButtons</ref> </heading>
</para>
<para>This is an example that demonstrates the use of Increment and Decrement buttons that can be used for scrolling through a song list, tuning effects, etc. <linebreak/>
@tttapa
tttapa / Increase-Bit-Depth.cpp
Created August 15, 2019 18:57
C++ template function to increase the number of bit in a number uniformly.
#include <climits>
#include <cstdint>
#include <iostream>
template <bool B, class T = void>
struct enable_if {};
template <class T>
struct enable_if<true, T> {
typedef T type;
@tttapa
tttapa / Dockerfile
Last active September 9, 2019 15:31
Dockerfile for cross-compiling Python for the Raspberry Pi 3
FROM ubuntu:latest as ct-ng
# Install some tools and compilers + clean up
RUN apt-get update && \
apt-get install -y sudo git wget \
gcc g++ cmake make autoconf automake \
gperf diffutils bzip2 xz-utils \
flex gawk help2man libncurses-dev patch bison \
python-dev gnupg2 texinfo unzip libtool-bin \
autogen libtool m4 gettext pkg-config && \
#include <Control_Surface.h>
USBMIDI_Interface midi; // MIDI Interface to use
// Struct with callbacks that are called when MIDI data comes in
struct MyCallback final : MIDI_Callbacks {
// Function is called when MIDI Channel Message is received.
void onChannelMessage(Parsing_MIDI_Interface &midi) override {
// Handler for messages of type: