Builder模式,也就是建造者模式或者生成器模式,是GoF提出的23种设计模式的一种。 这种模式是用来隐式的创建复合对象而提出来的。 创建复合对象的过程,不在主客户端显示。 下面直接上代码。以修建房屋为例子。 1.修建房屋,我们需要实例化一个房子,房子需要能修建门、地板、墙壁等。这时候我们需要有一 ...
分类:
其他好文 时间:
2017-02-21 01:09:29
阅读次数:
288
一. 回调函数的作用 js代码会至上而下一条线执行下去,但是有时候我们需要等到一个操作结束之后再进行下一个操作,这时候就需要用到回调函数。 二. 回调函数的解释 因为函数实际上是一种对象,它可以存储在变量中,通过参数传递给另一个函数,在函数内部创建,从函数中返回结果值”,因为函数是内置对象,我们可以 ...
分类:
Web程序 时间:
2017-02-21 00:35:07
阅读次数:
156
有个哥们用c++写了个取名程序被我看到:http://www.cnblogs.com/zjutlitao/p/6402775.html @beautifulzzzz 谢了 借了他的字典,用c写了,如下: ...
分类:
其他好文 时间:
2017-02-20 22:39:29
阅读次数:
254
题目链接:http://hihocoder.com/problemset/problem/1177 我不知道python为什么,加了排序会RE?? ...
分类:
其他好文 时间:
2017-02-20 21:40:41
阅读次数:
182
package com.example.calling; import java.io.IOException; import android.app.Service; import android.content.Context; import android.content.Intent; im... ...
分类:
其他好文 时间:
2017-02-20 21:29:27
阅读次数:
159
class Solution { public: double fun(vector nums1,int n,vector nums2,int m,int k) { if(nums1.size()-n>nums2.size()-m) return fun(nums2,m,nums1,n,k); if... ...
分类:
其他好文 时间:
2017-02-20 19:03:49
阅读次数:
136
Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you ...
分类:
其他好文 时间:
2017-02-20 18:35:24
阅读次数:
162
#include int num,zu; int a[50][2]={0}; int visit[11]={0}; int data[11][11]={0}; int tou=0; int wei=1; int last; int flag=0; int k=0; int d[11][11]={0}... ...
分类:
其他好文 时间:
2017-02-20 18:26:23
阅读次数:
130
使用cookie,使用web worker,使用localeStorage和sessionStorage cookie,兼容性很好,但是大概4kb.同时,cookie可以永久存在,也可以再回话结束后结束。要就关闭标签页回话立即结束时,不要用cookie,因为它还很有可能会存在一段时间,即使是sess ...
分类:
其他好文 时间:
2017-02-20 13:50:19
阅读次数:
762
#__Author: "Skiler Hao"#date: 2017/2/15 11:06"""主要是测试和练习时间模块的使用 时间主要有字符串格式、时间戳 和 结构化时间元祖Wed Feb 15 11:40:23 20171463846400.0time.struct_time(tm_year=2 ...
分类:
编程语言 时间:
2017-02-20 13:44:32
阅读次数:
205