c++ 中的template和c#的什么有点相似?先看下定义方式:template T 
myFunction(T param1,T param2...){ T result= param1; // do something return 
result; ...
                            
                            
                                分类:
编程语言   时间:
2014-05-14 03:05:27   
                                阅读次数:
332
                             
                         
                    
                        
                            
                            
                                python中的单元测试可以使用doctest,unittest完成
1.doctest的使用
(1)写入程序如下(cubetest.py):
#!/usr/bin/python
def cube(x):
	"""
	cube a number and return the result
	
	>>> cube(2)
	8
	>>> cube(3)
	27
	>>> cube(4)
	64...
                            
                            
                                分类:
编程语言   时间:
2014-05-13 23:33:19   
                                阅读次数:
491
                             
                         
                    
                        
                            
                            
                                查询当前运行进程中是否有指定进程有多种方式,下面介绍一种通过进程名获取进程号,以此来确认该进程是否在运行。
如下实例,查询当前运行进程中是否有test进程在运行。
 	char buf[200]={0};    
        system("ps -A | awk '/test/{print $1}'>result");
        FILE *fd;
        fd=popen...
                            
                            
                                分类:
系统相关   时间:
2014-05-13 08:02:55   
                                阅读次数:
409
                             
                         
                    
                        
                            
                            
                                /*
ID:kevin_s1
PROG:dualpal
LANG:C++
*/
#include 
#include 
#include 
#include 
#include 
using namespace std;
int N,S;
vector result;
bool isPalindromic(string num){
	bool flag = true;
	int len =...
                            
                            
                                分类:
其他好文   时间:
2014-05-13 06:10:09   
                                阅读次数:
312
                             
                         
                    
                        
                            
                            
                                代码如下:AndroidManifest.xml:在后面增加一行:Activity_main.xml: 
MainActivity.java:packageleihu.location01;importandroid.location.Location;importandroid.location.L...
                            
                            
                                分类:
其他好文   时间:
2014-05-12 20:27:17   
                                阅读次数:
374
                             
                         
                    
                        
                            
                            
                                原文:window.location例 
http://www.google.cn/a/201105/a564.html?a=1#aa 属性描述hash从井号 (#) 开始的 
URL(锚)host主机名和当前 URL 的端口号hostname当前 URL 的主机名href完整的 URLpathname...
                            
                            
                         
                    
                        
                            
                            
                                1、格式化字符串操作String.prototype.format = function(args) 
{ if (arguments.length>0) { var result = this; if (arguments.length == 1 
&& typeof (args) == "objec...
                            
                            
                                分类:
编程语言   时间:
2014-05-12 04:17:43   
                                阅读次数:
314
                             
                         
                    
                        
                            
                            
                                讲到http就必需要了解URI和URL
URI (uniform resource identifier)统一资源标志符;
URL(uniform resource location )统一资源定位符(或统一资源定位器);
可以理解成URL是URI的子集,URI是一抽象的标识符,URL可以理解成具体的标识符;只要是网络上的资源就能找到唯一的URL。...
                            
                            
                                分类:
移动开发   时间:
2014-05-11 06:42:37   
                                阅读次数:
444
                             
                         
                    
                        
                            
                            
                                每当Struts2爆出这样的异常,会很郁闷,原因太多了,只能一一的检查。有的说input页面没指定,有的说namespace有问题,有的说你对应的result有问题,有的说validate不通过,等等。但是在这里,我却不是,我无论如何都找不到原因,差不多花了两个钟,我无意中使用Struts2异常处..
                            
                            
                                分类:
其他好文   时间:
2014-05-10 09:04:19   
                                阅读次数:
448
                             
                         
                    
                        
                            
                            
                                /************************************************************** 
Problem: 2434 User: wangyucheng Language: C++ Result: Accepted Time:496...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 03:06:57   
                                阅读次数:
334