怎么又是工厂模式呢?上次不是讲过简单工厂模式吗?不错,此工厂模式非彼工厂模式。
工厂模式:定义一个用于创建对象的接口,让子类决定实例化那一个类,工厂方法是一个类的实例化延迟到其子类。
还是以代码来进行比较吧
1、操作接口,与简单工厂模式一样
publicabstractclass Operation {
publicdoublenumberA;
p...
分类:
其他 时间:
2014-10-29 14:57:49
收藏:
0 评论:
0 赞:
0 阅读:
143
LeetCode - Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will...
分类:
其他 时间:
2014-10-29 14:57:39
收藏:
0 评论:
0 赞:
0 阅读:
259
前面 介绍:mfc 链接 access 2007 数据库
接下来就来说说怎么插入数据到access 2007 数据库(网上找了下,说的有些模糊,直接来看看效果)
主要步骤:
1 先用sprintf生成SQL语句
2 再执行SQL语句就可以了
效果如下:
主要代码:
CString strConn,strDBName;
//serv103_serv_lin...
分类:
数据库技术 时间:
2014-10-29 14:57:29
收藏:
0 评论:
0 赞:
0 阅读:
322
Binary codes
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 5647
Accepted: 2201
Description
Consider a binary string (b1…bN) with N binary digits. Given s...
分类:
其他 时间:
2014-10-29 14:57:09
收藏:
0 评论:
0 赞:
0 阅读:
117
本人总结的一些Unity3d高频面试题目,希望可以帮助到大家。
限于个人水平有限,只附上一些参考答案。
=======================================
数据结构和算法很重要,图形学也很重要!
大的游戏公司很看重个人基础、综合能力;也有的看重你实际工作能力,看你的Demo。
高频问答的问题:
一.什么是渲染管道?
是指在显示器上为了显示出图像而...
分类:
编程语言 时间:
2014-10-29 14:56:59
收藏:
0 评论:
0 赞:
0 阅读:
329
做了个输入框样式,如图:...
分类:
Web开发 时间:
2014-10-29 14:56:49
收藏:
0 评论:
0 赞:
0 阅读:
137
RootViewController.m
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
...
分类:
其他 时间:
2014-10-29 14:56:39
收藏:
0 评论:
0 赞:
0 阅读:
240
游戏的UI开发中经常会遇到染色问题。例如按钮失效变灰的效果,同一个道具通过策划表配的颜色值染上红绿蓝紫等颜色,效果如下...
分类:
编程语言 时间:
2014-10-29 14:56:19
收藏:
0 评论:
0 赞:
0 阅读:
730
RootViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor greenColor];
//创建显示文字的label
UILabel *label = [[UILabel alloc] initWithFr...
分类:
其他 时间:
2014-10-29 14:56:09
收藏:
0 评论:
0 赞:
0 阅读:
185
【__doc__】
>>> str.__doc__ #内置文档字符串; 模块级
"str(object='') -> string\n\nReturn a nice string representation of the object.\nIf the argument is a string, the return value is the same object."
>>> str.upper.__doc__ #内置文档字符串; 函数级
'S.upper() -> string\n...
分类:
编程语言 时间:
2014-10-29 14:55:59
收藏:
0 评论:
0 赞:
0 阅读:
346
SSH分客户端openssh-client和openssh-server,如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-server。...
分类:
其他 时间:
2014-10-29 14:55:49
收藏:
0 评论:
0 赞:
0 阅读:
280
Java的类载入器
详细资料见
http://blog.csdn.net/dlf123321/article/details/40431297
首先说明两个术语
仓库(repository),表示类加载器会在哪里搜索要载入的类;
资源(resource),知道一个类载入器中的DirContext对象,它的文件跟路径指的就是上下文的文件跟路径。
在tomcat中,我们使用了自定义载入...
分类:
其他 时间:
2014-10-29 14:55:39
收藏:
0 评论:
0 赞:
0 阅读:
279
高德地图 Android SDK 可以为 Android 应用开发者提供互动的、功能丰富的 Android 手机地图。
将地图显示功能与搜索服务、定位服务分别封装为三个类库。每个类库不相互依赖,用户可以分开使用。提供 2D(栅格)和3D(矢量)地图SDK,用户根据不同的需求选择不同的类库。完美支持 Android 手机、平板电脑,可在不同屏幕尺寸下呈现完美的显示效果。地图采用矢量方法绘制,使...
分类:
其他 时间:
2014-10-29 14:55:29
收藏:
0 评论:
0 赞:
0 阅读:
261
RootViewController.h
#import "ModalViewController.h"
@interface RootViewController : UIViewController
RootViewController.m
@interface RootViewController ()
@end
@implementation RootViewContro...
分类:
其他 时间:
2014-10-29 14:55:19
收藏:
0 评论:
0 赞:
0 阅读:
199
RootViewController.m
#import "ModalViewController.h"
@interface RootViewController ()
@end
@implementation RootViewController {
ModalViewController *modalCtrl;
}
- (id)initWithNibName:(...
分类:
其他 时间:
2014-10-29 14:55:09
收藏:
0 评论:
0 赞:
0 阅读:
259
题目链接:点击打开链接
题意:
给定n个对手,至少要击败其中 l 个人,现在有口袋容量为 k
下面n个数字表示击败这个人的概率
下面n个数字(若为-1表示击败这个人可以获得一个金币,若>0则表示可以增加口袋容量为这个数字)
问:
至少击败其中的l个人,且获得的总口袋容量 >= 获得的金币个数 的概率是多少。(即任何时候金币都不能放不下)
思路:
概率dp
要注意的是有可能...
分类:
其他 时间:
2014-10-29 14:54:59
收藏:
0 评论:
0 赞:
0 阅读:
231
题目链接:点击打开链接
给定n表示有n个格子
下面每个格子为O的概率是多少。
对于一段连续 x 个O的价值就是 x*x ;
问:
获得的价值的期望是多少。
思路:
把公式拆一下。。
#include
const int N = 100005;
double dp[N][2], p[N];
int main(){
int n;
scanf("%d", &n);
fo...
分类:
其他 时间:
2014-10-29 14:54:49
收藏:
0 评论:
0 赞:
0 阅读:
265
ROM介绍
日版毒蛇2.5.0简单介绍:
*基于最新M8版本的毒蛇2.5.0
*经过本人及机友测试,功能均正常,当然不可能所有功能都测试到,如果遇到BUG请反馈
*删除国外社交、谷歌应用
*加入国行输入法,支持T9
*双新闻源,强制新闻铺满
*未替换国行音乐,因为有机友反映国行音乐封面不够清晰
*汉化毒蛇相关软件
*加入SuperS权限管理,刷机时可选
*加入新浪微信纷纷聚合界面插件,需自己安装客户端
*支持NFC,支持ART
*其他自行体验
M8 2.5...
分类:
其他 时间:
2014-10-29 14:54:39
收藏:
0 评论:
0 赞:
0 阅读:
502
Arduino Yun快速入门教程(大学霸内部资料)...
分类:
其他 时间:
2014-10-29 14:54:29
收藏:
0 评论:
0 赞:
0 阅读:
418
Alice and Bob
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2901 Accepted Submission(s): 941
Problem Description
Alice and Bob's ...
分类:
其他 时间:
2014-10-29 14:54:19
收藏:
0 评论:
0 赞:
0 阅读:
202