最近在回答StackOverflow的问题时,发现performSelector方法在Swift被去掉,Apple的注释是这个方法被去掉是因为不安全:NOTEThe performSelector: method and related selector-invoking methods are n...
分类:
其他好文 时间:
2014-07-08 22:07:46
阅读次数:
278
Method 1: Add one list into the other list.
For example, if list1is {22, 33, 44, 55} and list2 is {66, 77, 88, 99},then append(list1, list2)will change list1to {22, 33, 44, 55, 44, 66, 77, 88, 99}.
...
分类:
其他好文 时间:
2014-07-08 16:18:22
阅读次数:
196
《Think in java·第 4 章初始化和清除》
本章介绍对象的创建和消除。
4.1 用构建器自动初始化
【You can imagine creating a method called initialize( ) for every class you write.】一句话的正确解读是,你(男生)将自己想象成为女生。所以,我专门用一节 《 编程导论(Java)·2.3.6 构造器...
分类:
其他好文 时间:
2014-07-08 15:52:03
阅读次数:
223
简单工程模式:对具有相同功能的类进行抽象得到父类,这些类继承它成为子类。为了对这些功能进行选择,建立一个工厂类进行判断,其中运用一个Switch语句。
优点:结构简单、操作单一。
缺点:需要事先考虑周到,操作时需准确。由下的“功能扩展”中可知,易违背设计模式六大原则中的“开放-封闭原则”。
功能扩展:若增添功能方法,则需另添加一个类,在运算类中添加的相应的方法,再修改客户端中的Switch语句中的case项。
工厂方法模式(Factory Method):先建立一个...
分类:
其他好文 时间:
2014-07-08 14:34:46
阅读次数:
211
Method 4: Gets the value of element number i
For example, if list is {22, 33, 44, 55, 66, 77, 88, 99}, then get(list, 2) will return 44.
Solution 1:
static int get(Node list, int i) {
if (i < 0) ...
分类:
其他好文 时间:
2014-07-08 14:07:52
阅读次数:
262
??
// TODO Auto-generated method stub
//获取本地主机IP对象
InetAddress ip = InetAddress.getLocalHost();
System.out.println(ip.getHostAddress());
System.out.println(ip.getHostName());
//获取其他主...
分类:
编程语言 时间:
2014-07-08 12:58:09
阅读次数:
278
/****************************************************************** find the biggest x number in a sequence* the basic method is the same as the Quic....
分类:
其他好文 时间:
2014-07-06 13:12:01
阅读次数:
176
action学习笔记2-有关于action method的讨论
Action执行的时候并不一定要执行execute方法,可以在配置文件中配置Action的时候用method=来指定执行哪个方法
也可以在url地址中动态指定(动态方法调用DMI)(推荐)
方法一
//方法一
/user_add_success.j...
分类:
Web程序 时间:
2014-07-06 08:54:22
阅读次数:
213
Description: Given two strings, write a method to decide if one is a permutation of the other.We could use the same idea from CTCI 1.1. The only diffe...
分类:
其他好文 时间:
2014-07-05 21:43:01
阅读次数:
231
struts2上传图片的过程1、写一个上传的jsp页面upload_image.jsp,内容如下: 解析:A、 form里面的method必须是post,enctype="multipart/form-data"上传文件必须这样写 B、这个是图片格式或者大小出...
分类:
其他好文 时间:
2014-07-05 20:59:18
阅读次数:
218