摘要: 服务器日志如何查看一、利用Windows自带的防火墙日志检测入侵 下面是一条防火墙日志记录 2005-01-1300:35:04OPENTCP61.145.129.13364.233.189.104495980 2005-01-1300:35:04:表示记录的日期时间 OPEN:表示打开连接;如果此处为Close表示关闭连接 TCP:表示使用的协议是Tcp 61.145.129.133:表示本地的IP 64.233.189.104:表示远程的IP 4959:表示本地的端口 80:表示远程的端口。注:如果此处的端口为非80、21等常用端口那你就要注意了。 每一条Open表示的记录对应的有一条CL 阅读全文
posted @ 2014-03-24 14:23 purplesun 阅读(5284) 评论(0) 推荐(0) 编辑
摘要: 首先讲一下,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 阅读(801) 评论(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 阅读(135) 评论(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 阅读(221) 评论(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 阅读(203) 评论(1) 推荐(0) 编辑
摘要: 2个字符串a,b,A:abcdefghi B:abcgi 返回trueA:abcdefghi B:abz 返回false(因为字符串A不包含字母Z)任意语言,但是注意要最优算法,另外,也要处理异常状况。你输入的有可能是乱码,有可能A比B字符串还短,也有可能空字符串,还有如果字符串不是排序而是乱序。//假设str1和str2不是排序的,时间复杂度 str1.Length*str2.Lengthstaticbool M2(string str1, string str2){if (str1 == null || str2 == null || str2.Length == 0 || str1.Le 阅读全文
posted @ 2013-12-27 10:29 purplesun 阅读(152) 评论(0) 推荐(0) 编辑
摘要: public static int Traingle(int a, int b, int c){if (a <= 0 || b <= 0 || c <= 0){return 4;}int[] array = new int[3] {a,b,c };Array.Sort(array);int min, mid, max;min = array[0];mid = array[1];m... 阅读全文
posted @ 2010-09-15 15:33 purplesun 阅读(327) 评论(0) 推荐(0) 编辑
摘要: public static int[] RemoveDuplicated(int [] testArray){if (testArray.Length == 0){return testArray;}List<int> result = new List<int>();int i;int j;i = 1;j = 0;int temp = testArray[0];resul... 阅读全文
posted @ 2010-09-15 15:31 purplesun 阅读(1263) 评论(1) 推荐(1) 编辑
摘要: public static string ReverseWords(string array){if (string.IsNullOrEmpty(array)){throw new ArgumentException("");}int arrLen = array.Length;char[] strNew = new char[arrLen + 1];  //全部反转 for (int index... 阅读全文
posted @ 2010-09-13 10:47 purplesun 阅读(381) 评论(0) 推荐(1) 编辑
摘要: public static int MaxSubSequSum(int[] arr, ref int intStart, ref int intEnd){int MaxSum = 0;int TmpSum = 0;for (int i = 0, j = 0; j < arr.Length; j++){TmpSum += arr[j];//如果截止到当前位置之和(TmpSum)大于最大子序列和... 阅读全文
posted @ 2010-09-13 10:38 purplesun 阅读(335) 评论(2) 推荐(1) 编辑