摘要: Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example: Given n = 13, Retur... 阅读全文
posted @ 2016-01-19 10:50 冯小诺 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 最近用devexpress做excel export,发现devexpress对cell merge的case支持不是很好,没办法,只要调用excel api自己去做merge了。devexpress的mege就是对某列按顺序对相同的值进行merge。写了一个方法,对导出的excel进行merge,如下:1privatevoidmergeCell2(stringfileName,introwNumber,List<int>columnIndex)2{3Microsoft.Office.Interop.Excel.Application_excelApp=newMicrosoft.O 阅读全文
posted @ 2012-05-11 17:30 冯小诺 阅读(602) 评论(0) 推荐(0) 编辑
摘要: DimL,T,R,B'click父亲菜单SwfWindow("Form1").SwfObject("SwfObject").Click55,15'调用swfobject的方法,得到坐标SwfWindow("SwfWindow").SwfObject("SwfObject").GetTextLocation"EricTest",L,T,R,B,True'click父亲菜单2次SwfWindow("Form1").SwfObject("SwfOb 阅读全文
posted @ 2012-02-13 22:37 冯小诺 阅读(389) 评论(3) 推荐(0) 编辑
摘要: 仔细研究了下,发现sql server里面的explicit transaction还是有点复杂的。以下是有些总结: · Commit transaction 会提交所有嵌套的transaction修改。但是如果嵌套的transaction里面有rollback tran to save point, 那么save point之后的部分会revert掉。 delete from dbo.numbertable begin tran out1 insert into dbo.numbertable values(1) insert into dbo.numbertable ... 阅读全文
posted @ 2011-12-16 17:51 冯小诺 阅读(11463) 评论(0) 推荐(3) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.IO;usingSystem.Security.Cryptography;namespaceSynEncrption{publicpartialclassForm1:Form{privatestringkey="abcde2341 阅读全文
posted @ 2011-11-27 21:48 冯小诺 阅读(5656) 评论(0) 推荐(0) 编辑
摘要: 最近碰巧读到了关于sql server pivot 的两篇文章。详见: 1 Cross Tabs and Pivots, Part 1 – Converting Rows to Columns 2 Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs 这两篇文章对sql server里面行转列的两种技术cross tabs和pivot进行了分析和比较... 阅读全文
posted @ 2011-03-27 17:26 冯小诺 阅读(585) 评论(0) 推荐(1) 编辑
摘要: 字符串是由类定义的,如下 注意它从接口IEnumerablechar派生,那么如果想得到所有单个字符,那就简单了,如果要对字符串进行统计,那也很简单:如果要对字符串反转,如下:如果对字符串遍历,那么使用扩展方法ForEach就可以了。现在有一个需求 ,对一个list的字符串,我想对满足某些条件的进行替换,不满足条件的保留下来。问题来了,在forach的时候不能对字符串本身修改。因为msdn有... 阅读全文
posted @ 2011-01-16 16:55 冯小诺 阅读(603) 评论(0) 推荐(0) 编辑
摘要: 虽然对简单的字符串效率不高,但是对长的字符串还是可以的。 阅读全文
posted @ 2011-01-13 21:14 冯小诺 阅读(5177) 评论(0) 推荐(0) 编辑
摘要: 这篇post写点与日期时间周操作有关的一些操作,也是对工作共用到的这些做一些总结。 sql server里面有个set datefirst的语句,用于设置一周的第一天。可选值为1到7。语法如下: 其中number可以为数值1到7。@number_var可以为自定义的变量。如果set datefirst 1,那么每周的第一天是星期一;如果set datefirst 7,那么每周的第一天是星期日。... 阅读全文
posted @ 2010-09-05 15:18 冯小诺 阅读(579) 评论(0) 推荐(0) 编辑
摘要: Sql sever里面有个自带的reverse函数,这个函数的主要功能是把一个字符产反转。比如对于: 阅读全文
posted @ 2010-08-30 21:16 冯小诺 阅读(18390) 评论(1) 推荐(1) 编辑