摘要: 一: 概念 递归,说白了就是直接或者间接的调用自己的一种算法。它是把求解问题转化为规模较小的子问题,然后通过多次递归一直到可以得出结果 的最小解,然后通过最小解逐层向上返回调用,最终得到整个问题的解。总之递归可以概括为一句话就是:“能进则进,不进则退”。 二:三要素 <1> 递归中每次循环都必须使问题规模有所缩小。 <2> 递归操作的每两步都是有紧密的联系,如在“递归”的“归操作时”,前一次的输出就是后一次的输入。 <3> 当子问题的规模足够小时,必须能够直接求出该规模问题的解,其实也就是必须要有结束递归的条件。... 阅读全文
posted @ 2012-08-11 13:07 沙耶 阅读(402) 评论(0) 推荐(0)
摘要: --不是说的In,Not IN分页方式,也不是通常的双OrderBy方式,这是使用于千万级别数据分页的SQL语句:--orderid 1:1028 10:10257 20:10267 30:10277--查询第20-30条select top 10 * from Orders where OrderID> (select max(OrderID) from (select top 20 OrderID from Orders order by OrderID ASC ) t0)order by OrderID ASC 阅读全文
posted @ 2012-08-08 17:21 沙耶 阅读(434) 评论(0) 推荐(0)
摘要: USE [mydb]GO/****** Object: StoredProcedure [dbo].[OutputData] Script Date: 03/12/2012 11:44:00 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[OutputData] @tablename sysname AS declare @column varchar(1000) declare @columndata varchar(1000) declare @sql varchar(4000) ... 阅读全文
posted @ 2012-08-08 17:16 沙耶 阅读(231) 评论(0) 推荐(0)
摘要: 【客户信息功能的要求】查询条件: 1.客户类型(必填,默认值为个人客户,可选个人客户、企业客户) 2.客户名称(模糊检索客户全称、简称、英文全称、英文简称), 3.客户编号(精确匹配); 4.电话(模糊匹配企业或者个人扩展信息中的多个电话相关的字段) 5.证件号码(文本精确匹配,仅当客户类型为个人时可用,否则自动清空;匹配身份证和其他证件号码) 6.备注(模糊匹配个人信息、企业信息中的备注文本) 7.车款(下拉选择,树图显示,选取后,以“主机厂/车系/车型/车款”唯一路径方式显示为只读文本) 8.车牌号(模糊匹配,关联车辆信息查找) 9.车架号(精确匹配,关联车辆信息查找) 10.性别(仅显示 阅读全文
posted @ 2012-08-07 10:42 沙耶 阅读(513) 评论(0) 推荐(0)
摘要: 重构代码可以从如下几个方面着手:1)已经废弃不用的注释,方法,属性,变量去掉他们;2)方法名称在各个模块雷同,但又不一致的,请修改为一致的命名;3)对相关的方法应该放在一起,便于查看;4)一些不应该作为public公开出去的属性和方法,考虑将其修改为private或者internal,增强封装的效果,避免误用;5)优化一些效率不高的,反复遍历查找的算法; 阅读全文
posted @ 2012-08-06 15:35 沙耶 阅读(292) 评论(0) 推荐(1)
摘要: 基于DEV1.1.2CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)存在BUG,经过测试研究,使用以下方法private void gridViewCarList_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExp... 阅读全文
posted @ 2012-07-26 10:52 沙耶 阅读(1389) 评论(0) 推荐(0)
摘要: public BindingList<StudentDC> StudentList { get { return this.bindingSourceList.DataSource as BindingList<StudentDC>; } set { bindingSourceList.DataSource = value; } } private void FrmGridTest_Load(object sender, System.EventArgs e) { Stu... 阅读全文
posted @ 2012-07-25 12:27 沙耶 阅读(540) 评论(0) 推荐(0)
摘要: public BindingList<StudentDC> StudentList { get { return this.bindingSourceList.DataSource as BindingList<StudentDC>; } set { bindingSourceList.DataSource = value; } } private void FrmGridTest_Load(object sender, System.EventArgs e) { Stu... 阅读全文
posted @ 2012-07-24 23:16 沙耶 阅读(1375) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2012-03-25 18:30 沙耶 阅读(167) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleUtilities{ class AcceptMutilLine { static string acceptmultiLine() { ConsoleKeyInfo cki; Console.TreatControlCAsInput = true;//防止Ctrl+C复制 Console.WriteLine("Press the F10 key to quit: \n"); s 阅读全文
posted @ 2012-03-21 16:56 沙耶 阅读(546) 评论(0) 推荐(0)