This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'strscan' | |
| =begin | |
| http://parametron.blogspot.jp/search/label/Christopher%20Strachey%E3%81%AEGPM | |
| program = token* | |
| token = argexpansion | macrocall | literal | constant | |
| literal = [^$;<>,]+ | |
| argexpansion = ~ \d+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 引数で渡された Windows 実行形式ファイルの Machine タイプを判別する | |
| // http://dsas.blog.klab.org/archives/51752824.html | |
| // | |
| #if !defined(UNICODE) | |
| #define UNICODE | |
| #define _UNICODE | |
| #endif | |
| #include <windows.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node | |
| attr_accessor :value, :left, :right | |
| def initialize(val) | |
| @value = val # ノードが保持する値 | |
| @left = nil # 左側のノード | |
| @right = nil # 右側のノード | |
| end | |
| end | |
| # 描画に必要な情報を計算 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo %~s1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @if "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%" EQU "x86" ( | |
| @echo truly x86 | |
| ) else ( | |
| @echo x64 | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # MIT License. @snipsnipsnip | |
| """ | |
| 混汞器/アマルガメータ (Konkohki/amalgamator): #include-only dumb C Preprocessor | |
| Sqliteのamalgamationみたいなことをするツール。 | |
| (本家を見るなら tool/mksqlite3c.tcl 参照) | |
| つまり、#includeだけを部分的に実行するCプリプロセッサ。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # taken from http://unix.stackexchange.com/questions/35292/quickly-find-which-files-belongs-to-a-specific-inode-number | |
| if [ "$1" ] && [ "$2" ]; then | |
| exec sudo debugfs -R "ncheck $2" "$1" 2> /dev/null | |
| else | |
| echo "usage: $0 device inode-number" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo ruby lvbar.rb | |
| /dev/sda0 | |
| [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] | |
| a: vg_foo/lv_bar (54%) | |
| b: (unallocated) (46%) | |
| /dev/sda1 | |
| [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] | |
| a: vg_foo/lv_baz (100%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coclass 'NameValueTable' | |
| PREFIX =: 'ENTRY' | |
| NB. =: Indirectly Used Copula. http://www.jsoftware.com/help/dictionary/d001.htm | |
| set =: dyad define | |
| (PREFIX , x) =: y | |
| ) | |
| NB. ~ as Evoke. http://www.jsoftware.com/help/dictionary/d220n.htm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coclass 'attr' | |
| attr_reader =: monad define | |
| loc =. > coname '' | |
| names =. ;: y | |
| dup =. ((# names) & $) & < | |
| fullnames =. names ,. dup ('_' , loc , '_') | |
| ". joinstring"1 (dup 'get_') ,. fullnames ,. (dup '=: 3 : ''') ,. names ,. (dup '''') | |
| ) |