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
font color: black | |
background color: #F5F2E7 |
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
#algs4partI-class | |
def str2nums(s): | |
return [ord(x)-ord('A') for x in s.split()] | |
def nums2str(l): | |
return ' '.join(chr(x + ord('A')) for x in 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
%s |
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
%s |
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
%s |
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
> This is a Quix Command File | |
> | |
> For the syntax of this file, please refer to http://quixapp.com/syntax/ | |
> | |
@Basic commands | |
@These are the most basic commands Quix offers, but possibly also the most powerful ones. | |
a http://www.amazon.com/s/?field-keywords=%s Amazon Search | |
d http://www.google.com/search?q=define:%s Google Define a word | |
dict http://www.google.com/dictionary?langpair=en%7Cen&q=%s&hl=en&aq=f Google Dictionary for a word |
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 | |
"""(c) gorlum0 [at] gmail.com""" | |
import random | |
from sys import maxsize as inf | |
def merge_sort(A): | |
"""merge-sort which counts inversions""" | |
def merge(L, R): | |
m = len(L)-1 | |
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
#!/usr/bin/env python | |
from __future__ import division | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import optimize | |
from numpy import newaxis, r_, c_, mat, e | |
from numpy.linalg import * | |
def plotData(X, y): | |
pos = (y.ravel() == 1).nonzero() |
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 __future__ import division | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import optimize | |
from numpy import newaxis, r_, c_, mat, e | |
from numpy.linalg import * | |
def plotData(X, y): | |
#pos = (y.ravel() == 1).nonzero() |
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 numpy as np | |
import matplotlib.pyplot as plt | |
from numpy import newaxis, r_, c_, mat | |
from numpy.linalg import * | |
def featureNormalize(X): | |
X_norm = X.A | |
m = X.shape[0] |
NewerOlder