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 ( | |
"log" | |
"net/http" | |
"os" | |
"path" | |
) | |
func main() { |
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 multiprocessing | |
import time | |
""" | |
multiprocessing.Poolのchunkってどんな感じよー? | |
""" | |
def square(n): |
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 ( | |
"code.google.com/p/plotinum/plot" | |
"code.google.com/p/plotinum/plotter" | |
"code.google.com/p/plotinum/plotutil" | |
"code.google.com/p/plotinum/vg" | |
"fmt" | |
"math" | |
) |
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
function! ConfirmQuit(writeFile) | |
let l:confirmed = confirm("Do you really want to quit?", "&Yes\n&No", 2) | |
if l:confirmed == 1 | |
quit | |
endif | |
endfu | |
cnoremap <silent> q<cr> call ConfirmQuit(0)<cr> |
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
from pylab import * | |
x = arange(-10,10,0.1) | |
y = 0 | |
for i in range(10): | |
y+= i*cos(i*x) | |
han = hanning(len(x)) | |
y_ = han * x |
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
from pylab import * | |
x = arange(0,1,0.001) | |
x_ = 0.5 | |
sum = 0 | |
for n in range(1, 10 ** 0 + 1): | |
sum += 2*sin(n*pi*x)*sin(n*pi*x_) | |
f1 = sum[:] |
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
let g:quickrun_no_default_key_mappingsi=1 | |
nnoremap <silent> <Leader>r :QuickRun -mode n<CR> | |
vnoremap <silent> <Leader>r :QuickRun -mode v<CR> |
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 | |
# random | |
l = pylab.random(10**4) | |
pylab.subplot(211, title="random") | |
pylab.hist(l, bins=100) | |
# random ^ 2 | |
l_ = pylab.random(10**4) |
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 | |
from scipy import special | |
import math | |
def R(n,l,a_0): | |
"""Radius """ | |
def _(r): | |
c = -(2.0/n/a_0)**(3./2.)*(math.factorial(n-l-1.)/2./n/math.factorial(n+l)**3.)**.5 | |
return c*pylab.exp(-r/n/a_0)*r**l*special.genlaguerre(n+l,2.*l+1.)(2.*r/n/a_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 pylab | |
import time | |
import math | |
def f(i): | |
pass | |
def _range(n): | |
t = time.time() | |
for i in range(n): |