01 2014 档案

摘要:首先讲一下,truncate命令: 语法:TRUNCATE TABLE table; 表格里的数据被清空,存储空间被释放。 运行后会自动提交,包括之前其它未提交的会话,因而一旦清空无法回退。 只有表格的创建者或者其他拥有删除任意表格权限的用户(如DBA)才能清空表格。 TRUNCATE TABLE dept30; Table truncated. 下面讲一下truncate命令和delete的区别: 1、TRUNCATE在各种表上无论是大的还是小的都非常快。如果有ROLLBACK命令DELETE将被撤销,而TRUNCATE则不会被撤销。 2、TRUNCATE是一个DDL语言,向其他所有的DD. 阅读全文
posted @ 2014-01-16 13:37 purplesun 阅读(889) 评论(0) 推荐(0)
摘要:题目:一个整型数组里除了两个数字之外,其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。// Find two numbers which only appear once in an array// Input: data - an array contains two number appearing exactly once,// while others appearing exactly twice// Output: num1 - the first number appearing once in data// num2 阅读全文
posted @ 2014-01-08 16:58 purplesun 阅读(141) 评论(0) 推荐(0)
摘要:题目:在数组中,数字减去它右边的数字得到一个数对之差。求所有数对之差的最大值。例如在数组{2, 4, 1, 16, 7, 5, 11, 9}中,数对之差的最大值是11,是16减去5的结果。static int MaxDiff(int[] arr){if(arr.Length max){max = arr[i - 1];}int currentDiff = max - arr[i];if (currentDiff > maxDiff){maxDiff = currentDiff;}}return maxDiff;} 阅读全文
posted @ 2014-01-08 15:35 purplesun 阅读(235) 评论(0) 推荐(0)
摘要:Like ever, today’s article of Pinal Dave was interesting and informative. After, our mutual discussion between our DBAs and Developers on Pinal Dave topic of Concurrency and Isolation. I felt that most of us are intermingling three equally sounding words. Those are LOCKING, BLOCKING and DEAD LOCKING 阅读全文
posted @ 2014-01-02 15:44 purplesun 阅读(225) 评论(1) 推荐(0)