1. 为什么要用接口2. 工厂方法模式1. 为什么要用接口 之前的打印机程序,
open、close、print对于惠普、佳能实际上应该都是不同的, 不同的打印机, 开机、关机、打印都应该不同
所以更靠谱的是将Printer定义为interface类型1 interface Printer{2 .....
分类:
其他好文 时间:
2014-05-22 04:50:04
阅读次数:
228
题目链接 The string "PAYPALISHIRING" is written in a
zigzag pattern on a given number of rows like this: (you may want to display
this pattern in a fixed ...
分类:
其他好文 时间:
2014-05-22 01:55:19
阅读次数:
320
#include#includeusing namespace std;class
Text{public: Text():a(1){}private: int a; void display(){ cout<< "hello
world"<<endl;} friend vo...
分类:
编程语言 时间:
2014-05-22 01:04:05
阅读次数:
276
介绍一个grid layout 顺序显示的代码
LayoutAnimation1.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use th...
分类:
其他好文 时间:
2014-05-21 16:58:47
阅读次数:
214
描述list layout item有上倒下依次显示的代码实现形式
LayoutAnimation2.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may no...
分类:
其他好文 时间:
2014-05-21 09:02:15
阅读次数:
250
源码地址:点击打开链接
Android-Universal-Image-Loader的广泛使用,我们有必要好好研究下他,对于我们使用,和进步都有很多的帮助,
从架构图上看,该项目分为五大部分。
1、Displayer,显示图片模块。这部分主要作用显示图片的,包括好几种显示图片的方式,如切边显示图片等。
通过调用display(Bitmap bitmap, ImageAware ...
分类:
移动开发 时间:
2014-05-21 08:48:44
阅读次数:
361
介绍list item倒序显示
LayoutAnimation3.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file e...
分类:
其他好文 时间:
2014-05-21 08:25:44
阅读次数:
278
POSIX共享内存相关函数:
shm_open函数
功能:用来创建或打开一个共享内存对象
原型
int shm_open(const char *name, int oflag, mode_t mode);
参数
name:共享内存对象的名字
oflag:与open函数类似,可以是O_RDONLY、O_RDWR,还可以按位或上O_CREAT、O_EXCL、O_T...
分类:
其他好文 时间:
2014-05-21 07:38:19
阅读次数:
324
POSIX消息队列相关函数:
mq_open函数
功能:用来创建和访问一个消息队列
原型
mqd_t mq_open(const char *name, int oflag);
mqd_t mq_open(const char *name, int oflag, mode_t mode, struct mq_attr *attr);
参数
name: 某个消息队列...
分类:
其他好文 时间:
2014-05-21 06:35:08
阅读次数:
316
在实际的项目中,我们经常要得到当前屏幕的分辨率,进行机型适配,得到分辨率其实很简单,主要有两种方法。方法一:Display mDisplay =
getWindowManager().getDefaultDisplay();int W = mDisplay.getWidth();int H = mD...
分类:
移动开发 时间:
2014-05-21 03:48:13
阅读次数:
233