Say 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 a...
分类:
其他好文 时间:
2014-07-09 23:32:44
阅读次数:
276
//向后匹配String a = "I paid $90 for 10 oranges, 12 pears and 8 apples. I saved $5 on "; Pattern p = Pattern.compile("(?<=\\$)\\d+"); Matcher m = p.ma...
分类:
编程语言 时间:
2014-07-09 23:18:56
阅读次数:
455
策略模式(Strategy Pattern) 具体解释本文地址:http://blog.csdn.net/caroline_wendy/article/details/26577879本文版权全部, 禁止转载, 如有须要, 请站内联系.策略模式: 定义了算法族, 分别封装起来, 让它们之间能够相互替...
分类:
其他好文 时间:
2014-07-09 23:14:08
阅读次数:
227
Bash Shell有个extglob选项。开启后Shell可以 另外识别出5个模式匹配操作符,能使文件匹配更加方便 。开启的方法:使用shopt命令:shopt -s extglob关闭的方法: shopt -u extglob开启后,以下5个模式匹配操作符将被识别:?(pattern-lis.....
分类:
其他好文 时间:
2014-07-08 23:26:36
阅读次数:
269
Android L 开发者预览支持库提供两个新的Widgets,RecyclerView和CardView。使用这两个Widgets可以显示复杂的Listview和卡片布局,这两个Widgets默认使用Material design。RecyclerView RecyclerView是一个更高级柔性版本的Listview,RecyclerView是一个能包含很多视图的容器,它能完美的处理循环...
分类:
其他好文 时间:
2014-07-08 19:12:23
阅读次数:
250
Singleton is one design pattern in the software engineering. Ruby has its own special feature to declare singleton class...
分类:
其他好文 时间:
2014-07-08 18:05:25
阅读次数:
213
访问者模式(Visitor Pattern)是GoF提出的23种设计模式中的一种,属于行为模式。
据《大话设计模式》中说算是最复杂也是最难以理解的一种模式了。
定义(源于GoF《Design Pattern》):表示一个作用于某对象结构中的各元素的操作。它使你可以在
不改变各元素类的前提下定义作用于这些元素的新操作。从定义可以看出结构对象是使用访问者模式必备
条件,而且这个结构对象必...
分类:
其他好文 时间:
2014-07-08 14:01:22
阅读次数:
156
1、org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter准备和执行
2、
struts2
/*
url-pattern约定熟成只写/*,没必要写*.action
3、
/Hello.jsp
...
分类:
Web程序 时间:
2014-07-06 11:45:18
阅读次数:
192
组合模式(composite pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy组合模式:...
分类:
其他好文 时间:
2014-07-06 10:13:41
阅读次数:
163
设计模式我觉得是前人总结的,为了解决一类问题而总结的代码设计经验。最初可能为了使用而使用,后面就会发现,很多没想到的问题因为使用了正确的设计模式已经为你考虑到了。《design patterns设计模式》这本书是程序员进阶必学。...
分类:
编程语言 时间:
2014-07-06 00:54:38
阅读次数:
245