代码如下:
+ (BOOL)checkIDCard:(NSString *)sPaperId {
//判断位数
if (sPaperId.length != 15 && sPaperId.length != 18) {
return NO;
}
NSString *carid = sPaperId;
long lSumQT = 0 ;
...
分类:
移动开发 时间:
2015-08-02 01:02:50
阅读次数:
174
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represen...
分类:
其他好文 时间:
2015-08-01 23:36:18
阅读次数:
145
public class DigitalTrans { /** * 数字字符串转ASCII码字符串 * * @param String * 字符串 * @return ASCII字符串 */ public stati...
分类:
编程语言 时间:
2015-08-01 23:34:10
阅读次数:
148
今天用个测试exe调用了个dll,有个接口返回std::wstring,经调试发现挂在该函数return之后,怀疑是string不适合作为返回值,百度一番发现下面这篇解释的很详细。
STL跨平台调用会出现很多异常,你可以试试.
STL使用模板生成,当我们使用模板的时候,每一个EXE,和DLL都在编译器产生了自己的代码,导致模板所使用的静态成员不同步,所以出现数据传递的各种问题,下面是详细解释。...
分类:
其他好文 时间:
2015-08-01 23:33:39
阅读次数:
169
这篇有点长,不过干货挺多,既分析promise的原理,也包含一些最佳实践,亮点在最后:)还记得上一节讲回调函数的时候,第一件事就提到了异步函数不能用return返回值,其原因就是在return语句执行的时候异步代码还没有执行完毕,所以return的值不是期望的运算结果。Promise却恰恰要回过头来...
分类:
编程语言 时间:
2015-08-01 23:29:34
阅读次数:
159
1.重载赋值运算符函数:(具体见代码)//普通做法CMyString& CMyString::operator=(const CMyString& str){ if (this == &str) return *this; delete[] m_Pdata; m_P...
分类:
其他好文 时间:
2015-08-01 23:27:43
阅读次数:
121
用{}来创建一个object对象
name和age是obj对象的属性,getName和getAge为obj对象的成员函数
注意:属性和值之间是冒号
属性与属性之间是逗号,而不是分号!
Insert title here
var obj = {
name : "lili",
age : 12,
getName : function(){return thi...
分类:
编程语言 时间:
2015-08-01 22:10:18
阅读次数:
167
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary ...
分类:
其他好文 时间:
2015-08-01 22:08:36
阅读次数:
141
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2015-08-01 22:07:00
阅读次数:
129
Question
Implement int sqrt(int x).
Compute and return the square root of x.
My Solution
class Solution {
public:
int mySqrt(int x) {
/**
* binary search a from [0, x], where a^2 = x....
分类:
其他好文 时间:
2015-08-01 22:06:03
阅读次数:
87