先说下我对工厂模式的理解:当我们需要某个对象时,最直接的办法是看到这个对象就拿过来。但是当对象非常多的时候,找起来就很不方便。这时就需要一个中介来帮助我们取得想要的东西,这个中介就是工厂(factory)。工厂模式可分为三个分类(简单工厂模式Simple Factory、 工厂方法模式Factory...
分类:
其他好文 时间:
2014-10-05 16:32:58
阅读次数:
158
四边形优化DPTree ConstructionTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 868Accepted Submission(s):...
分类:
其他好文 时间:
2014-10-05 17:22:48
阅读次数:
132
[root@localhost ~]# vim /etc/my.cnf[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended t...
分类:
其他好文 时间:
2014-10-05 16:32:38
阅读次数:
510
[关键词] TCP IP 数据包 结构 具体解释 网络 协议一般来说,网络编程我们仅仅须要调用一些封装好的函数或者组件就能完毕大部分的工作,可是一些特殊的情况下,就须要深入的理解网络数据包的结构,以及协议分析。如:网络监控,故障排查等……IP包是不安全的,可是它是互联网的基础,在各方面都有广泛的应用...
分类:
其他好文 时间:
2014-10-05 15:59:08
阅读次数:
147
平衡二叉树又称AVL树。它或者是颗空树,或者是具有下列性质的二叉树:它的左子树和右子树都是平衡二叉树,且左子树和右子树的深度之差的绝对值不超过1。若将二叉树节点的平衡因子BF定义为该节点的左子树的深度减去它的右子树的深度,则平衡二叉树上全部节点的平衡因子仅仅可能为-1,0,1.仅仅要二叉树上有一个节...
分类:
其他好文 时间:
2014-10-05 17:55:38
阅读次数:
165
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-10-05 16:48:38
阅读次数:
193
指数型生成函数。做这题时,回去看看组合数学才知道,指数生成函数求的就是多重集合的r排列数。#include #include #include #define N 15using namespace std;struct PQ{ int p,q;};PQ c1[N],c2[N];int num[N]...
分类:
其他好文 时间:
2014-10-05 15:58:28
阅读次数:
163
生成函数简单题#include #include #include #include #define N 110using namespace std;struct Fruit{ int a,b;};Fruit num[N];int c1[N],c2[N];int main(){ int n,m; ...
分类:
其他好文 时间:
2014-10-05 17:21:38
阅读次数:
144
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdBaseComponent, IdComponent, IdTCPServer...
分类:
其他好文 时间:
2014-10-05 16:48:08
阅读次数:
313
题目链接:hdu 2871 Memory Control题目大意:模拟一个内存分配机制。Reset:重置,释放全部空间New x:申请内存为x的空间,输出左地址Free x:释放地址x所在的内存块Get x:查询第x个内存块,输出左地址解题思路:一開始全用线段树去做,写的乱七八糟,事实上仅仅要用线段...
分类:
其他好文 时间:
2014-10-05 16:31:18
阅读次数:
168
左连接:var LeftJoin = from emp in ListOfEmployeesjoin dept in ListOfDepartmenton emp.DeptID equals dept.ID into JoinedEmpDept from dept in JoinedEmpDept....
分类:
其他好文 时间:
2014-10-05 17:37:48
阅读次数:
143
【安装工具】 VS2012 Cocos2D-X 2.2.3 Python 2.7.8一、运行cocos2dx中的hello world!1、在Cocos2D-X 2.2.3目录下,点击cocos2d-win32.vc2012.sln。2、在打开的解决方案中,点击“生成解决方案”。开始编译。3、生成完...
分类:
其他好文 时间:
2014-10-05 17:20:58
阅读次数:
155
Apache Spark1.1.0部署与开发环境搭建 - Mark Lin0. 准备出于学习目的,本文将Spark部署在虚拟机中。在虚拟机中,需要安装以下软件:Ubuntu 14.04hadoop-2.4.0.tar.gzjdk-7u67-linux-x64.tar.gzscala-2.10.4.t...
分类:
其他好文 时间:
2014-10-05 16:47:28
阅读次数:
588
泛型接口使用泛型可以定义接口,在按口中定义的方法可以带泛型参数。在链表的示例中,就实现了IEnunmble接口,它定义了GetEnumeratorO方法,以返回IEnummtor。.NET为不同的情况提供了许多泛型接口,例如ICompamble、ICollection和ExtensibleObjec...
分类:
其他好文 时间:
2014-10-05 15:57:18
阅读次数:
189
[问题2014A02] 求下列 \(n\) 阶行列式的值, 其中 \(a_i\neq 0\,(i=1,2,\cdots,n)\):\[D_n=\begin{vmatrix} 0 & a_1+a_2 & \cdots & a_1+a_{n-1} & a_1+a_n \\ a_2+a_1 & 0 & \...
分类:
其他好文 时间:
2014-10-05 17:20:18
阅读次数:
190
DocumentRoot "E:\project\weigouwu" ServerName wg.cn Options FollowSymLinks AllowOverride None Order allow,deny ...
分类:
其他好文 时间:
2014-10-05 16:13:18
阅读次数:
193
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:
其他好文 时间:
2014-10-05 17:36:28
阅读次数:
213