Skip to content

Instantly share code, notes, and snippets.

View kimitoboku's full-sized avatar

Kento KAWAKAMi kimitoboku

View GitHub Profile
@kimitoboku
kimitoboku / 03-133136.go
Created May 3, 2014 04:40
A Tour of Go#1
package main
import (
"fmt"
)
func main(){
fmt.Println("Hello,世界");
}
@kimitoboku
kimitoboku / 03-135420.go
Created May 3, 2014 04:57
A Tour of GO#4
package main
import (
"math/rand"
"fmt"
)
@kimitoboku
kimitoboku / 03-135753.go
Created May 3, 2014 05:02
A Tour of Go#5
package main
import (
"fmt"
"math"
)
func main(){
fmt.Printf("Now you have %g problems.",math.Nextafter(2, 3))
}
@kimitoboku
kimitoboku / 03-143637.go
Created May 3, 2014 05:38
A Tour of Go#7
package main
import (
"fmt"
)
func add(x int,y int) int {
return x+y
}
@kimitoboku
kimitoboku / 03-154618.go
Created May 3, 2014 06:49
A Tour of Go#10
package main
import (
"fmt"
)
func split(sum int) (x,y int){
x = sum % 10
y = sum - x
@kimitoboku
kimitoboku / 03-155859.go
Created May 3, 2014 07:00
A Tour of GO#17
package main
import (
"fmt"
)
func main() {
sum := 0
for i := 0; i < 10; i++ {
sum += i
@kimitoboku
kimitoboku / 03-161129.go
Created May 3, 2014 07:16
A Tour of Go#24
package main
import (
"fmt"
)
func Sqrt(x float64) float64 {
var z float64 = 10
for i := 0; i < 10; i++ {
z = z - (z*z-x)/(2*z)
@kimitoboku
kimitoboku / 03-165239.go
Created May 3, 2014 08:01
A Tour of Go#41
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
words := strings.Split(s, " ")
@kimitoboku
kimitoboku / logitics.py
Last active May 4, 2019 01:43
python
import matplotlib.pyplot as plt
dt = 0.01
x = 4
r = 2
k = 2
def dx(t,x):
return r*x*(1-x/k)
import scipy.integrate
import numpy as np
import matplotlib.pyplot as plt
def allee(x,t,r,a,k):
return r*x*(x-a)*(1.0 - x/k)
x0 = 18