Skip to content

Instantly share code, notes, and snippets.

@koturn
koturn / sort_alpha.c
Created October 17, 2014 08:50
後輩の課題
#include <ctype.h>
#include <stdio.h>
#define BUF_SIZE 1024
#define N_ALPHA 26
#define LALPHA_TO_NR(c) (c - 'a')
#define NR_TO_LALPHA(n) (n + 'a')
#define LENGTH(array) (sizeof(array) / sizeof((array)[0]))
#define SWAP(type, a, b) \
do { \
#####
##### 環境変数
#####
# LANGの設定
export LANG=ja_JP.UTF-8
case ${UID} in
0)
LANG=C
;;
@koturn
koturn / win32.c
Last active August 29, 2015 14:14
配列プログラミング
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
static int stack[128 * 1024];
static unsigned char code[] = {
0x55, 0x56, 0x57, 0x8b, 0x74, 0x24, 0x10, 0x8b, 0x7c, 0x24, 0x14, 0x8b, 0x6c, 0x24, 0x18, 0x83,
0x45, 0x00, 0x09, 0x8b, 0x45, 0x00, 0x85, 0xc0, 0x0f, 0x84, 0x1d, 0x00, 0x00, 0x00, 0x83, 0xc5,
0x04, 0x83, 0x45, 0x00, 0x08, 0x83, 0xc5, 0x04, 0x83, 0x45, 0x00, 0x0b, 0x83, 0xc5, 0x04, 0x83,
0x45, 0x00, 0x05, 0x83, 0xed, 0x0c, 0xff, 0x4d, 0x00, 0xeb, 0xd8, 0x83, 0xc5, 0x04, 0xff, 0x75,
@koturn
koturn / Makefile
Last active June 27, 2020 18:53
簡易シェル実装
### This Makefile was written for GNU Make. ###
ifeq ($(DEBUG),true)
COPTFLAGS := -O0 -g3 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2
LDLIBS += -lssp
else
ifeq ($(OPT),true)
COPTFLAGS := -flto -Ofast -march=native -DNDEBUG
LDOPTFLAGS := -flto -Ofast -s
else
ifeq ($(LTO),true)
@koturn
koturn / 2015-02-KanColleEvent.md
Last active August 29, 2015 14:15
艦隊これくしょんの2015年の2月に行われた冬イベントのゲージ破壊時のメンバーです

2015 2月 冬イベント

E1 泊地周辺の敵潜を叩け

  • 初霜改(Lv.70)
    • 三式爆雷投射機
    • 三式水中探信儀
    • 三式水中探信儀
  • 神通改二(Lv.70)
@koturn
koturn / 2015-04-KanColleEvent.md
Last active August 29, 2015 14:20
艦隊これくしょんの2015年の4月に行われた春イベントのゲージ破壊時のメンバーです

2015 4月 春イベント

E-1 発動準備、第十一号作戦!

艦隊

  • 潮改二(Lv.75)
    • 10cm連装高角砲
  • 10cm連装高角砲
@koturn
koturn / anchorgum.md
Last active August 29, 2015 14:23
アンカーガムの最速タイムとハイスコア

アンカーガムの最速タイムとハイスコア

フリーゲーム:「アンカーガム」の最速タイムとハイスコア

各ステージの記録

ステージ番号 ステージ名 最速タイム ハイスコア
@koturn
koturn / vs
Last active January 6, 2020 01:55
Vim Scriptをコマンドラインで実行して,結果を見たいときのためのシェルスクリプトとバッチファイル
#!/bin/sh
if [ $# -lt 1 ]; then
echo 'Invalid arguments' 1>&2
echo '[USAGE]'
echo ' vs [FILE]'
exit 1
fi
for file in $@; do
if executable('sudo')
function! s:save_as_root(is_bang, filename)
if a:filename ==# ''
let l:filename = '%'
else
let l:filename = a:filename
endif
execute 'write' . a:is_bang ' !sudo tee > /dev/null ' . l:filename
endfunction
else
@koturn
koturn / .gvimrc
Last active August 29, 2015 14:25
2015/07/20の.vimrc
" ============================================================
" __ __ ____
" / /______ / /___ ___________ / __ \ _
" / //_/ __ \/ __/ / / / ___/ __ \ / / / /(_)
" / ,< / /_/ / /_/ /_/ / / / / / / / /_/ / _
" /_/|_|\____/\__/\__,_/_/ /_/ /_/ \____/ ( )
" |/
"
" The setting file for GUI only.
" ============================================================