Skip to content

Instantly share code, notes, and snippets.

kind: ServiceAccount
apiVersion: v1
metadata:
name: restart-deploy
namespace: testns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
@HudsonHuang
HudsonHuang / audio_format.py
Created October 11, 2019 15:21
Convert audio data of PCM16/float32 to byte, and vice versa.
"""Helper functions for working with audio files in NumPy."""
"""some code borrowed from https://github.com/mgeier/python-audio/blob/master/audio-files/utility.py"""
import numpy as np
import contextlib
import librosa
import struct
import soundfile
def float_to_byte(sig):
#include <asio.hpp>
#include <asio/ssl.hpp>
#include <algorithm>
#include <atomic>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <memory>
#include <thread>

现整理收集C++世界里那些“牛人”的个人博客。凡三类:一是令人高山仰止的大牛,对C++语言本身产生过深远的影响的人;二是C++运用炉火纯青的高手,有原创性的技术干货;三是中文世界里的C++牛人。

C++大牛的博客

@jdeng
jdeng / cluster
Last active June 17, 2020 02:52
clustering by fast search and find of density peak
// generate [0..n-1]
auto seq = [](size_t n) -> std::vector<size_t> {
std::vector<size_t> v(n);
for (size_t i=0; i<n; ++i) v[i] = i;
return v;
};
auto index = seq(n);
// n * n distance matrix
std::vector<D> dists(n * n);
#!/bin/bash
: << '#__REM__'
指定さたライブラリをAndroid用にフルオートで作成します。ダウンロード、toolchainsの作成、複数のアーキテクチャのビルドも自動的に行います。デフォルトではarmv5te、armv7-a、mips1、i386のアーキテクチャを作成します。
Create a full-auto for Android the library specified. Creating download, toolchains, build the architecture of multiple automatically. Create architecture, mips1, i386 armv5te, armv7-a by default.
#__REM__
TARGET_VERSION="1.3.1"
@sehe
sehe / Makefile
Last active January 16, 2023 08:29
Boost shared memory lockfree circular buffer queue
all:consumer producer
CPPFLAGS+=-std=c++03 -Wall -pedantic
CPPFLAGS+=-g -O0
CPPFLAGS+=-isystem ~/custom/boost/
LDFLAGS+=-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib
LDFLAGS+=-lboost_system -lrt -lpthread
%:%.cpp
@wobbals
wobbals / AvcEncoder.java
Created October 31, 2012 22:46
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {