摘要: Several people have noticed that Calendar.GetWeekOfYear()is almost like the ISO 8601 weekwhen passed CalendarWeekRule.FirstFourDayWeekand DayOfWeek.Monday, however it is a little bit different. Specifically ISO 8601 always has 7 day weeks. If the first partial week of a year doesn't contain Thur 阅读全文
posted @ 2012-11-23 10:12 vayne 阅读(409) 评论(0) 推荐(0) 编辑
摘要: // Convert A, B, .... AAA, AAB to number 1,2, ... int StringToNumber(string s) { int r = 0 ; for (int i = 0; i < s.Length; i++) { r = r * 26 + s[i] - 'A' + 1; } return r ; } // Co... 阅读全文
posted @ 2012-11-08 11:17 vayne 阅读(182) 评论(0) 推荐(0) 编辑
摘要: <script> Array.prototype.swap = function (i, j) { var temp = this[i]; this[i] = this[j]; this[j] = temp; } Array.prototype.bubbleSort = function () { for (var i = this.length - 1; i > 0; --i) { for (var j = 0; j < i; ++j) { if (this[j] >... 阅读全文
posted @ 2012-11-06 09:36 vayne 阅读(402) 评论(0) 推荐(1) 编辑
摘要: 1 Time.Begin(); 2 for (double i = 0; i < 100000000; i++) 3 { 4 int temp = 0; 5 if (temp == 0) temp = 1; 6 else temp = 2; 7 } 8 Time.End(); 9 Console.WriteLine(Time.HmsTicks);10 11... 阅读全文
posted @ 2012-11-05 14:57 vayne 阅读(466) 评论(0) 推荐(0) 编辑
摘要: 1 function hideBox(event,obj) { 2 var event = event || window.event; 3 var oBox = obj; 4 var oTarget = event.relatedTarget || event.toElement; 5 if (contains(oBox, oTarget)) { 6 return; 7 } else { 8 obj.style.display = "none"; 9 }10 }11 12 function contains(r... 阅读全文
posted @ 2012-11-05 11:17 vayne 阅读(191) 评论(0) 推荐(0) 编辑