public class Debug { public static int line(Exception e) { StackTraceElement[] trace = e.getStackTrace(); if (trace == null || trace.length == 0) ...
分类:
移动开发 时间:
2015-01-10 19:40:49
阅读次数:
246
约束分以下几种:非空约束:如果使用了非空约束,则以后些字段的内容不允许设置为NULL (NOT NULL)唯一约束:即此列的内容不允许出重复UK主键约束:表示一个唯一的标识,例如:人员ID不能重复,且不能为空PK检查约束:用户自行编写设置内容的检查条件;CK主外键约束:在2张表上进行的关联的约束,加...
分类:
其他好文 时间:
2015-01-10 19:39:41
阅读次数:
312
1 DataTable dt = ds.Table[0]; 2 if (dt != null && dt.Rows.Count > 0)3 {4 foreach (DataRow dr in dt.Rows)5 {6 dr["列名"]="你的值";7 }8 }
分类:
其他好文 时间:
2015-01-10 19:38:38
阅读次数:
158
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
...
分类:
其他好文 时间:
2015-01-10 18:20:29
阅读次数:
181
需求:应用层申请一个空间,然后将地址传递到驱动层,驱动直接将处理后的数据放到应用层指定的空间中,类似于Linux下的copy_from_user。
应用层代码片段:
将申请的地址传递到驱动层
CHAR buf[64] = {0};
int iWriteLen = 0;
char *pWaddr = NULL;
char *pRaddr = NULL;
unsigned...
分类:
其他好文 时间:
2015-01-10 16:37:52
阅读次数:
214
malloc()与free()l 函数原型malloc函数的函数原型为:void* malloc(unsigned int size),它根据参数指定的尺寸来分配内存块,并且返回一个void型指针,指向新分配的内存块的初始位置。如果内存分配失败(内存不足),则函数返回NULL。l 关于返回值mall...
分类:
其他好文 时间:
2015-01-09 23:34:47
阅读次数:
214
select A.* from A left join B using(name,addr,age) where B.name is NULL;select A.* from A left join B on A.id=B.Aid where ISNULL(B.name);查询两个表中的差集,用IS...
分类:
数据库 时间:
2015-01-09 22:07:54
阅读次数:
166
https://oj.leetcode.com/problemset/algorithms/http://www.cnblogs.com/yuzhangcmu/p/4128794.html/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
publicclassSolution{
//Assumehead..
分类:
其他好文 时间:
2015-01-09 19:34:00
阅读次数:
143
https://oj.leetcode.com/problems/compare-version-numbers/http://blog.csdn.net/u012243115/article/details/41969181publicclassSolution{
publicintcompareVersion(Stringversion1,Stringversion2){
if(version1==null||version2==null)
return0;//Invalidinput.
//NOTE!..
分类:
其他好文 时间:
2015-01-09 19:31:02
阅读次数:
164
https://oj.leetcode.com/problems/majority-element/publicclassSolution{
publicintmajorityElement(int[]num){
intlen=num.length;
intminhit=(len/2)+1;
Map<Integer,Integer>map=newHashMap<>();
for(inti:num)
{
Integeroccur=map.get(i);
if(occur==null)
..
分类:
其他好文 时间:
2015-01-09 19:29:48
阅读次数:
167