Integers1, 2, 3,...,nare placed on a circle in
the increasing order as in the following figure. We want to construct a sequence
from these numbers on ...
分类:
其他好文 时间:
2014-05-14 02:54:10
阅读次数:
354
有时我们用数据库存储文件,需要用到二进制字段,下面列常用方法。 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
之前安装svn一直不行,弄了好久,还是在线安装方便。
在Help里面点击Install from Site,然后直接图解:...
分类:
系统相关 时间:
2014-05-14 00:35:54
阅读次数:
452
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
Pat1018代码
题目描述:
There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to an...
分类:
其他好文 时间:
2014-05-13 23:27:04
阅读次数:
582
Given an array, for example, 246135, an inversion pair is the pair whose first value is larger than its second value according to the sequence from left to right, (2,1) (4,1) (4,3) (6,1) (6,3) (6,5)....
分类:
其他好文 时间:
2014-05-13 08:03:58
阅读次数:
338
继承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
三目运算来计算总页数 totalpage=sum/pagesize+sum%pagesize==0?0:1;//计算总页数,sum为总记录数
2.第page页的记录的起始位置和结束位置分别为:
pagesize*(page-1)+1;起始位置
pagesize*page;j、结束位置
注:
1.可以使用差集(minus)在数据库查询中实现分页,但效率低'
2.常用子查询将rownum作为另一结果集的字段来实现分页。
select ee.* from(select e.* , rownum rr...
分类:
其他好文 时间:
2014-05-13 05:14:41
阅读次数:
303
#!/usr/bin/envpythonimporttime,MySQLdbfromsubprocessimportPopenfromsubprocessimportPIPEimportdns.queryimportdns.messageimportdns.tsigimportdns.tsigkeyringimportdns.updatedefset_dns(ip_list):key=dns.tsigkeyring.from_text({"cui.com":"SIvcwHj3goqYl0vKS6yOtdugx..
分类:
数据库 时间:
2014-05-13 02:04:53
阅读次数:
377