1. str!=null; 2. "".equals(str); 3. str.length()!=0;注意: length是属性,一般集合类对象拥有的属性,取得集合的大小。例如:数组.length就是取得数组的长度。 length()是方法,一般字符串类对象有该方法,也是取得字符串长度。例...
分类:
编程语言 时间:
2015-02-02 19:26:42
阅读次数:
182
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
解题思路:一开始想到比较简单的方法是用哈希,建立一个索引与结点的m...
分类:
其他好文 时间:
2015-02-02 18:15:45
阅读次数:
122
1 //Node.h 2 template 3 struct Node 4 { 5 ElemType data; 6 Node *next; 7 Node(); 8 Node(ElemType item,Node * link=NULL); 9 }...
分类:
其他好文 时间:
2015-02-02 17:56:12
阅读次数:
160
HttpWebRequest request = null; Stream webStream = null; HttpWebResponse response = null; StreamReader reader = null; ...
分类:
Web程序 时间:
2015-02-02 17:31:33
阅读次数:
2893
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在n....
分类:
数据库 时间:
2015-02-02 15:27:09
阅读次数:
150
XP下用VC开发的程序,在一个主线程调用3 个线程,线程之间要共享数据,结果总出现wincore.cpp line 980 ASSERT(pMap-> LookupPermanent(hWndOrig) == NULL)错误,该怎么解决?[解决办法]这个,你先保证一下线程访问共享...
分类:
编程语言 时间:
2015-02-02 14:05:18
阅读次数:
546
//封装的适配器类adapter
publicclassNewJobAdapterextendsBaseAdapter{
privateList<Map<String,Object>>data=null;
privateLayoutInflatermInflater=null;
privateContextmContext;
publicNewJobAdapter(){
}
publicNewJobAdapter(Contextcontext,List<Map<..
分类:
其他好文 时间:
2015-02-02 12:46:39
阅读次数:
140
如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调用getContentResolver().notifyChange(uri, null)来通知注册在此URI上的访问者,例子如下:
public class PersonContentProvider extends ContentProvi...
分类:
其他好文 时间:
2015-02-02 10:51:31
阅读次数:
145
#include#includetypedef struct { int x,y;}pt;.../*int main(){ //pt *pt_1=NULL, *pt_2=NULL, *pt_3=NULL; 此处执行后出现段错误 pt pt_1={},pt_2={},*pt_3=NULL; ....
分类:
其他好文 时间:
2015-02-02 00:38:57
阅读次数:
207
构造方法:构造方法是在编译的时候自动执行的,每产生一个新的对象,构造方法就会在该对象中执行一次,也就是说只有产生了新的实例才会执行构造方法。构造函数可用于初始化特定的值。构造方法的名字与所属的类的名字一致,无任何返回类型,void也不行,因为void其实就是返回null,只不过在代码中省略了retu...
分类:
编程语言 时间:
2015-02-02 00:32:09
阅读次数:
213