一、应用场景一:判断一个字符串是否符合特定的格式 案例1:判断一个字符串必须是7位整数 上面例子输出 valid。 注意:在js中, ^表示开头,如果上面的表达式 省去了 ^ ,则 如 ss1234567也是符合要求的 ,也就说只需后7位是数字即可。 而$表示结尾,如果没有 $ ,则只需前面7位是数
分类:
编程语言 时间:
2016-03-19 21:13:34
阅读次数:
200
4 关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.Bi
分类:
移动开发 时间:
2016-03-18 20:21:52
阅读次数:
299
在Xcode中突然好久没有使用真机调试了,今天使用真机的时候,出现如下的警告,并真机运行失败:The identity used to sign the executable is no longer valid.Please verify that your device's clock is proprtly set,and that your signing certificate is n...
分类:
其他好文 时间:
2016-03-17 07:10:28
阅读次数:
182
判断括号是否合法 1.用stack存入左括号“([{”,遇到相应的右括号“)]}”就退栈 2.判断stack是否为空,可以判断是否合法
分类:
其他好文 时间:
2016-03-16 20:44:38
阅读次数:
109
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t
分类:
其他好文 时间:
2016-03-15 20:29:14
阅读次数:
135
Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t =
分类:
其他好文 时间:
2016-03-13 12:44:43
阅读次数:
171
Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for the
分类:
其他好文 时间:
2016-03-13 00:28:16
阅读次数:
161
功能:复制一个文件描述符 #include <unistd.h> int dup(int oldfd); int dup2(int oldfd , int newfd); dup:不是原子操作 dup2:是原子操作 If oldfd is not a valid file descriptor, t
分类:
其他好文 时间:
2016-03-11 17:01:27
阅读次数:
186
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo
分类:
其他好文 时间:
2016-03-05 13:13:37
阅读次数:
137