Skip to content

Instantly share code, notes, and snippets.

@pineapplehunter
pineapplehunter / fetch_and_generate_md.py
Last active October 25, 2022 18:35
中條研の論文をスクレイピングしてMDを作るスクリプト
import json
import re
from bs4 import BeautifulSoup, UnicodeDammit
import requests
from pathlib import Path
cache_file = Path("paper_data_cache.json")
output_dir = Path("markdown")
@pineapplehunter
pineapplehunter / debug.c
Last active April 24, 2022 15:12
C言語のデバッグ教材
#include <stdio.h>
int main() {
// a=5,b=3のとき
// c=a+bは8になってほしい!
int a = 5;
int b = 3;
int c = a - b;
if (c == 8) {
printf("成功! c = 8\n");
@pineapplehunter
pineapplehunter / hello.c
Last active April 24, 2022 13:47
C言語ワークショップで使うハローワールドのコード
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}

aiyprojectメモ

音声の再生と録音チェック

キットに付属のオーディオを探すようになっているので標準的なオーディオでも使えるように調整

/boot/config.txt#を外す

dtparam=audio=on
@pineapplehunter
pineapplehunter / cargo-mold.fish
Last active December 17, 2021 13:17
Use cargo with mold only on debug mode. Needs a file named "mold" on the root of the project.
function cargo --wraps=cargo
if test -f mold && ! contains -- --release $argv
command mold --run cargo $argv
else
command cargo $argv
end
end
@pineapplehunter
pineapplehunter / dsp_filterplot.jl
Last active August 21, 2022 13:42
Julia DSP.jl Filter plot like MATLAB zplane
using DSP
using RecipesBase
@recipe function plot(
f::FilterCoefficients;
xguide = "Real part",
yguide = "Imaginary part",
legend = true,
unitcolor = :auto,
zerocolor = :auto,
@pineapplehunter
pineapplehunter / fib2.c
Created October 2, 2020 07:44
アルゴリズム論の自作スタックを使ってた例のgotoをなくしたやつ
#include <stdio.h>
int fib2 (int);
int main () { printf ("%d\n", fib2 (3)); }
int fib2 (int n) {
int stack[100], sp = 0, r = 0, flg = 0;
while (1) {