Skip to content

Instantly share code, notes, and snippets.

View suzuken's full-sized avatar

Kenta SUZUKI suzuken

View GitHub Profile
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
<?php
// 教室に二人一組で座ることのできるテーブルが10台あり、生徒が20人いる時、 生徒の座席の位置をランダムに決定するプログラムをPHPで書きなさい。
// 生徒名やテーブル名等の情報は任意に定義してかまいません。
// 出力例. テーブル名をA~Jのアルファベットとし 生徒名を1~20の数字として表しています
// A - 6, 19
// B - 1 ,4
// C - 20,8
<F3>%define rubyver 2.1.4
%define _prefix /opt/ruby21
Name: ruby
Version: %{rubyver}
Release: 2%{?dist}
License: Ruby License/GPL - see COPYING
URL: http://www.ruby-lang.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline readline-devel ncurses ncurses-devel gdbm gdbm-devel glibc-devel tcl-devel gcc unzip openssl-devel db4-devel byacc make libyaml libyaml-devel libffi libffi-devel
@suzuken
suzuken / gist:36e6178f091c59446e9f
Created December 15, 2014 02:06
td-agent2でfluent-plugin-td-monitoringがエラー入ってるっぽい
2014-12-15 10:53:03 +0900 [error]: unexpected error error_class=NoMethodError error=#<NoMethodError: undefined me
thod `[]=' for nil:NilClass>
  2014-12-15 10:53:03 +0900 [error]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-td-monitoring-
0.1.3/lib/fluent/plugin/fms_fluentd_ext.rb:70:in `get_plugin_metric'
  2014-12-15 10:53:03 +0900 [error]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-td-monitoring-
0.1.3/lib/fluent/plugin/fms_fluentd_ext.rb:50:in `get_monitor_info'
  2014-12-15 10:53:03 +0900 [error]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.10.55/lib/fluent/p
lugin/in_monitor_agent.rb:287:in `block in plugins_info_all'
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
func Walk(t *tree.Tree, ch chan int) {
WalkIter(t, ch)
close(ch)
package main
import (
"fmt"
)
func a(){
i := 0
// 引数iはdeferred functionが評価される際に評価される
package main
import (
"fmt"
"runtime"
"sync"
"sync/atomic"
)
var v int32
// original: http://mattn.kaoriya.net/software/lang/go/20140625223125.htm
package main
import (
"fmt"
"runtime"
"sync"
"time"
)
package main
import (
"fmt"
"io/ioutil"
)
func main() {
err := ioutil.WriteFile("/tmp/hoge", []byte("testtest"), 0777)
if err != nil {