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 ( | |
"container/heap" | |
"fmt" | |
) | |
type PriorityQueue []*Node | |
func (this PriorityQueue) Len() int { return len(this) } |
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 lu | |
import ( | |
"fmt" | |
) | |
type Matrix [][]float64 | |
func NewMatrix() Matrix { | |
return Matrix{} |
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 ( | |
"bufio" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"sort" | |
"syscall" | |
) |
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" | |
"sort" | |
) | |
func CountDuplicateElem(x, y []string) int { | |
// fmt.Println(x) | |
// fmt.Println(y) |
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 | |
import re | |
import json | |
import numpy as np | |
import maf | |
import maflib.util | |
def configure(conf): | |
pass |
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 | |
// #cgo LDFLAGS: -L/usr/local/Cellar/mecab/0.996/lib -lmecab -lstdc++ `mecab-config --libs`で得られる結果 | |
// #cgo CFLAGS: -I/usr/local/Cellar/mecab/0.996/include `mecab-config --cflags`で得られる結果 | |
// #include <mecab.h> | |
import "C" | |
// import "fmt" | |
import "strings" |
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 math import sqrt | |
>>> from sklearn.externals.joblib import Parallel, delayed | |
>>> Parallel(n_jobs=1)(delayed(sqrt)(i**2) for i in range(10)) | |
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.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
#!/usr/bin/python | |
#-*- coding:utf8 -*- | |
""" | |
DBDA FIGURE 5.1 | |
""" | |
import math | |
import numpy as np | |
from pylab import * | |
def beta(theta, a, b): |
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
('worse',) 0.52573480121 | |
('fine',) 0.5 | |
('good',) 0.188721875541 | |
('bad',) 0.188721875541 | |
('excellent',) 0.0428913353502 | |
('very',) 0.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 unicodedata | |
unicodedata.normalize('NKFC', unistr) |
NewerOlder