This file contains 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
NB. ガンマ関数。gamma x = Γ(x) | |
gamma =: ! @ <: | |
NB. ベータ関数。 x B y = B(x, y) | |
beta =: * & gamma % gamma @ + | |
NB. 不完全ベータ関数。a b incomplete_beta x = B(x;a,b) | |
NB. H.で一般化超幾何級数を求められるらしい cf. http://www.jsoftware.com/jwiki/Vocabulary/hcapdot | |
incomplete_beta =: dyad define | |
'm n' =. x |
This file contains 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
NB. Amachang's prototype-based OOP example in J | |
NB. http://d.hatena.ne.jp/amachang/20061019 via http://blog.livedoor.jp/dankogai/archives/50666398.html | |
animal =. conew 'z' | |
breath__animal =: verb define | |
echo 'すーはー' | |
) | |
NB. 鳥さんのプロトタイプ |
This file contains 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
NB. SELF's BankAccount example in J | |
NB. http://sumim.no-ip.com/wiki/849 | |
bankAccount =. conew 'z' | |
dollars__bankAccount =: 200 | |
NB. Not present in the original code. Defined a getter to make it customizable. | |
getDollars__bankAccount =: verb define | |
dollars |
This file contains 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 '''') | |
) |
This file contains 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 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 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 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 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 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 |
OlderNewer