有时我们用数据库存储文件,需要用到二进制字段,下面列常用方法。 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
题目:Given an input string, reverse the string word
by word.For example,Given s = "the sky is blue",return "blue is sky
the".Clarification:What constitu...
分类:
其他好文 时间:
2014-05-13 22:45:04
阅读次数:
317
1. 批量改变文件内容://批量改变输出文件内容#include #include #include
using namespace std;int main(){ ifstream input("D:pos_img.txt"); ofstream
output("D:pos_image...
分类:
编程语言 时间:
2014-05-13 22:29:37
阅读次数:
458
继承asynctask,有三个参数
三个参数的含义是第一个表示输入参数,第二个为progress,表示当前的进度,第三个为doInbackground
返回值
需要一个参数传入url,返回一个result结果,如果没有网络则返回空
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Li...
分类:
移动开发 时间:
2014-05-13 07:47:33
阅读次数:
406
lk@lk-virtual-machine:~/hadoop-1.0.1/bin$ ./hadoop dfs -rmr output
Deleted hdfs://localhost:9000/user/lk/output
lk@lk-virtual-machine:~/hadoop-1.0.1/bin$ ./hadoop jar ~/mytopk.jar top.Top input out...
分类:
其他好文 时间:
2014-05-13 06:53:12
阅读次数:
448
/*
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
lk@lk-virtual-machine:~/hadoop-1.0.1/bin$ ./hadoop jar ~/hadoop-1.0.1/to.jar top.Top input output
14/05/12 03:44:37 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applicat...
分类:
其他好文 时间:
2014-05-13 05:38:18
阅读次数:
291
本文翻译自\javacc-5.0\doc\lookahead.html章节。
上文:http://blog.csdn.net/chaofanwei/article/details/25541065
1、LOOKAHEAD是什么
lookahead就是当语法分析器从词法分析器里取token时,需要取多少个才能让分析器正确的走下去。
例一
void Input() :...
分类:
编程语言 时间:
2014-05-12 23:19:21
阅读次数:
679