Given two integersnandk, return all possible
combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution
is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-05-14 03:54:40
阅读次数:
250
c++ 中的template和c#的什么有点相似?先看下定义方式:template T
myFunction(T param1,T param2...){ T result= param1; // do something return
result; ...
分类:
编程语言 时间:
2014-05-14 03:05:27
阅读次数:
332
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/题意:Given
a binary tree, return thebottom-up level ordertraversal of its node...
分类:
编程语言 时间:
2014-05-12 22:03:27
阅读次数:
581
1、初始数据@Test public void test01() { Session
session = null; try { session = HibernateUtil.getSessionFactory().openSession();
session.beginTransac...
分类:
系统相关 时间:
2014-05-12 19:16:27
阅读次数:
469
实例1:读写字符文件,每次读取一个字符。#include<stdio.h>#include<stdlib.h>intmain(){FILE*fpin;FILE*fpout;charc;fpout=fopen("c:\\dest.txt","wt");if((fpin=fopen("c:\\test.txt","rt"))!=NULL){c=fgetc(fpin);while(c!=EOF){fputc(c,fpout);c=fgetc(fpin);..
分类:
编程语言 时间:
2014-05-12 03:57:13
阅读次数:
238
实例3:读写字节文件,每次读入一个缓存里面。#include<stdio.h>#include<stdlib.h>#defineMAXLEN1024intmain(){FILE*fpin;FILE*fpout;unsignedcharbuf[MAXLEN];intc;fpout=fopen("c:\\dest.jpg","wb");if((fpin=fopen("c:\\test.jpg","rb"))!=NULL){c=fread(buf,s..
分类:
编程语言 时间:
2014-05-12 03:47:54
阅读次数:
244
实例2:读取字符文件,每次读入一个缓存里面。#include<stdio.h>#include<stdlib.h>#defineMAXLEN1024intmain(){FILE*fin;FILE*fout=fopen("c:\\dest.txt","wt");charbuf[MAXLEN];if((fin=fopen("c:\\test.txt","rt"))!=NULL){char*c=fgets(buf,MAXLEN,fin);while(..
分类:
编程语言 时间:
2014-05-12 02:57:48
阅读次数:
251
直接上代码,代码有注释:
public class TestForListviewActivity extends Activity implements
OnScrollListener {
private ListView mListview = null;
private View mFooterView;
private PaginationAdapter mAdapter;
...
分类:
移动开发 时间:
2014-05-11 21:41:43
阅读次数:
394
1. 存储类型
mongodb文档类似于json,但不是完全的json。
json只有六种类型:null, bool, 数字,字符串,数组,对象。
但是mongo的文档在json的基础上还扩展了几种类型, 比如,日期类型,整数,浮点数。
mongodb真正存储在磁盘上是使用bson(binary json)。...
分类:
数据库 时间:
2014-05-11 20:28:51
阅读次数:
442
内核要执行一个应用程序,唯一的途径是通过系统调用,exec函数,exec又会调用启动程序,启动程序(通常是汇编语言)以类似下面的方式调用main函数:
void exit(main(argc, argv));
那么在main函数末尾使用exit(0)和使用return 0是等价的。这里有三个正常终止程序的函数:
void exit(int status); // 先执行一些清理操作,...
分类:
其他好文 时间:
2014-05-11 20:11:19
阅读次数:
394