String对象的replace方法包含两个参数,第一个参数表示执行匹配的正则表达式,也可以传递字符串,第二个参数表示代替匹配的子字符串。 var b = s.replace("str1","str2");与search和match方法不同,replace方法不会吧字符串转换为正则表达式对象,而.....
分类:
其他好文 时间:
2015-06-07 13:43:03
阅读次数:
160
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
#include
#include
using namespace std;
string powe(int n)
{
stri...
分类:
其他好文 时间:
2015-06-07 12:39:28
阅读次数:
128
今天写了一个例子。public static void main(String[] args){SortedSet set = new TreeSet();set.add(new Person(180));set.add(new Person(175));for(Person p : set){Sy...
分类:
其他好文 时间:
2015-06-07 12:28:58
阅读次数:
111
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th...
分类:
其他好文 时间:
2015-06-07 12:28:40
阅读次数:
78
package com.test;public class TraditionalThreadSynchronized { public static void main(String [] arge){ new TraditionalThreadSynchronized().init(); }.....
分类:
编程语言 时间:
2015-06-07 12:25:32
阅读次数:
122
内容提供public class PersonContentProvider extends ContentProvider{private static final String AUTHORITY = "com.itheima28.sqlitedemo.providers.PersonConte...
分类:
其他好文 时间:
2015-06-07 12:22:36
阅读次数:
123
public class StringEqualsObject { public static void main(String[] args) { String name="Tom"; Person p=new Person(name); Syste...
分类:
编程语言 时间:
2015-06-07 12:18:45
阅读次数:
139
header_filter_by_lua ‘ ? ? ? ? t = {} ? ? ? ? if ngx.var.http_cookie then ? ? ? ? ? ? s = ngx.var.http_cookie ? ? ? ? ? ? for k, v in string.gmatch(s, "(%w+)=([%w%/%.=_-]+)") d...
分类:
其他好文 时间:
2015-06-07 11:15:25
阅读次数:
2717
set是STL中一种标准关联容器(vector,list,string,deque都是序列容器,而set,multiset,map,multimap是标准关联容器),它底层使用平衡的搜索树——红黑树实现,插入删除操作时仅仅需要指针操作节点即可完成,不涉及到内存移动和拷贝,所以效率比较高。set,顾名...
分类:
其他好文 时间:
2015-06-07 11:04:35
阅读次数:
107
python数据结构之线性表
python内置了很多高级数据结构,list,dict,tuple,string,set等,在使用的时候十分舒心。但是,如果从一个初学者的角度利用python学习数据结构时,这些高级的数据结构可能给我们以迷惑。
比如,使用list实现queue的时候,入队操作append()时间复杂度可以认为是O(1),但是,出队操作pop(0)的时间复杂度就是O(n)。
...
分类:
编程语言 时间:
2015-06-07 09:48:37
阅读次数:
270