Skip to content

Instantly share code, notes, and snippets.

Avatar
🌸
ヾ( ╹◡╹ 🌸 )ノ"

Kenta Sato Tosainu

🌸
ヾ( ╹◡╹ 🌸 )ノ"
View GitHub Profile
@Tosainu
Tosainu / Dockerfile
Last active May 23, 2021
複数インターフェイス環境でのマルチキャスト通信テスト
View Dockerfile
FROM alpine as builder
RUN apk add boost-dev g++
ARG src
ARG bin
COPY "${src}" /
RUN g++ -Wall -Wextra -Werror -pedantic-errors -std=c++17 -O3 /${src} -o /${bin} -lboost_coroutine
FROM alpine
RUN apk add --no-cache libstdc++ boost-coroutine
ARG bin
View wilc_linux_15_3_1-ultra96v2.patch
diff --git a/wilc/Makefile b/wilc/Makefile
index 7eb8cf0..b581506 100644
--- a/wilc/Makefile
+++ b/wilc/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-ccflags-y += -I$(src)/ -DWILC_ASIC_A0 -DWILC_DEBUGFS
+ccflags-y += -I$(src)/ -DWILC_ASIC_A0
+ccflags-y += -DDISABLE_PWRSAVE_AND_SCAN_DURING_IP
View vicious-lua53.patch
--- PKGBUILD.orig 2020-08-06 08:56:57.467622808 +0900
+++ PKGBUILD 2020-08-06 08:59:57.396027278 +0900
@@ -1,29 +1,30 @@
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Sébastien Luttringer
-pkgname=vicious
+_pkgname=vicious
+pkgname=vicious-lua53
pkgver=2.4.1
View Dockerfile
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update && \
apt-get install --no-install-recommends -y \
curl ca-certificates git \
gcc g++ libc-dev clang clang cmake make patchutils \
libboost-all-dev libeigen3-dev libyaml-dev libprotobuf-dev protobuf-compiler libgtkmm-3.0-dev \
View Dockerfile
# syntax=docker/dockerfile:experimental
FROM fedora:31 as builder
ARG METASHELL_REV=16a3d5cd2352f28a6e505ad71b69e59ffb765775
RUN \
dnf install -y git gcc gcc-c++ cmake readline-devel rpm-build python python2 ninja-build && \
git clone --depth=10 https://github.com/metashell/metashell.git /usr/src/metashell && \
cd /usr/src/metashell && \
git checkout $METASHELL_REV && \
View Makefile
memfd: memfd.o binary.o
binary.o: sc
$(LD) -r -b binary -o $@ $^
sc: sc.S
$(CC) -no-pie -nostdlib -s $< -o $@
.PHONY: clean
clean:
@Tosainu
Tosainu / bfc.rs
Last active Aug 30, 2019
Brainf**k compiler (bf -> LLVM IR) and interpreter.
View bfc.rs
use std::collections::VecDeque;
use std::io::Read;
struct Emitter {
variable_idx: u32,
label_idx: u32,
loop_stack: VecDeque<u32>,
}
impl Emitter {
View binary_sqrt.rs
fn binary_sqrt(n: f64, tol: f64) -> f64 {
let mut s = 1.0f64;
let mut e = n;
while (s.powi(2) - n).abs() > tol {
let m = (s + e) / 2.0;
if m.powi(2) > n {
e = m;
} else {
s = m;
}
@Tosainu
Tosainu / a.rs
Last active May 2, 2020
Rust の競プロ用テンプレート
View a.rs
#![allow(unused_imports)]
use std::cmp::{max, min, Reverse};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use itertools::Itertools;
use nyan::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let stdin = std::io::stdin();
@Tosainu
Tosainu / tree.cc
Created May 22, 2019
std::bitset を使った隣接行列の表現、木の DFS と BFS
View tree.cc
#include <algorithm>
#include <array>
#include <bitset>
#include <cstdint>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <memory>
#include <queue>