Skip to content

Instantly share code, notes, and snippets.

Takuya Sakurai azyobuzin

Block or report user

Report or block azyobuzin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@azyobuzin
azyobuzin / TrafficLight.html
Last active Jul 15, 2019
F# で Parallel DEVS を実装したサンプル
View TrafficLight.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>TrafficLight</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@azyobuzin
azyobuzin / DftSimd.cs
Created Jun 13, 2019
DFT に SIMD を混ぜたけど速くならなかったので供養
View DftSimd.cs
public static float[] ForwardFloatSimd(IReadOnlyList<float> input)
{
if (input == null) throw new ArgumentNullException(nameof(input));
var inputArray = (float[])input; // TODO: 型検証
float[] factorVector = null;
if (Vector.IsHardwareAccelerated)
factorVector = new float[Vector<float>.Count * 2];
View Chromagram.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@azyobuzin
azyobuzin / Program.cs
Last active May 9, 2019
TPL Dataflow を使ってキューサービスに積まれたメッセージを処理するワーカーを書く例
View Program.cs
using System.Threading;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
{
var queueService = new QueueService();
var cancellation = new CancellationTokenSource();
var worker = new Worker(queueService, 2, cancellation.Token);
View AzureOCR.py
from dataclasses import dataclass
from pathlib import Path
import typing
from PIL import Image, ImageDraw
import requests
API_KEY = 'xxx'
ENDPOINT = 'https://japaneast.api.cognitive.microsoft.com/'
def get_ocr_result_path(imagefilepath):
View コード表.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View squid.conf
acl v4_privatenet dst 10.0.0.0/8
acl v4_privatenet dst 127.0.0.0/8
acl v4_privatenet dst 169.254.0.0/16
acl v4_privatenet dst 172.16.0.0/12
acl v4_privatenet dst 192.168.0.0/16
acl v6_globalunicast dst ipv6 # 2000::/3
acl ftp proto ftp
http_access deny ftp
http_access allow v6_globalunicast
View k3s-agent.service
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
After=network.target k3s-env.service
Requires=k3s-env.service
[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
Environment="K3S_TOKEN=とーくん"
View 1 起動前.txt
azyobuzin@k8stest:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 933964 0 933964 0% /dev
tmpfs 192920 796 192124 1% /run
/dev/sda2 32378672 4103044 26607840 14% /
tmpfs 964588 0 964588 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 964588 0 964588 0% /sys/fs/cgroup
/dev/loop0 88704 88704 0 100% /snap/core/4486
/dev/sda1 523248 6152 517096 2% /boot/efi
View 1 インストール前.txt
azyobuzin@k8stest:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 933964 0 933964 0% /dev
tmpfs 192920 796 192124 1% /run
/dev/sda2 32378672 4009820 26701064 14% /
tmpfs 964584 0 964584 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 964584 0 964584 0% /sys/fs/cgroup
/dev/loop0 88704 88704 0 100% /snap/core/4486
/dev/sda1 523248 6152 517096 2% /boot/efi
You can’t perform that action at this time.