摘要:
1、已经排序的数组,查找索引最小的值:int binary_search(int[] array, int n, int value){ int maxIndex = n; int minIndex = 1; int index; while (maxIndex >= minIndex) { index = (maxIndex + minIndex) / 2; if (array[index - 1] == value) { while (--index > 0) { ... 阅读全文
摘要:
类别:HTML5Input标签牲描述共用特性required标签:值为required,检测为必须输入值。查看示例type:textlist标签:该标签是指向数据源标签datalist:id。查看示例type:email 阅读全文
摘要:
类别:Input标签文本框标签代码:<input list="browsers" name="browser" /> input标签的新特性list指向的是数据源datalist标签的id数据源标签代码<datalist id="browsers"> <option value="火狐">火狐</option> <option value="谷歌">谷歌</option> <option value="IE1 阅读全文
摘要:
本笔记只作为学习标识,对代码不作注释!代码下载:下载使用方 protected void Button_Click(object sender, EventArgs e) { var dealThread = new DealThread(); dealThread.Pool(3); dealThread.DealFunction(Func);//可以去掉使用内部的处理方法 ThreadInfo.SetProxy(dealThread); } prot... 阅读全文
摘要:
在项目中碰到一个Linq(Linq To Sql)的Int转为string的头痛问题,在网络上找了1个多小时无果...最后还是通过自己实践出来了。转换的方法很容易:引入容易空间:using System.Data.Objects.SqlClient;使用该命名空间里的SqlFunctions类的方法(顺便说一下:Linq To Sql也支持EntityFunctions,该类型的命名空间位于:)SqlFunctions.StringConvert(【数值字段】 * 1m).Trim() 数值字段 * 1m会产生一个Decimal的数值类型,就可以使用SqlFunctions.StringCo. 阅读全文
摘要:
执行以下的存储过程:SELECT CAST ( REPLACE ( REPLACE ( XEventData.XEvent.value ('(data/value)[1]', 'varchar(max)'), '<victim-list>', '<deadlock><victim-list>'), '<process-list>', '</victim-list><process-list>') AS XML) AS Deadl 阅读全文
摘要:
输入的比较精度:@datepart(@datepart 参数参阅:http://msdn.microsoft.com/zh-cn/library/ms174420.aspx)输入时间范围:@Start datetime, @End datetime数据库的时间值:Date核心语句:datediff(@datepart ,@Start, @End) = abs(datediff (@datepart,Date ,@Start)) + abs(datediff (@datepart, Date,@End)))例句:SELECT 1 WHERE datediff(@datepart ,@Start, 阅读全文
摘要:
来源地址:http://www.albahari.com/nutshell/cs4ch12.aspxCalling Dispose from a finalizer(采用完成执行后的释放,也就是析构函数):class Test : IDisposable{ public void Dispose() // NOT virtual(非虚函数) { Dispose (true); GC.SuppressFinalize (this); // Prevent finalizer from running.(在执行过程中防止调用最终的资源释放函数) }... 阅读全文
摘要:
MSSQL获取父节点方法CREATE FUNCTION [dbo].[Fn_GetSelfParentNodes] ( @NodeID bigint,--当前节点编号 @IsContainSelf bit--是否包含当前节点)RETURNS @Table TABLE ( NodeID bigint, NodeLevel int)ASBEGINIF @NodeID <=0BEGIN RETURN --无法节点ENDDeclare @CID bigintDeclare @level int if(@IsContainSelf=0)--不包含当前节点 ... 阅读全文
摘要:
最近发现博客园里很多人都采用EA作为UML的建模工具了.....怎么最近会突然涌出这么多的EA建模手的呢?百思不得其解啊...虽然说支持.NET的建模工具,基本在EA里都有很好的支持,只是最近看到博客圆的首页UML建模大多数都是EA的影子...对于.NET开发的我也是非常挺EA建模工具..哈哈,因为这个工具我是2010年就开始用了,感觉挺好用的。 阅读全文