1.substrsubstr(start,length)表示从start位置开始,截取length长度的字符串。var src="images/off_1.png";alert(src.substr(7,3));弹出值为:off2.substringsubstring(start,end)表示从st...
分类:
Web程序 时间:
2014-10-10 20:52:04
阅读次数:
186
//@"123456789" 转换后 @"123,456,789"
@interface NSString (num)
- (NSString *)money;
@end
@implementation NSString (num)
- (NSString *)money{
NSNumberFormatter *numFormat = [[NSNumberForma...
分类:
移动开发 时间:
2014-10-10 19:06:04
阅读次数:
140
头文件描述:
#ifndef GOOGLESUGGEST_H
#define GOOGLESUGGEST_H
#include
#include
#include
QT_BEGIN_NAMESPACE
class QLineEdit;
class QNetworkReply;
class QTimer;
class QTreeWidget;
QT_END_NAMESPACE
//! ...
分类:
Web程序 时间:
2014-10-10 18:38:54
阅读次数:
302
看到官方的一个例子不错,这里留记。
#import
@interface NSMutableArray (variadicMethodExample)
- (void) appendObjects:(id) firstObject, ...; // This method takes a nil-terminated list of objects.
@end
@implementat...
分类:
移动开发 时间:
2014-10-10 13:32:54
阅读次数:
227
6、chunk_split() 函数把字符串分割为一连串更小的部分。本函数不改变原始字符串。语法:chunk_split(string,length,end)参数:string——必需。规定要分割的字符串。length——可选。一个数字,定义字符串块的长度。end——可选。字符串值,定义在每个字符串...
分类:
Web程序 时间:
2014-10-10 13:22:04
阅读次数:
279
Liunx:static void Main(string[] args) { try { string[] groups = new string[] { "Admin", "Back_End", "CSharp", "Developer", "Faserati",...
分类:
其他好文 时间:
2014-10-09 23:02:21
阅读次数:
204
本题有几个注意点:
1. 回溯找路径时,根据路径的最大长度控制回溯深度
2. BFS时,在找到end单词后,给当前层做标记find=true,遍历完当前层后结束。不需要遍历下一层了。
3. 可以将字典中的单词删除,替代visited的set,这样优化以后时间从1700ms+降到800ms+
代码如下:
class Solution {
public:
vector> findLa...
分类:
其他好文 时间:
2014-10-09 20:13:57
阅读次数:
177
尽管MessageQueue提供了直接读/写的函数接口,但对于程序员来说,一般不直接读/写消息队列。之前了解到,在Looper.loop()函数中,当取出消息后,会回调msg.target对象的handleMessage()函数,而msg.target的类型正是Handler。
/**
* Run the message queue in this thread. Be sure to call
* {@link #quit()} to end the loop.
...
分类:
其他好文 时间:
2014-10-09 16:59:58
阅读次数:
243
看一下和函数相关的数据结构和方法。 数据结构 typedef?struct?LocVar
{
??TaggedString?*varname;???????????/*?NULL?signals?end?of?scope?*/
??int???????line;
}?LocVar; 局...
分类:
其他好文 时间:
2014-10-09 16:44:58
阅读次数:
183
nginx错误优化文档1.大量的TIME_WAIT的情况查看:netstat-n|awk‘/^tcp/{++S[$NF]}END{for(ainS)printa.S[a]}‘CLOSED:无连接是活动的或正在进行LISTEN:服务器在等待进入呼叫SYN_RECV:一个连接请求已经到达,等待确认SYN_SENT:应用已经开始,打开一个连接ESTABLISHED:正常..
分类:
其他好文 时间:
2014-10-09 15:28:49
阅读次数:
187