Skip to content

Instantly share code, notes, and snippets.

View suzuken's full-sized avatar

Kenta SUZUKI suzuken

View GitHub Profile
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
ret := make(map[string]int)
words := strings.Fields(s)
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
i1 := 0
i2 := 1
return func() int {
package main
import "fmt"
func Cbrt(x complex128) complex128 {
var z complex128 = 1
for i:=0; i < 10000000; i++ {
z = z - ((z * z * z - x) / 3 * z * z)
}
return z
package main
import (
"fmt"
"math"
)
type ErrNegativeSqrt float64
func (e ErrNegativeSqrt) Error() string {
package main
import (
"fmt"
"net/http"
)
type String string
type Struct struct {
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type Image struct{}
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