Skip to content

Instantly share code, notes, and snippets.

@eikendev
eikendev / walsh-hadamard-transform.cpp
Created Apr 12, 2020
Walsh-Hadamard transform using SIMD intrinsics
View walsh-hadamard-transform.cpp
#include <immintrin.h>
#define NR (8) // Number of rows.
#define MR (75) // Number of columns.
static const inline __m256d transform1a(__m256d a, __m256d b)
{
const __m256d ret = _mm256_add_pd(a, b);
return ret;
@eikendev
eikendev / sinkswitch.sh
Created Feb 10, 2020
Sink switch for PulseAudio
View sinkswitch.sh
#!/usr/bin/env bash
CURRENT_SINK_INDEX="$(pacmd list-sinks | grep '* index: ' | tr -dc '0-9')"
CARDS="$(pacmd list-sinks | grep "index: " | tr -dc '0-9\n' | sort)"
PICKNEXTCARD=1
for card in $CARDS; do
if [ "$PICKNEXTCARD" == 1 ]; then
NEXT_SINK_INDEX="$card"
PICKNEXTCARD=0