This file contains hidden or 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
Show hidden characters
{ | |
"color_scheme": "Packages/User/SublimeLinter/Oceanic - Eighties (SL).tmTheme", | |
"fade_fold_buttons": false, | |
"font_size": 10, | |
"highlight_line": true, | |
"ignored_packages": | |
[ | |
], | |
"jshint_options": | |
{ |
This file contains hidden or 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(global) { | |
global.Functor = function(conf) { | |
Functor.types[conf.key] = { | |
obj: conf.obj, | |
fmap: conf.fmap | |
}; | |
}; | |
Functor.types = {}; |
This file contains hidden or 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(global) { | |
var types = function(obj) { | |
throw new TypeError("fmap called on unregistered type: " + obj); | |
}; | |
// inefficient as hell, but as long as there aren't too many types.... | |
global.Functor = function(type, defs) { | |
var oldTypes = types; | |
types = function(obj) { | |
if (type.prototype.isPrototypeOf(obj)) { |
This file contains hidden or 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
class Desc(object): | |
def __get__(self, obj, klass): | |
return lambda x: x+1 | |
class Desc2(object): | |
def __get__(self, obj, klass): | |
print "getting from Desc2" | |
return lambda: obj.name + " guo" | |
class A(object): |
This file contains hidden or 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
%%latex | |
$\lim\limits_{x \to 1} \frac{x^2-1}{x-1}$ | |
$\frac{\sum\limits_{s \in S}^{n} s^2}{\sum\limits_{p \in P} p^2}$ |
This file contains hidden or 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
class Desc(object): | |
def __get__(self, obj, klass): | |
return lambda x: x+1 | |
class Desc2(object): | |
def __get__(self, obj, klass): | |
print "getting from Desc2" | |
return lambda: obj.name + " guo" | |
class A(object): |
This file contains hidden or 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 *doStuff(){ | |
yield 1; | |
yield 2; | |
yield *doStuff(); | |
} | |
var it = doStuff(); | |
var res; | |
res = it.next(); |
This file contains hidden or 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
var graph = 'graph.json' | |
var w = 960, | |
h = 700, | |
r = 10; | |
var vis = d3.select(".graph") | |
.append("svg:svg") | |
.attr("width", w) | |
.attr("height", h) |
This file contains hidden or 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
r = np.random.randn(1000) | |
x = range(1000) | |
tab = pd.DataFrame({"x":x, "r": r}) | |
count, division = np.histogram(tab['r'], bins=100) | |
tab['r'].hist(bins=100) |
OlderNewer