class Solution { public: vector >
permuteUnique(vector &num) { vector > result; if (num.size() path;
dfs(n...
分类:
其他好文 时间:
2014-06-29 14:09:34
阅读次数:
220
判断类型之前,先要清楚有哪些类型。(理理思路:程序由数据和方法构成,数据由简单数据和复杂数据构成)即类型有:
数据(简单数据:boolean,string,num,undefined,null。复杂数据:object),
方法(function)万能的typeof,神一样的方法 typeof(...
分类:
编程语言 时间:
2014-06-07 05:40:05
阅读次数:
309
1 #include 2 #include 3 using namespace std; 4
const int Max = 100000; 5 int num[Max]; 6 int find_[Max]; 7 bool found[Max]; 8
int pos[Max] = { 9 ...
分类:
其他好文 时间:
2014-06-07 03:49:29
阅读次数:
250
#include using namespace std;int main(){#if 1
int num = 12345; char str[25];//不要写成char*,因为没有分配空间 itoa(num, str, 10);//10进制字符串
printf("num ...
分类:
其他好文 时间:
2014-06-07 03:32:09
阅读次数:
215
一个DBA同事昨天在执行一个命令行工具的时候发现程序hang住,问题挺有意思,值得记录下。
首先用pstack看了下程序的调用栈,这是个多线程程序,pstack结果看到几乎所有的线程都等在write调用上。如下是pt-pmp的输出结果:Tue May
27 18:30:06 CST 2014 ...
分类:
其他好文 时间:
2014-05-29 13:06:39
阅读次数:
351
获取表单信息number_format()函数对指定的数字字符串进行格式化";//执行换行echo number_format($number,
2);//输出2个参数格式化后的数字字符串echo "";//执行换行$number2 = 123456.7832;//定义数字字符串常量echo num...
分类:
Web程序 时间:
2014-05-28 19:10:54
阅读次数:
429
七种qsort排序方法一、对int类型数组排序intnum[100];Sample:intcmp(constvoid*a,constvoid*b){return*(int*)a-*(int*)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同in...
分类:
其他好文 时间:
2014-05-28 16:55:43
阅读次数:
238
def meanstdev(numlist): 返回一个序列的均值和标准差;def
mindivnum(numlist,limit):找出一个整数list (numlist)的最小公倍数,寻找的范围为1~limit;def
dec2bin(num,digits):将num转化为2进制字符串,并保留低...
分类:
其他好文 时间:
2014-05-28 03:20:03
阅读次数:
212
数据类:package Thread.MyCommon;public class Data {
public int num = 0; public synchronized int getEven() { ++num;
Thread.yield();//让另...
分类:
编程语言 时间:
2014-05-28 00:36:30
阅读次数:
300
本篇从Monitor,Mutex,ManualResetEvent,AutoResetEvent,WaitHandler的类关系图开始,希望通过
本篇的介绍能对常见的线程同步方法有一个整体的认识,而对每种方式的使用细节,适用场合不会过多解释。让我们来看看这几个类的关系图: 1.lock关键字 lo....
分类:
编程语言 时间:
2014-05-26 20:14:03
阅读次数:
318