Skip to content

Instantly share code, notes, and snippets.

View mmisono's full-sized avatar
🌀

Masanori Misono mmisono

🌀
View GitHub Profile
if has('conceal')
function! s:concealJavaDocTags()
syn clear javaDocTags
syn clear htmlTag
syn clear htmlEndTag
syn clear htmlSpecialChar
syn clear htmlLink
syn clear htmlBold
syn clear htmlBold
syn clear htmlBoldUnderline
#!/usr/bin/env python
import networkx as nx
import matplotlib.pyplot as plt
import math
from random import random
from numpy import arange
N = 1000
K = 5
0.0001 0.3300000000000001 1.0 1.0
0.0002 0.3100000000000001 0.51 0.5889040873015873
0.00030000000000000003 0.3100000000000001 0.88 0.8929547222222222
0.0004 0.3000000000000001 0.92 0.9251354761904761
0.0005 0.2900000000000001 0.75 0.6505686507936508
0.0006000000000000001 0.3100000000000001 0.45 0.4997410317460317
0.0007 0.3300000000000001 0.52 0.5087500396825397
0.0008 0.3200000000000001 0.99 0.7630045634920635
0.0009000000000000001 0.2700000000000001 0.33 0.40667162698412695
0.001 0.35000000000000014 0.53 0.7185728174603174
0.0001 1.0 1.0
0.0002 0.7438294444444443 0.9992696969696968
0.00030000000000000003 0.5835689285714285 0.9981462121212117
0.0004 0.6196489285714285 0.9979295454545453
0.0005 0.9701661111111111 0.9993098484848484
0.0006000000000000001 0.6872613492063491 0.9982545454545454
0.0007 0.600014246031746 0.9977128787878784
0.0008 0.9933286904761904 0.9993098484848487
0.0009000000000000001 0.7630985714285713 0.9996348484848485
0.001 0.4252653174603175 0.9948037878787875
import networkx as nx
import matplotlib.pyplot as plt
from random import random,randint
N = 1000
K = 5
TMAX = 2
def make_small_world_network(n,k,p):
assert p >= 0 and p <=1, "p is reconnect probability"
import networkx as nx
import matplotlib.pyplot as plt
from random import random,randint
N = 1000
K = 5
TMAX = 2
def make_small_world_network(n,k,p):
assert p >= 0 and p <=1, "p is reconnect probability"
import networkx as nx
import matplotlib.pyplot as plt
from random import random,randint
N = 1000
K = 5
def make_small_world_network(n,k,p):
assert p >= 0 and p <=1, "p is reconnect probability"
assert n > 0, "n is num nodes"
"fetch lyrics from lyrics.wikia.com
function! s:fetch_lyrics_from_lyricswiki(artist,title)
let artist = webapi#http#encodeURI(a:artist)
let title = webapi#http#encodeURI(a:title)
let url = "http://lyrics.wikia.com/api.php?action=lyrics&fmt=xml&".
\"func=getSong&artist=".artist."&song=".title
let r = webapi#http#get(url)['content']
if r =~ "<lyrics>Not found</lyrics>"
return []
endif
augroup ColorColumn
autocmd!
augroup END
function! s:startChangeCC()
autocmd ColorColumn CursorMoved * call s:changeColorColumn()
autocmd ColorColumn CursorMovedI * call s:changeColorColumn()
endfunction
function! s:endChangeCC()
function! s:SID()
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfunction
let s:SID_PREFIX = s:SID()
delfunc s:SID
function! s:convertLocalFunc(funcname)
return printf('<SNR>%d_%s', s:SID_PREFIX, a:funcname)
endfunction