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
#!/usr/bin/python | |
#coding: utf-8 | |
import timeit | |
test1 = """ | |
import itertools | |
def test1(): | |
count = itertools.count() | |
for i in count: |
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" | |
) | |
func main() { | |
ch := make(chan string) | |
go func(ch chan string) { | |
<-ch |
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" | |
"unicode/utf8" | |
) | |
func main() { | |
flag.Parse() |
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
#coding:utf8 | |
import pylab | |
import subprocess | |
import time | |
pylab.ion() | |
l = [] |
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" | |
"math" | |
"time" | |
) | |
func sum(a []int) int { | |
s := 0 |
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 System.IO | |
--constants | |
e0 :: Double | |
e0 = 6.0 | |
v1 :: Double | |
v1 = 3.0 | |
v2 :: Double | |
v2 = 3.0 | |
v12 :: Double |
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
--はーいふたり組作ってー | |
groupOf :: Int -> [a] -> [[a]] | |
groupOf 0 _ = undefined | |
groupOf n [] = [] | |
groupOf n xs = take n xs : groupOf n (drop n xs) | |
main = print $ groupOf 2 [1..11] |
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
#!/usr/bin/env python | |
import matplotlib | |
matplotlib.use("TkAgg") | |
import pylab | |
import time | |
pylab.figure(figsize = (4,3)) | |
pylab.ion() |
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
#!/usr/bin/env python | |
from scipy import optimize | |
import pylab | |
import numpy | |
num = 100000 |
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 pylab | |
import time | |
pylab.ion() | |
l = [1,2,3] | |
axis = pylab.gca() | |
for i in range(4, 100): | |
l.append(i) |