docker run -it --rm -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static philipz/rpi-raspbian bash
#include <type_traits> | |
#include <iostream> | |
#define REALLY_STRONG_TYPEDEF(From, To) \ | |
class To final { \ | |
static_assert(std::is_scalar<From>(), ""); \ | |
From x; \ | |
\ | |
public: \ | |
To() = default; \ |
#include <tuple> | |
#include <initializer_list> | |
#include <math.h> | |
#include <utility> | |
using namespace std; | |
template <typename Tup1, typename Tup2, size_t...s> | |
double euclidean_distance_impl (Tup1 const &tup1, Tup2 const &tup2, index_sequence<s...>) |
Melvanimate is a library for ESP8266 that lets you control your Neopixels over WLAN easily. It supports everything imaginable besides toasting your toast, e.g.,:
- Animate Neopixels (hence the name!) or set them to solid colors
- Control LEDs via a web interface (for casually setting a certain color of effect)
- Control LEDs via MQTT or DMX/E131 (for automation)
- Adalight DIY ambient monitor lighting similar to Ambilight
// vector_view class, based on code by James exjam https://github.com/exjam/string_view | |
// rlyeh, public domain | |
#pragma once | |
#include <vector> | |
#if defined(_MSC_VER) && _MSC_VER < 1900 | |
#define constexpr | |
#define noexcept | |
#endif |
size_t memcount_sse2(const void *s, int c, size_t n) { | |
__m128i cv = _mm_set1_epi8(c), sum = _mm_setzero_si128(), acr0,acr1,acr2,acr3; | |
const char *p,*pe; | |
for(p = s; p != (char *)s+(n- (n % (252*16)));) { | |
for(acr0 = acr1 = acr2 = acr3 = _mm_setzero_si128(),pe = p+252*16; p != pe; p += 64) { | |
acr0 = _mm_add_epi8(acr0, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)p))); | |
acr1 = _mm_add_epi8(acr1, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+16)))); | |
acr2 = _mm_add_epi8(acr2, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+32)))); | |
acr3 = _mm_add_epi8(acr3, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+48)))); __builtin_prefetch(p+1024); | |
} |
# Install quemu, docker, etc | |
yaourt -S qemu qemu-user-static binfmt-support | |
# The quemu-user-static AUR package is outdated and broken. The .deb package they pull is no longer in the ubuntu repository. | |
# Edit the PKGBUILD and use qemu-user-static_2.4+dfsg-3_amd64.deb (With SHA1 sum "84d83a16c60c82b6c579f2f750b04a3ac26c249b") | |
# Enable ARM emulation | |
update-binfmts --enable qemu-arm |
This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages
branch using Travis CI.
This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.
Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.
To create a clean gh-pages
branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md
in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th
/** | |
SparseSet.h | |
Implements a class template of a sparse | |
set of unsigned integers. | |
@author Sam Griffiths | |
www.computist.xyz | |
*/ | |
#pragma once |
// Inside the file libavformat/utils.c is the routine "int av_read_frame(AVFormatContext *s, AVPacket *pkt)", one of the key routines | |
// used to play video streams through FFMPEG's libav. This routine does not handle the situation when a live stream terminates | |
// unexpectedly, such as the unplugging of a network connection, power loss to a camera, or other reasons an established connection | |
// would unexpectedly stop delivering packets. | |
// Below is the beginning of av_read_frame() up to and a bit past the three added lines necessary to support calling of the installed | |
// avformat interrupt callback. The conventional libav behavior is to call the avformat interrupt callback while establishing a new | |
// connection with a live stream. It is not called while the stream is playing, therefore no opportunity is provided to the client | |
// software to recognise unexpected stream termination. | |
// The three lines are added to the code pasted below. They should be easy to identify: |