10 2015 档案

摘要:单元测试是一种保证代码在整个生命周期都不会出现BUG的防护墙,是具有重要价值的软件过程制品之一。如果没有单元测试,很难保证代码在一两年之后还是清晰的。 阅读全文
posted @ 2015-10-29 11:28 Alfred.Xu 阅读(307) 评论(0) 推荐(0)
摘要:避免直接返回NULL。由于没有进行NULL判断导致的BUG占程序中总BUG的80%之多。 阅读全文
posted @ 2015-10-29 10:32 Alfred.Xu 阅读(236) 评论(0) 推荐(0)
摘要:防御性判断是指我们不应该总是那么相信目前正在调用的接口或者返回的数据结果正是我们所希望的值,而要加以判断。判断时使用反向判断,能使代码变得美观。 阅读全文
posted @ 2015-10-29 10:31 Alfred.Xu 阅读(133) 评论(0) 推荐(0)
摘要:行为型-观察者模式、基于事件的观察者 阅读全文
posted @ 2015-10-28 17:28 Alfred.Xu 阅读(147) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;//创建型-工厂模式、工厂规则注入、委托工厂namespace Chap2_2{ class Program { ... 阅读全文
posted @ 2015-10-28 15:52 Alfred.Xu 阅读(430) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace chap2_1_7{ class Program { static void Main(string[] ... 阅读全文
posted @ 2015-10-28 13:51 Alfred.Xu 阅读(199) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;u... 阅读全文
posted @ 2015-10-22 11:06 Alfred.Xu 阅读(583) 评论(0) 推荐(0)
摘要:过程:后台查询结果到DataTable,然后DataTable转为IList,然后逐行转为Dictionary。在一个方法中,用response.write()输出表格。然后在前端用调用该方法,使其输出页面代码//前端页面 //后台代码 strin... 阅读全文
posted @ 2015-10-20 15:35 Alfred.Xu 阅读(1178) 评论(0) 推荐(0)
摘要:using System;using System.Web;using System.Drawing;using System.Drawing.Imaging;using System.Text;using System.Text.RegularExpressions;using ThoughtWo... 阅读全文
posted @ 2015-10-19 18:12 Alfred.Xu 阅读(7249) 评论(0) 推荐(0)
摘要:update share set wx_cont_url='http://weilian.creatrue.net/aspx/NewsInfo.aspx?id='+cast(share.id as varchar(50)) where wx_cont_url is nullselect top 1 ... 阅读全文
posted @ 2015-10-12 18:16 Alfred.Xu 阅读(270) 评论(0) 推荐(0)
摘要:share 表的字段id, title, image, content, wx_cont_url, jump_url, fx_suc, hits, add_date, class_id, faburen_id, reg_time, news_author, news_src(1)分页select *... 阅读全文
posted @ 2015-10-08 15:16 Alfred.Xu 阅读(258) 评论(0) 推荐(0)