Skip to content

Instantly share code, notes, and snippets.

@nomaddo
nomaddo / v4l_sample.c
Created June 11, 2021 05:29
YUVで撮像してRGB24にconvertし、dumpするv4lプログラムの例
// gcc -lv4l2 -lv4lconvert v4l_sample.c
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@nomaddo
nomaddo / Answer.md
Last active March 1, 2021 16:40
uminekoの考察まとめ

答え合わせ

EP5以降のネタバレによる答え合わせ。

犯人

正解。紗音=嘉音=ベアトリーチェ。 これはEP6などの描写を見るに間違いない。

犯行動機

@nomaddo
nomaddo / gist:9abfc2e7afd9634e7d9af00c0be28822
Created December 29, 2018 17:11
Ryzen 7 2700 U with Vega mobile
Platform: AMD Accelerated Parallel Processing\0
Device: gfx902\0
Driver version : 2639.3 (PAL,HSAIL)\0 (Linux x64)
Compute units : 10
Clock frequency : 1300 MHz
Global memory bandwidth (GBPS)
float : 31.79
float2 : 33.02
float4 : 33.92
@nomaddo
nomaddo / test.py
Last active September 15, 2018 16:32
TMU load experiment
import numpy as np
import time
from videocore.assembler import qpu
from videocore.driver import Driver
@qpu
def hello_world(asm):
mov(r0, uniform)
ldi(r2, 3000000)
/* clang-6 -O1 -S -emit-llvm
extern int f(int);
int g(int in)
{
int x = 0;
switch(in)
{
case 0:
x += f(in);
@nomaddo
nomaddo / hello.cl
Created August 30, 2018 22:09
opencl example
__global void hello(__global float * a, float b)
{
int gid = get_global_id(0);
a[gid] = b;
}
/* ラズパイ3で実験する(オーバークロックなし)
* gcc 6.3 -O2でコンパイル(キャッシュの効果を実感するためだけなので他のループ最適化オプションはなし)
* -DCHANGE つきで780 millisec
* -DCHANGE なしで21850 millisec
*/
#include <iostream>
#include <vector>
#include <chrono>
grammar Debug;
prog returns [v]
: additive {$v = additive.v};
additive returns [v] :
l=additive s='+' r=primary {$v = $l.v + $r.v
print($v)}
| p=primary {$v = $p.v}
;
@nomaddo
nomaddo / .screenrc
Created July 17, 2018 17:26
screen
escape ^Tt
defbce on
term xterm-256color
shell $SHELL
termcapinfo xterm* 'Co#256:pa#32767:AB=\E[48;5;%dm:AF=\E[38;5;%dm:'
hardstatus off
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'
startup_message off
@nomaddo
nomaddo / bad.cpp
Last active April 19, 2018 13:33
これはどうすればいいの、、、、
#include <memory>
class A : public std::enable_shared_from_this<A> {
public:
int id;
A(int x) : id(x) {}
};
class B : public A
{