Skip to content

Instantly share code, notes, and snippets.

View tomoyanonymous's full-sized avatar
🐈
meow

松浦 知也 Matsuura Tomoya tomoyanonymous

🐈
meow
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tomoyanonymous on github.
  • I am tomoya_nonymous (https://keybase.io/tomoya_nonymous) on keybase.
  • I have a public key ASCxfT961oPp5K40zaX_IfEKbcKIjuDioodZouZwy6KY9go

To claim this, I am signing this object:

@tomoyanonymous
tomoyanonymous / 1_recursive_variant_cpp17.md
Last active March 8, 2023 07:58
Best practice of recursive variant type in C++17

Best practice of recursive variant type in C++17

Example: https://godbolt.org/z/KxY5Gz8Wx

Consider about making ADT for describing simple abstract syntax tree(AST) like below in haskell.

data Expr =  FloatLit Float |
 Symbol String |
@tomoyanonymous
tomoyanonymous / 0-generic-fmap-foldl-in-cpp.md
Last active April 1, 2021 06:18
Do functional map (iterate functions over different kind of containers) in C++ どうしてもC++で関数型っぽくmapとかfoldlとかしたい人のためのヘルパー関数
@tomoyanonymous
tomoyanonymous / gentodaisy.md
Last active October 13, 2020 12:28
How to Run C++ exported from gen~(Cycling'74 Max) on Daisy
var samplerate;
var stereo = 1;
var audioif;
var audiomix;
var outbufsize = 1024;
var outbufsize2 = outbufsize * 2;
var outquenum = 5;
var app;
var ctx;
var imgpanel;
@tomoyanonymous
tomoyanonymous / gist:c4c548995b73a45b9e5b90af00a86ce2
Last active April 14, 2020 11:27
ffmpeg streaming command memo
#send
ffmpeg -f avfoundation -re -i \"none:BlackHole 16ch\" -c:a pcm_s16le -ac:a 4 -f rtp rtp://localhost:30000 -sdp_file test.sdp
#receive
ffplay -protocol_whitelist "rtp,udp,file" -i "rtp://127.0.0.1:30000"
@tomoyanonymous
tomoyanonymous / closuretest.cpp
Last active November 11, 2019 08:45
memo: llvm mapping of lambda functions, closures and capture objects in clang++
#include <stdio.h>
int main(){
int a = 540;
float b = 460.1;
auto fun = [&](int x){
putchar(a);
putchar((int)b);
putchar(x);
};
fun(1);
@tomoyanonymous
tomoyanonymous / reversedelay.dsp
Last active February 4, 2022 10:54
Reverse Delay written in Faust
declare name "reversedelay";
declare version "1.0";
declare author "Tomoya Matsuura";
declare license "MIT";
declare copyright "(c)Tomoya Matsuura 2019";
import("stdfaust.lib");
MAX_DELAY = 48000;
phasor_phase(dtime,phase)= ((os.lf_rawsaw(dtime)+phase)% dtime) :int; //phase shift in sample
indexphasor(dtime,phase) = phasor_phase(dtime*2,phase)<: <=(dtime),(*(-1)+dtime*2),_ : select2; //folded triangle
#!/bin/bash
cd `dirname $0`
IFS='
'
for file in $(find content -type f -name index.*md ); do
echo $file
cppath=`echo $file|sed -E 's!(.*)/(.*\..*)!\1!g' `
for grep in $(cat $file | grep -e "JPG" -e "jpg" -e "png" -e "svg" -e "" ); do
echo "grepped $grep"
img=`echo $grep| sed -E 's!(.*)(\(| |"|/)(.*)(\.)([a-zA-Z]{3,4})(.*$)!\3\4\5!g' `
@tomoyanonymous
tomoyanonymous / nlp-basic.ipynb
Created October 9, 2018 18:01
Scrapism-week4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.