Skip to content

Instantly share code, notes, and snippets.

View ShigekiKarita's full-sized avatar
🌴
I may be slow to respond.

Shigeki Karita ShigekiKarita

🌴
I may be slow to respond.
View GitHub Profile
@kan-bayashi
kan-bayashi / make_release_note_from_milestone.py
Last active September 5, 2019 04:27
Make release note from milestone
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Create release note from milestone with PyGithub."""
import argparse
from collections import defaultdict
import github
@y2q-actionman
y2q-actionman / a_road_to_common_lisp_jp.md
Last active May 22, 2024 20:48
A Road to Common Lisp 翻訳

この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。

原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/


A Road to Common Lisp (Common Lisp への道)

これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。

@ShigekiKarita
ShigekiKarita / .spacemacs
Last active March 12, 2017 03:49
my spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@guozhou
guozhou / persistent.cpp
Last active June 13, 2023 12:37
A minimum CUDA persistent thread example.
#include <iostream>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
// GTS450 sm_21
#define NUM_SM 4 // no. of streaming multiprocessors
#define NUM_WARP_PER_SM 48 // maximum no. of resident warps per SM
#define NUM_BLOCK_PER_SM 8 // maximum no. of resident blocks per SM
#define NUM_BLOCK NUM_SM * NUM_BLOCK_PER_SM
#define NUM_WARP_PER_BLOCK NUM_WARP_PER_SM / NUM_BLOCK_PER_SM
@kylemcdonald
kylemcdonald / ffmpeg_load_audio.py
Last active June 6, 2023 03:06
Load audio from ffmpeg into Python using numpy.
import numpy as np
import subprocess as sp
import os
DEVNULL = open(os.devnull, 'w')
# load_audio can not detect the input type
def ffmpeg_load_audio(filename, sr=44100, mono=False, normalize=True, in_type=np.int16, out_type=np.float32):
channels = 1 if mono else 2
format_strings = {
np.float64: 'f64le',
@leque
leque / freer.ml
Last active September 30, 2021 07:44
Freer monad in OCaml
(*
Requirement: higher, ppx_deriving.show
*)
(*
Lightweight higher-kinded polymorphism
https://ocamllabs.github.io/higher/lightweight-higher-kinded-polymorphism.pdf
*)
open Higher
@koturn
koturn / shebang.c
Created May 18, 2013 20:29
C言語のソースファイルを実行可能にした場合、コンパイル&実行できるように細工したもの。
#if 0
src=$0
exe=${src%.*}
gcc -s -O3 -pipe -Wall -Wextra -o $exe $src && $exe $@
exit
#endif
#include <stdio.h>
#include <stdlib.h>
@belltailjp
belltailjp / simd.cpp
Created January 28, 2013 07:38
SSE,AVX組み込み関数を用いたベクトルの内積計算高速化の実験コード
#include <iostream>
#include <random>
#include <algorithm>
#include <boost/format.hpp>
#include <xmmintrin.h>
#include <immintrin.h>
#include <osakana/stopwatch.hpp>
@ichiban
ichiban / crawler.ml
Created January 13, 2013 07:48
たった20行のコードでひたすらアイドル水着画像を集める(OCamlだよ)
#!/usr/bin/env ocamlscript
Ocaml.packs := ["batteries"; "netclient"]
--
open BatPervasives
open Str
open Http_client.Convenience
let url = "http://matome.naver.jp/odai/2135350364969742801"
let pattern = regexp "<img src=\".+\".*class=\"MTMItemThumb\".*/>"