Skip to content

Instantly share code, notes, and snippets.

View buyoh's full-sized avatar
☪️

mai buyoh

☪️
View GitHub Profile
/// 1文字読む.
/// let c = getc(&mut std::io::stdin()).unwrap();
fn getc(r : &mut Read) -> Result<u8, Error>{
let mut buf = [0;1];
match r.read(&mut buf){
Ok(size) => { if size > 0 { Ok(buf[0]) } else { Err(Error::new(ErrorKind::Other, "no out") ) } }
Err(err) => { Err(err) }
}
}

読書メモ

12ステップで作る組込みOS自作入門

図書館にあったので借りた.

ステップ内容

@buyoh
buyoh / file0.cpp
Last active November 6, 2018 12:07
TECH PLAYで連載されている「パズルのアルゴリズム問題」を解いてみた ref: https://qiita.com/buyoh/items/86264d274ce0932a18aa
#include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
vector<int> mat(9);
for (int i = 0; i < 9; ++i)
@buyoh
buyoh / allocator.cpp
Last active August 17, 2018 16:16
std::allocator と std::allocator_traits のメモ
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
using namespace std;
struct S{
int x;
S(int _x = 0):x(_x){
cout << "con" << x << ";" << this << endl;
print STDIN.read.chars.map{|c| c=='S' ? " " : c=='T' ? "\t" : c=='L' ? "\n" : nil}.compact*""
@buyoh
buyoh / summerpronama2018.java
Last active July 29, 2018 23:09
summerpronama2018.pde (processing 3.4)
import java.awt.Point;
import java.util.*;
boolean redrawFlg = true;
int rate = 80; // 与えられる回答が正しい確率
int N = 6;
String[] questions;
boolean[] answers;
int totalScore = 0;

arduino asm

1

目標

コンパクトなarduinoアプリを制作できるようにする.

参考サイト

@buyoh
buyoh / dockermemo.md
Last active June 16, 2018 04:28
dockerに関する実験記録

dockerに関するメモ

実験環境

  • raspberry pi zero WH
  • raspbian umane -r => 4.14.34+
  • 実行時間が遅くてものんびりお茶を嗜むことができる精神

ダメだった環境