摘要:
import abc class BasePizza(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def get_ingredients(self): """Returns the ingredient list.""" class Calzone(BasePizza): d... 阅读全文
2017年3月29日
2017年3月28日
摘要:
class Pizza(object): def __init__(self, size): self.size = size def get_size(self): return self.size #Pizza.get_size # #Pizza.get_size() # TypeError: get_size() missing 1 ... 阅读全文
2017年3月27日
摘要:
import functools class SnareDrum(object): pass class Cymbal(object): pass class Stick(object): pass class Brushes(object): pass @functools.singledispatch def play(instrument, accessory): raise ... 阅读全文
2017年3月22日
2017年3月17日
摘要:
参数 scope The parent scope instance to be used for the modal's content. Defaults to $rootScope 阅读全文
2017年3月16日
摘要:
memoization 是指通过缓存函数返回结果来加速函数调用的一种技术。仅当函数是纯函数 时结果才可以被缓存,也就是说,函数不能有任何副作用或输出,也不能依赖任何全局状态 LRU functools 模块提供了一个LRU(Least-Recently-Used)缓存装饰器。限定了缓存的条目数,当缓 阅读全文
2017年3月15日
摘要:
(function() { angular.module('app.widgets') .directive('bsModalPlus', function($window, $sce, $modal) { return { restrict: 'A', scope: true,... 阅读全文
摘要:
UI-Router:为什么开发者都不喜欢Angular.js内置的路由 学习 ui-router 系列文章索引 阅读全文
摘要:
Using partialLoader 12_asynchronous-loading $translatePartialLoaderProvider 阅读全文
2017年3月14日
摘要:
(function() { 'use strict'; angular.module('app.widgets') .directive('confirm', ['confirm2', 'toastr', function(confirm, toastr) { return { restrict: "... 阅读全文