使用场景-- 通过new产生一个对象需要非常繁琐的数据准备或访问权限,则可以使用原型模式-- 就是java中的克隆技术,以某个对象为原型复制出新的对象 ,显然,新的对象具备原型对象的特点优势:效率高(直接克隆,避免了重新执行构造的过程步骤)。克隆类似于new,但是不同于new。new创建新的对象属性...
分类:
其他好文 时间:
2015-04-14 00:11:23
阅读次数:
195
#include "stdafx.h"#include #include #include #define NUM_ELECTORATE 10#define NUM_CANDIDATE 3struct candicate{char name[20];int count;}candidate[3] =...
分类:
其他好文 时间:
2015-04-14 00:13:12
阅读次数:
297
joomla-安装 下载源码 解压到apache发布目录 访问http://xxx/installation/index.php?根据实际情况访问 按每步提示操作,mysql库要先建立,ftp可暂时不开 删除安装文件即可 joomla代码结构 Joomla?2.5主要目录结...
分类:
其他好文 时间:
2015-04-13 23:10:45
阅读次数:
321
工作任务实施1.将这3块磁盘升级为动态磁盘。(截图)2.在磁盘1上创建一个简单卷,大小为10M,格式化为NTFS,卷标为E:(截图)右键未分配区域新建简单卷3.完成后,扩展E卷,由磁盘1和磁盘2各提供10M,最后E卷的大小为多少M?(截图4.在磁盘2和磁盘3上划出15M出来做镜像卷,设置..
分类:
其他好文 时间:
2015-04-13 23:07:34
阅读次数:
452
分类:
其他好文 时间:
2015-04-13 23:07:52
阅读次数:
340
4.12、创建VM模板4.12.1、克隆虚拟机导航到VM和服务à创建,选定需要克隆的虚拟机在下拉选项中,选择”克掳输入虚拟机名称以及描述硬件配置文件默认即可,点击”下一步“选择主机组,点击”下一步“选定Hyper-V主机,点击”下一步“选择VM配置的存储位置,点击“下一步“选择虚..
分类:
其他好文 时间:
2015-04-13 23:07:26
阅读次数:
397
1.题目描述:点击打开链接
2.解题思路:本题是一道模拟题。要求找出一个队列,使得队列中的每个人的握手次数符合输入的情况,如果不存在输出无解。其中每三个人可以在任何时刻组成一个队伍开始比赛,后面的人不能再与他们握手。通过手动操作与观察可以发现,如果把队列中的人的握手次数均取除以3后的余数。那么正好形成0 1 2 0 1 2....的循环序列。所以可以通过这个来模拟该过程。事先用map保存握手次数...
分类:
其他好文 时间:
2015-04-13 23:04:40
阅读次数:
236
图(Graph)
(参考资料:《大话数据结构》《算法导论》)
图是由顶点的有穷非空集合和顶点之间的边的集合组成,通常表示为:G(V,E),其中G表示一个图,V是图G中顶点(Vertex)的集合,E是图中边的集合。
图的相关术语
1.无向图与有向图
无向图:图中任意两个顶点u和v之间的边没有方向(无...
分类:
其他好文 时间:
2015-04-13 23:04:08
阅读次数:
245
Frank is a portfolio manager of a closed-end fund for Advanced Commercial Markets (ACM ). Fund collects money (cash) from individual investors for a certain period of time and invests cash into variou...
分类:
其他好文 时间:
2015-04-13 23:05:36
阅读次数:
363
当调用对象方法时,编译器都会默认传入一个指向本对象的指针。所以不同的对象都会调用到正确的成员变量。这个指针就是self,它的值就是new时在堆中分配内存的首地址。那么这个self在方法调用时是存储在栈中么?上代码调试来看一下
#import
@interface Person : NSObject
{
int _age;
}
- (void)setAge:(int)age;
- (...
分类:
其他好文 时间:
2015-04-13 23:03:36
阅读次数:
122
uva 11137 Ingenuous CubrencyPeople in Cubeland use cubic coins. Not only the unit of currency is called a cube but also the coins are shaped like cubes and their values are cubes. Coins with values of...
分类:
其他好文 时间:
2015-04-13 23:04:26
阅读次数:
155
不同网关的两个网卡配置在机房需求配置两个网卡,一个网络可以上外网(eth0),一个只固定几个ip段可以访问(eth2)。在eth0上配置了vlan trunk模式, vlan id为1004。eth2为普通的接入模式。eth0和eth2的网络是隔离的。手动添加虚拟vlanvconfig add eth0 1004
ifconfig eth0.1004 10.128.4.1 netmask 255.2...
分类:
其他好文 时间:
2015-04-13 23:03:26
阅读次数:
209
The Employee table holds all employees. Every employee has an Id, and there
is also a column for the department Id.
+----+-------+--------+--------------+
| Id | Name | Salary | DepartmentId |
+--...
分类:
其他好文 时间:
2015-04-13 23:04:15
阅读次数:
179
android自带的dialog样式一般不满足自己的要求,那就要求dialog自定义。
其实,activity也是可以以dialog的形式存在的,我们只需在清单文件中设置其theme属性即可:
android:name=".EditActivity"
android:theme="@android:style/Theme.Dialog"
...
分类:
其他好文 时间:
2015-04-13 23:02:33
阅读次数:
197
开始一直tle后来才发现少了for(int i=0;i
#include
#include
#include
#include
#include
#define maxn 505
using namespace std;
vector >mapp;
int visit[maxn][maxn];
int n,m;
int head[maxn];
int re[maxn];
void topo(...
分类:
其他好文 时间:
2015-04-13 23:05:03
阅读次数:
163
13460. Passwords
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
Mirko is an evil plotting genius and has gotten hold of a list of all possible passwords for a certa...
分类:
其他好文 时间:
2015-04-13 23:03:03
阅读次数:
241
分支操作1.查看远程分支前面带*号的代表你当前工作目录所处的分支
$ git branch -a
* br-2.1.2.2
master
remotes/origin/HEAD -> origin/master
remotes/origin/br-2.1.2.1
remotes/origin/br-2.1.2.2
remotes/origin/br-2.1.3
remote...
分类:
其他好文 时间:
2015-04-13 23:04:47
阅读次数:
136