Skip to content

Instantly share code, notes, and snippets.

@euske
euske / c_pointer_exercises.c
Created June 19, 2020 03:27
C Pointer Exercises for Beginners
/*
C Pointer Exercises for Beginners
by Yusuke Shinyama
*/
#include <stdio.h>
int main(int argc, char **argv)
{
struct foo {
@euske
euske / bashrc_minimum.sh
Last active June 11, 2020 04:15
Bare minimum bashrc (no external dependency)
# -*- shell-script -*-
##
## Minimum .bashrc for euske
##
# Do nothing if not interactive.
[[ -z "$PS1" ]] && return
# Shell options.
IGNOREEOF=10
@euske
euske / there-are-no-small-changes.md
Created June 3, 2020 04:16
「ささいな仕様変更なんてものはない」 "There are no small changes" by Des Traynor

ささいな仕様変更なんてものはない (There are no small changes)

Des Traynor

https://blog.intercom.com/there-are-no-small-changes/

「...この製品レビューを書き込む欄の文字列を140字に制限したいんだ。 なぜならある時点で通信手段としてSMSを使わせるかもしれないから。 こんな仕様変更は簡単だよね?」

@euske
euske / death-of-optimizing-compiler.md
Last active June 3, 2020 04:19
「最適化コンパイラの死・抄訳」 (Death of Optimizing Compiler) Daniel J. Bernstein

究極のガベージコレクション

https://groups.google.com/forum/message/raw?msg=comp.lang.ada/E9bNCvDQ12k/1tezW24ZxdAJ

この人が、あるミサイル制御装置の組み込みプログラムをコンサルティングしていたときのこと。 明らかにメモリリークしそうな箇所が多数あるのを見て、統括責任者に問い合わせたところ 「そりゃもちろんリークするさ」との返事。この制御プログラムはある一定時間までしか 走らないことが保証されているので、彼らはそこから逆算してリークしても大丈夫なだけのメモリを確保しておき、 あとはプログラマが手を下す必要のない「究極のガベージコレクション」にまかせた、という話。

@euske
euske / openssh-is-written-by-monkeys.md
Last active January 13, 2023 05:35
OpenSSL はサルが書いたに決まってる (OpenSSL is written by monkeys, by Marco Peereboom)

ベイズ確率に関する覚え書き

「ベイズ確率」「事前確率」「事後確率」という用語がなんとなくピンとこない人に

まず、確率の主観性について

すべての確率モデルは主観的なものであり、 したがって確率も主観的な数値である。

たとえば、コインを投げて表が出る確率を考えてみよう。

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef int T;
typedef struct {
T* objs;
size_t nobjs;
size_t maxobjs;
@euske
euske / precrecl.svg
Created April 14, 2020 06:38
False Positive and False Negative
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@euske
euske / download_slack.py
Created March 8, 2020 07:19
Download Slack channel histories.
#!/usr/bin/env python
#
# Download Slack channel histories.
#
# Prerequisites:
# 1. Create a Slack app.
# 2. Give the app the following OAuth & Permissions:
# channels:read, channels:history, users.profile:read
# 3. Install the app & get OAuth token:
# "xoxp-..."