1.virtual 函数版本
class GameCharacter{
public:
virtual int healthValue() const; //返回人物的健康指数, derived classes 可重新定义它
};
2.使用 non-virtual interface 手法,那是 Template Method 设计模式的一种特殊形式。
让客户通过 public non-virtual 成员函数间接调用 private virtual 函数
class GameCharacter{
pu...
分类:
编程语言 时间:
2014-07-15 22:36:18
阅读次数:
364
1、将"(332、21)luck李。"中(332、21)抽取出来同时能够 将”(23)luck李。“中的(23)抽取出来pp = re.compile('(\(\d*(、\d*)?\))')mm = pp.match(line)print mm.groups()[0]2、
分类:
编程语言 时间:
2014-07-15 08:36:10
阅读次数:
293
iOS 的单例模式 dispatch_once
有些变量只需要初始化一次(如从文件中读取配置参数,读取设备型号等等),可以使用dispatch_once来进行读取优化,保证只调用API一次,以后就只要直接访问变量即可.
WeatherClient.h
#import "AFHTTPClient.h"
@interface WeatherClient : AFHTTPClient
+(WeatherClient *)sharedClient;
@end
WeatherClient.m...
分类:
移动开发 时间:
2014-07-14 18:45:46
阅读次数:
251
场景说明:目前在CentOS版本上进行网桥br0到普通网络的配置eth0,发现如下的一个问题ifconfigbr0Linkencap:EthernetHWaddr00:0C:29:5D:07:15inetaddr:192.168.40.250Bcast:192.168.40.255Mask:255.255.255.0inet6addr:fe80::20c:29ff:fe5d:715/64Scope:LinkUPBROADCASTRUNNINGMU..
分类:
其他好文 时间:
2014-07-14 16:35:23
阅读次数:
1017
@interface MoveView : UIView{ CGPoint startPoint;}#import "MoveView.h"@implementation MoveView- (id)initWithFrame:(CGRect)frame{ self = [super i...
分类:
其他好文 时间:
2014-07-14 15:42:42
阅读次数:
157
#import "ViewController.h"@interface ViewController () @property (weak, nonatomic) IBOutlet UIImageView *imageView;@end/**// 下载进度跟进- (void)URLSession:...
分类:
其他好文 时间:
2014-07-14 14:53:15
阅读次数:
271
执行 service network restart 出现了网卡无法启动,说找到不到
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization
解决办法:
1》 修改/etc/udev/rules.d/70-persistent-net.rules文件,删除或...
分类:
其他好文 时间:
2014-07-14 13:36:10
阅读次数:
255
HDMI,全称为(High Definition Multimedia Interface)高清多媒体接口,主要用于传输高清音视频信号。HDMI引脚:HDMI有A,B,C,D,E五种引脚类型,目前市面中比较常见的就是Type A:其中 1-9都是TMDS数据传输实际上用到的引脚,分为0,1,2三组....
分类:
其他好文 时间:
2014-07-13 21:57:21
阅读次数:
341
Web ADI示例:供应商站点录入(版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处;否则请与本人联系,违者必究)原文:http://www.google.com.hk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAA&url=http%3A%2F%2Ferpwebsolutions....
分类:
Web程序 时间:
2014-07-13 15:49:04
阅读次数:
273
下列内容为本人看毕向东老师java视频教程学习笔记!JAVA GUI图形用户界面编程:Windows 操作系统提供两种操作方式: 1.GUI 2.CLI; GUI:Grahi User Interface ,图形用户界面。 特点:用图形的方式,来显示计算机操作的界面,这样更方便更直观。 CL...
分类:
编程语言 时间:
2014-07-13 13:12:39
阅读次数:
263