Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@hidsh
hidsh / test_set_merge.cpp
Created October 26, 2011 06:15
test for set and merge using STL
set<int> i1, i2, i3;
int max = 10000;
for(int i=1; i<max; i++) {
i1.insert(i*5);
i2.insert(i*10);
}
// set_union
cout << "set_union --------" << endl;
@hidsh
hidsh / bak
Created November 7, 2011 18:40
my bak for xyzzy
;;;
;;; bak
;;;
(defvar bak-max 999)
(defun bak-difference-file-p (path1 path2)
;(dbg-msgbox path1 path2)
(cond ((not (file-exist-p path1)) t)
((not (file-exist-p path2)) t)
((/= (file-length path1) (file-length path2)) t)
@hidsh
hidsh / digit
Created November 7, 2011 19:14
桁数を求める for xyzzy
(defun digit (n)
"return digit for number."
(setq n (truncate (1+ n)))
(let ((d 0))
(while (> n 1)
(setq n (/ n 10))
(incf d))
d))
;; (digit 1000)
@hidsh
hidsh / avr_vol.c
Created November 20, 2011 17:49
audio selector with digital volume(PGA2311) using ATmega88P
/*
* avr_vol.c
*
* Created: 2011/11/10 8:02:23
* Author: g
*
* desc. : audio selector with digital volume
* schem.:
* device: ATMEGA88P
* PGA2311PA
@hidsh
hidsh / mystd.h
Created November 20, 2011 17:57
my standard header file for embedded project using C.
/* mystd.h */
#ifndef __MYSTD_H__
#define __MYSTD_H__
/* types */
typedef unsigned char u1;
typedef unsigned short u2;
typedef unsigned long u4;
typedef signed char s1;
@hidsh
hidsh / hentai.reg
Created November 20, 2011 18:02
a registry file to realize my hentai-keybind under windows 7 with 101 keyboard
Windows Registry Editor Version 5.00
;
; keytop scancode
; ------------------ --------------- -----------
; src dest src dest description
; ------------------ --------------- -----------
; F15 --> R-SFT (0066 --> 0036) IME
; L-CTRL --> CAPS (001d --> 003a)
; R-CTRL --> R-ALT (e01d --> e038)
; R-CTRL --> APP (e01d --> e05d)
@hidsh
hidsh / test
Created November 23, 2011 01:13
sample of startup script for debian 6
#!/bin/sh
### BEGIN INIT INFO
# Provides: startup test
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: test for startup script.
# Description: test for startup script.
### END INIT INFO
@hidsh
hidsh / .profile
Created November 29, 2011 08:33
my simple ~/.profile
!/bin/sh
###
### variables
###
export LANG=C
#export LANG=ja_JP.UTF-8
export PC='host name'
@hidsh
hidsh / dvd_iso.vbs
Created December 1, 2011 23:24
play dvd-iso using WinCDEmu and mpc
' play dvd iso
'
' 1. mount iso (using WinCDEmu)
' 2. launch mpc
' 3. unmount iso
'
MOUNTER="""C:\Program Files (x86)\WinCDEmu\batchmnt64.exe"""
DVD_DRV="v:"
PLAYER="C:\Users\g\Dropbox\apps\MPC-HomeCinema.1.5.2.3456.x64\mpc-hc64.exe"
;;
;; write-buffer-as
;;
(provide 'write-buffer-as)
(defun write-buffer-as (new-name)
(interactive "FWrite file as: " :default0 (if (get-buffer-file-name)
(get-buffer-file-name)
(concat (get-special-folder-location :desktop)