有时我们用数据库存储文件,需要用到二进制字段,下面列常用方法。 1.写二进制数据 sqlite3 *
db; int result; char **errmsg =NULL; result = sqlite3_open("test.db", &db );
if( result != SQLITE_O...
分类:
数据库 时间:
2014-05-14 02:45:00
阅读次数:
371
#include #include #include using namespace
std;int main(){ double x1,y1,x2,y2; double result; while
(cin>>x1>>y1>>x2>>y2) { result ...
分类:
其他好文 时间:
2014-05-14 02:02:49
阅读次数:
242
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
/*
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
我发了一个wine的补丁,实现complex::pow的部分重载:http://source.winehq.org/patches/data/104267
HongQian帮我在irc上问了Piotr对这个补丁的看法,他说:
“it generally looks ok but it's possible to implement it with better
precision, so I...
看到很多程序都是根据CPU个数来创建线程个数,当时很不理解他们之间的关系,咨询了项目组的同事后才有了大致了解。1.相关系统函数下面的函数可以通过man命令查询到。SYNOPSIS
#define_GNU_SOURCE
#include<pthread.h>
intpthread_setaffinity_np(pthread_tthread,size_tc..
分类:
编程语言 时间:
2014-05-13 04:08:00
阅读次数:
450
exec:在bash下输入manexec,找到exec命令解释处,可以看到有”Nonewprocessiscreated.”这样的解释,这就是说exec命令不产生新的子进程。那么exec与source的区别是什么呢?exec命令在执行时会把当前的shellprocess关闭,然后换到后面的命令继续执行。1.系统调用exec是以新的进..
分类:
其他好文 时间:
2014-05-13 03:42:19
阅读次数:
1834
下面是HTML文件用于上传3个文件
ACTION="Upload.asp">
Image
Text
Source Code
Archive
上传程序(Upload.asp):
Set Upload = Server.CreateObject("Persits.Upload.1")
...
分类:
其他好文 时间:
2014-05-13 00:21:11
阅读次数:
270