2017-03-15から1日間の記事一覧

Golangのチャネル:ポーリング、キューイング、ワーカーの実装

http://mattn.kaoriya.net/software/lang/go/20160706165757.htm

Erlangでネットワーキングカーネルを起動する

% erl Erlang/OTP 19 [erts-8.2] [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.2 (abort with ^G) 1> net_kernel:start(['node02@192.168.100.212']). {error,{{shutdown,{failed_to_start_child,net_kernel, {'EXIT',nodis…

uArmをROSで動かす

monitorモードに入るコマンドがlなのにeになっていたのでプルリクエストを出した http://github.com/uArm-Developer/UArmForROS/pull/4

Goでチャンネルのテスト

package main import ( "fmt" "time" "math/rand" ) func Func1(ch chan int) { for{ // num := time.Duration(rand.Intn(3)) num := time.Duration(1) i := <-ch fmt.Printf("[Func1] waiting %d seconds. ",num) fmt.Printf("ch %d\n",i) time.Sleep(num*t…

Goでファイル読み込み

http://qiita.com/ikawaha/items/28186d965780fab5533d bufio.NewScanner()とscanner.Scan()を用いる package main import ( "fmt" "bufio" "os" ) func main(){ fp, err := os.Open("hoge.txt") if err != nil { panic(err) } defer fp.Close() scanner :=…