What?Convert the interface of a class into another interface
that the clients expect. Adapter lets classes work together
that could not otherwise because of incompatible inter-
faces. ——GOF
先来个例子:...
分类:
其他好文 时间:
2015-07-29 01:04:53
阅读次数:
146
纯属吐槽。。那坑爹的题目,不过也有可能是我e文没看太仔细吧 原题目 Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 < version2 return -1, otherwise retu...
分类:
编程语言 时间:
2015-07-19 22:00:51
阅读次数:
182
原文地址:https://dzone.com/articles/catch-me-if-you-cant-do-otherwiseI don't know whether it's an anti-pattern or just a common and very popular mistake, ...
分类:
其他好文 时间:
2015-07-17 20:34:22
阅读次数:
149
using System.Net.NetworkInformation;/// /// ping the specified ip/// /// ip address, "x.x.x.x"/// if connected, return true, otherwise return falsepri...
This problem has a typical solution using Dynamic Programming. We define the state P[i][j] to be true if s[0..i) matches p[0..j) and false otherwise. ...
分类:
其他好文 时间:
2015-07-06 01:23:06
阅读次数:
97
1.定义Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn't otherwise becasue of incom...
分类:
其他好文 时间:
2015-07-01 15:43:48
阅读次数:
211
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and co...
分类:
其他好文 时间:
2015-06-22 12:30:27
阅读次数:
215
适配器模式:
将一个类的接口转换成另外一个期望的类的接口。适配器允许接口互不兼容的类一起工作。Convert the interface of a class into another interface clients expect.
Adapter lets classes work together that couldn't otherwise because of
incompati...
分类:
其他好文 时间:
2015-06-07 13:53:29
阅读次数:
169
Insert title here when 标签的输出 otherwise 标签的输出
分类:
其他好文 时间:
2015-06-02 17:32:02
阅读次数:
88
Insert title here 使用了 JNDI 属性。 没有使用 JNDI 属性。
分类:
其他好文 时间:
2015-06-02 13:04:46
阅读次数:
94