Next challenges: Android Unlock Patterns Maximum XOR of Two Numbers in an Array Maximum Vacation Days 思路:动态规划。 两种分解方法: count[i]表示的是i的二进制表示中1的个数。 1.cou ...
分类:
其他好文 时间:
2018-01-15 00:19:29
阅读次数:
191
http://flask.pocoo.org/docs/0.12/patterns/appfactories/ flask 文档关于工厂模式里面提到了上面的这种套路。 It ’ s preferable to create your extensions and app factories so t ...
分类:
移动开发 时间:
2018-01-13 21:02:33
阅读次数:
684
Description 农夫John发现他的奶牛产奶的质量一直在变动。经过细致的调查,他发现:虽然他不能预见明天产奶的质量,但连续的若干天的质量有很多重叠。我们称之为一个“模式”。 John的牛奶按质量可以被赋予一个0到1000000之间的数。并且John记录了N(1<=N<=20000)天的牛奶质 ...
分类:
其他好文 时间:
2018-01-12 19:42:47
阅读次数:
184
大家看这些模式图片,是不是树?http://www.dofactory.com/net/design-patterns所有的都是树,下面都是构造定律。那些设计模式就是在研究如何构建树和如何在树上运动的。事实上应该是创建型模式、行为型模式,没有结构型模式。因为它的结构只有一个:树。如果看到了图,肯定是 ...
分类:
其他好文 时间:
2018-01-08 01:14:50
阅读次数:
137
相识 这要追溯到大二的时候,刚开始接触设计模式的时候,记得当时不知从谁哪里听说设计模式这个玩意,对我来说这是一个既陌生而又富有神秘感的词汇。 于是,在某天跑到学校的图书馆找寻相关的书籍,在网上百度了一下,听说《大话设计模式》这本书不错,于是乎便拿过来一看究竟,当时也看的也不知所云, 毕竟只是看,没有 ...
分类:
其他好文 时间:
2018-01-07 19:56:55
阅读次数:
93
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzi ...
分类:
其他好文 时间:
2018-01-06 19:59:46
阅读次数:
140
对于程序及服务的控制,本质上而言就是正确的启动,并可控的停止或退出。在go语言中,其实就是程序安全退出、服务控制两个方面。核心在于系统信号获取、Go Concurrency Patterns、以及基本的代码封装 程序安全退出 执行代码非安全写法 在代码部署后,我们可能因为服务配置发生变化或其他各种原 ...
分类:
其他好文 时间:
2017-12-29 15:08:55
阅读次数:
182
一些笔记。 strategy : facilitates the switch of the different but related algorithms/behaviors observer proxy : controls the access to the real subject ; s ...
分类:
其他好文 时间:
2017-12-29 15:03:38
阅读次数:
148
https://daniu.luogu.org/problemnew/show/P2744 滚动数组压去第一维:前i种木桶 f[j] 量取体积j最少需要几种木桶 g[j] 体积j的最优解是否使用了第i种木桶 f[j]= f[j-a[i]] + g[j-a[i]]^1 输出方案时用搜索,DP检验 g[ ...
分类:
其他好文 时间:
2017-12-29 12:28:37
阅读次数:
175
import osimport fnmatchdef is_file_match(filename, patterns): for pattern in patterns: if fnmatch.fnmatch(filename, pattern): return True return False ...
分类:
编程语言 时间:
2017-12-27 15:38:05
阅读次数:
116