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
继承asynctask,有三个参数
三个参数的含义是第一个表示输入参数,第二个为progress,表示当前的进度,第三个为doInbackground
返回值
需要一个参数传入url,返回一个result结果,如果没有网络则返回空
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Li...
分类:
移动开发 时间:
2014-05-13 07:47:33
阅读次数:
406
#!/bin/bash
if [ $# -ne 2 -a $# -ne 1 ] ;then
echo "usage: `basename $0 ` [n] input file "
echo
exit
fi
if [ $# -eq 1 ];then
I_TOP=10
I_FILE=$1
fi...
分类:
系统相关 时间:
2014-05-13 06:21:24
阅读次数:
454
/*
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
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
开发网站时,经常需要网站中有上传文件的功能,上传文件的功能有两种:将文件名称保存到数据库,文件保存到服务器指定位置;将文件直接保存到数据库中 该方法介绍
将文件以二进制的形式保存到数据库中 (可以保存word文档,记事本文本,图片,压缩包……) if (this.Fi...
分类:
数据库 时间:
2014-05-12 00:40:15
阅读次数:
325
C#修改文件或文件夹的权限,为指定用户、用户组添加完全控制权限 //给Excel文件添加"Everyone,Users"用户组的完全控制权限
FileInfo fi = new FileInfo(excelPath);
System.Security.AccessControl.FileSecurity fileSecurity...
分类:
其他好文 时间:
2014-05-11 21:46:53
阅读次数:
377
右键单击任务栏右下角的网络图标,打开“网络管理设置”(或者打开“网络连接)点击添加>>无线输入链接名称:如Wi-Fi无线:SSID(就是你共享出热点的名称),如:shirley_wifi无线安全:安全>>个人WPA/WPA2
然后输入你的热点密码IPv4地址:方法:分享IPv6地址:方法:已禁用点击...
分类:
其他好文 时间:
2014-05-11 16:36:55
阅读次数:
339