Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@hidsh
hidsh / .Xmodmap
Created February 1, 2014 00:05
~/.Xmodmap で 右ALTと右CTRLを入れ替え
!Swap right control and right alt
remove Control = Control_R
remove Mod1 = Alt_R
keycode 105 = Alt_R
keycode 108 = Control_R
add Control = Control_R
add Mod1 = Alt_R
!$ xmodmap ~/.Xmodmap
@hidsh
hidsh / main.c
Last active August 29, 2015 14:02
lpcxpresso/Blinky for LPC810
/****************************************************************************
* $Id:: blinky.c 3634 2012-10-31 00:09:55Z usb00423 $
* Project: NXP LPC8xx Blinky example
*
* Description:
* This file contains LED blink code example which include timer,
* GPIO initialization, and clock monitoring.
*
****************************************************************************
* Software that is described herein is for illustrative purposes only
@hidsh
hidsh / closure_test.html
Created August 30, 2014 06:39
closure test on javascript
<script>
//サンプル5-1
function outer(){
var x = 0; // outerのスコープ内で変数を定義
return function (){ //この関数が「クロージャ」
alert(x); // "関数内関数"の中で、outerスコープの変数を参照。
x = (x + 1) % 2;
};
@hidsh
hidsh / get-test.html
Created August 30, 2014 06:40
civic hack osaka 2014: RESTful app on Javascript
<!DOCTYPE html>
<html>
<head>
<title>get sample</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
// send GET method
function createXMLHttpRequest() {
@hidsh
hidsh / index.html
Created August 30, 2014 12:51
civic hack osaka 2014: update google maps
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1.0, user-scalable=no">
<title>map</title>
<style>
html, body, #map-canvas {height: 97%; margin: 0; padding: 0}
table {border-collapse:collapse; margin:0; padding:0}
tr, td {margin:0; padding:0}
@hidsh
hidsh / uskbd-win7.txt
Created October 1, 2014 23:07
windows7 でUSキーボード / us keyboard on windows7
windows7 でUSキーボード
1. コントロールパネルの「システムとセキュリティ」を選択して,「デバイスマネージャー」を起動する.
2. 「次のプログラムにこのコンピュータへの変更を許可しますか?」と聞かれるので,「はい」ボタンを押す.
3. キーボードから「標準PS/2キーボード」を選択してダブルクリックする.
4. 「ドライバー」タブを選択して,「ドライバーの更新」ボタンを押す.
5. 「コンピューターを参照してドライバーソフトウェアを検索します」を選択する.
6. 「コンピューター上のデバイスドライバーの一覧から選択します」を選択する.
7. 「互換性のあるハードウェアを表示」のチェックボックスを外して,「標準PS/2 101/102キーボード」を選択して,「次へ」ボタンを押す.
8. 「ドライバーの更新警告」ダイアログが表示されるが,「はい」ボタンを押す.
@hidsh
hidsh / primary_delay_test.py
Created October 13, 2014 01:11
Python で一次遅れフィルタ
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
def primary_delay(_in, _old):
TS = 1 # sampling period[ms]
TAU = 100 # time constant[ms]
return (TS * _in + TAU * _old + TAU) / (TS + TAU)
_in = 10000
_out_old = 0
@hidsh
hidsh / primary_delay_test.rb
Created October 13, 2014 01:29
Rubyで一次遅れフィルタ
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
#
class Filter
TS = 1 # sampling period[ms]
TAU = 100 # time constant[ms]
def primary_delay(_in, _old)
return (TS * _in + TAU * _old + TAU) / (TS + TAU)
end
end
@hidsh
hidsh / primary-delay-test.el
Created October 13, 2014 02:55
Emacs Lispで一次遅れフィルタ
(defun prim-delay(in old)
(let ((TS 1) ; sampling period[ms]
(TAU 100)) ; time constant[ms]
(/ (+ (* TS in) (* TAU old) TAU) (+ TS TAU))))
(let ((out 0)
(out-old 0)
(i 0)
(in 10000))
(while (< i 1000)
@hidsh
hidsh / led0.ino
Created October 14, 2014 14:58
led blink on arduino
#define LED_PIN 12
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(500);