Skip to content

Instantly share code, notes, and snippets.

@kencoba
kencoba / MultiRowsIntoOne.vb
Created December 6, 2019 02:44
ExcelVBA:Transform data from multible rows into one.
Option Explicit
Public Sub 複数行を単一行へ変換()
Dim 入力シート As Worksheet
Dim 出力シート As Worksheet
Dim 入力行 As Integer ' 入力シートのキーの行番号
Dim 入力列 As Integer ' 入力シートの値の列番号
Dim 出力行 As Integer ' 出力シートの出力行番号
Dim 出力列 As Integer ' 出力シートの出力列番号
Dim 値列数 As Integer ' 値の列数
@kencoba
kencoba / tt.py
Created April 3, 2019 05:42
Touch Typing with Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import random
def interval():
start_time = time.time()
def end_time():
return time.time() - start_time
return end_time
@kencoba
kencoba / tt.rb
Created April 2, 2019 08:47
Touch Typing with Ruby
# tt.rb
def interval ()
start_time = (Time.now.to_f * 1000).to_i
lambda {
end_time = (Time.now.to_f * 1000).to_i
end_time - start_time
}
end
@kencoba
kencoba / magic-hexagram.scm
Created July 30, 2017 12:01
Magic hexagram
(use util.combinations)
(use gauche.collection)
; Magic hexagram
;
; a
; / \
; b---c---d---e
; \ / \ /
; f g
@kencoba
kencoba / toolchains.xml
Created July 7, 2017 01:56
.m2/toolchains.xml for java-8-oracle on Ubuntu 16.04. H2Database's pom.xml needs this setting.
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
<vendor>sun</vendor>
</provides>
<configuration>
@kencoba
kencoba / .zshrc
Created July 4, 2017 00:14
Moving a word with Ctrl+Arrow.
bindkey '^[[C' forward-word
bindkey '^[[D' backward-word
@kencoba
kencoba / yohooos.asm
Last active June 28, 2017 06:44
translate nask code in the book "OS自作入門(川合秀実)" to nasm code.
; % nasm -f bin -o yohooos.img yohooos.asm -l yohooos.lst
; 川合秀実著,「OS自作入門」のコードほぼそのまま
; TAB=4
ORG 0x7c00 ; このプログラムがどこに読み込まれるのか
; 以下は標準的なFAT12フォーマットフロッピーディスクのための記述
start: JMP entry
DB 0x90
@kencoba
kencoba / helloos2.nas
Created June 19, 2017 02:50
from "OS自作入門"
; hello-os
; TAB=4
; ..\z_tools\nask.exe helloos2.nas helloos.img
DB 0xeb, 0x4e, 0x90
DB "HELLOIPL"
DW 512
DB 1
DW 1
@kencoba
kencoba / functionPointers.c
Created June 16, 2017 05:36
Variable declarations of pointer to function.
#include <stdio.h>
#include <string.h>
// func1 returns a char.
char func1()
{
return 'a';
}
// func2 returns a pointer to char.
@kencoba
kencoba / copyDirs.sh
Created June 15, 2017 07:30
copy directory tree. exclude files.
#!/usr/bin/env zsh
if [ $# -ne 2 ]; then
echo "$# args specified" 1>&2
echo "usage: sh ./copyDir.sh from_directory to_directory" 1>&2
exit 1
fi
from_dir=$1
to_dir=$2