There is another solution for customizing the appearance of the preferences.Design a normal XML layout with buttons or whatever you want to add to the...
分类:
其他好文 时间:
2014-07-14 00:47:37
阅读次数:
306
ay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at...
分类:
其他好文 时间:
2014-07-13 23:22:16
阅读次数:
294
代理设计模式,这个模式很多用于服务器客户端之类的,上网也经常使用代理之类的,想起来感觉是很复杂的,不过这个设置模式本身是很简单的。
就是一个类调用另外一个类的函数,客户调用的是一个类,而实际的工作是由另外一个类做的。
体现这个设计模式的代码:
#include
class RealObj
{
public:
virtual void handleReq() = 0;
};...
分类:
其他好文 时间:
2014-07-13 17:30:48
阅读次数:
188
本文介绍如何创建自定义通知以及使用可穿戴UI库来创建自定义布局,同时还需要了解可穿戴设计准则(Wear Design Principles)。
除了屏幕尺寸和瞬读能力(Glance ability)外,为可穿戴应用创建布局大体和普通手机一样。...
分类:
移动开发 时间:
2014-07-13 17:25:03
阅读次数:
284
grep、egrep和正则表达式的总结一、grep的使用1.grep的解释grep为globalsearchregularexpression(RE)andprintouttheline的缩写,即根据用户指定的文本搜索模式对目标文件进行搜索并显示能够被模式匹配到的行的一种文本搜索工具。2.grep的使用格式gerp[options]‘PATTERN‘file,....
分类:
其他好文 时间:
2014-07-13 14:23:22
阅读次数:
194
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You ma...
分类:
其他好文 时间:
2014-07-13 13:55:14
阅读次数:
305
状态模式(state pattern) 未使用状态模式 详解本文地址: http://blog.csdn.net/caroline_wendy状态模式可以控制状态的转换, 未使用设计模式时, 程序会非常繁杂.具体方法:1. 状态转换/**
* @time 2014年7月11日
*/
package state;
/**
* @author C.L.Wang
*
*/
public cl...
分类:
其他好文 时间:
2014-07-12 23:32:37
阅读次数:
243
访问者模式,就是我们已经有一系列的对象了,那么就可以使用一个visitor对象一次性遍历所有的对象,就好像这个visitor访问了所有这些对象一样,所以就叫访问者模式。
实现起来也很简单,就是三个基类,其他类都是这些基类的衍生类。
下面的Action类就是访问者类了,而Person类就是被访问的对象类,而House是一个接待容器,可以接待不同的Action类。
#include
#incl...
分类:
其他好文 时间:
2014-07-12 22:22:16
阅读次数:
205
代理模式(proxy pattern) 未使用代理模式 详解本文地址: http://blog.csdn.net/caroline_wendy部分代码参考: http://blog.csdn.net/caroline_wendy/article/details/37698747如果需要监控(monitor)类的某些状态, 则需要编写一个监控类, 并同过监控类进行监控.但仅仅局限于本地, 如果需要远...
分类:
其他好文 时间:
2014-07-12 19:34:23
阅读次数:
343
应用程序不一定要自己去提供数据,有现成的数据学会去用才好。
网络很大,各种搜索引擎每天到处爬。本文通过正则表达式抓取网站的数据来做一个小词典。
一、正则表达式的使用
1. 确定匹配方案,即pattern
2. 用pattern实例化NSRegularExpression
3. 用匹配方法开始匹配。
匹配一次:可以使用firstMatch方法
匹配多次:可以用matchs方法...
分类:
移动开发 时间:
2014-07-12 18:48:51
阅读次数:
314