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
;sample_destructive_methods | |
; | |
;名前に「!」が付いているメソッドは破壊的メソッド | |
#module destm a, b | |
#modfunc 更新! int x, int y | |
a = x | |
b = y | |
return | |
#modfunc 表示 |
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
import glob | |
if __name__ == '__main__': | |
paths = glob.glob('./*/data/*.csv') | |
cnt = 0 | |
for path in paths: | |
with open(path, 'r') as f: | |
cnt += reduce(lambda x,y: x+1, f, 0) | |
print cnt |
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
/** | |
* @name 千反田える.js | |
* @author s_hiiragi | |
* @created_date 2012/11/07 02:13 | |
*/ | |
/* Usage: | |
* | |
* node 千反田える.js {options} | |
* |
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
console.log( 'クラスベースオブジェクト指向 on JavaScript' ); | |
console.group( 'Functionを使う方法' ); | |
(function() { | |
console.group( '(1) A, B, Cクラス兼コンストラクタとクラスメソッドを定義' ); | |
console.log( 'CはBを継承, BはAを継承する' ); | |
function A() { /* 初期化処理 */ } | |
A.intro = function() { console.log('A'); }; |
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/bash | |
# カレントディレクトリのすべてのファイルのTab文字をスペースに変換するワンライナー | |
find -maxdepth 1 -type f | grep -v "\.bak$" | while read f; do expand -t 4 "$f" > "$f.bak"; mv "$f.bak" "$f"; done |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"os/exec" | |
) | |
func main() { | |
out, err := exec.Command("ls", "-l").Output() |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"io" | |
"encoding/csv" | |
) | |
func main() { |
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
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
func main() { | |
fmt.Println("Hello, playground") | |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
) | |
func main() { | |
var ( | |
boolFlag bool |
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
/* | |
* $ go run flag_sample.go -i 100 -s "strflag" 1 2 3 | |
* os.Args: [/.../os_args_sample -i 100 -s strflag 1 2 3] | |
* flag.Args: [1 2 3] | |
* b: false | |
* i: 100 | |
* s: strflag | |
*/ | |
package main |
OlderNewer