摘要: 契约:using System;using System.ServiceModel;namespace WcfAsync{ [ServiceContract] public interface ICalculatorService { [OperationContract(AsyncPattern = true)] IAsyncResult BeginAdd(decimal x,decimal y,AsyncCallback callback,object state); decimal EndAdd(IAsyncResult ar)...阅读全文
posted @ 2012-01-03 18:36 Joe Zhou 阅读(216) 评论(2) 编辑
摘要: 效果:js:$.fn.extend({ JPager: function (cfg, pageIndex, pageSize) { if (cfg && pageIndex > 0 && pageSize>0) { var token = "#" + this.attr("id"); this.empty(); var pageFirst = function () { $(token).JPager(cfg, 1, pageSize); }; var pagePre = function () ...阅读全文
posted @ 2012-01-02 16:28 Joe Zhou 阅读(315) 评论(0) 编辑
摘要: 数据库性能优化的基本原则就是:通过尽可能少的磁盘访问获得所需要的数据。要评价数据库的性能,需要在数据库调节前后比较其评价指标:响应时间和吞吐量之间的权衡、数据库的可用性、数据库的缓冲区命中率以及内存的使用效率,以此来衡量调节措施的效果和指导调整的方向。 索引的建立 在数据库操作中应用最广泛的是查询操作,而对查询最有效的优化是利用索引机制。一个查询在使用索引时,不用对全表的所有数据进行扫描就可以得到想要的数据。在一个基本表上最多只能建立一个聚簇索引,该表的其它索引都是二级索引,由它们只能检索到聚簇索引的键,必须再查聚簇索引才能得到实际记录。因此,这些二级索引的效率比聚簇索引要低。如果在一个连接.阅读全文
posted @ 2012-01-02 15:56 Joe Zhou 阅读(11) 评论(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 7 namespace Simple 8 { 9 internal delegate void PrintMsg();10 11 class DelegateAsync12 {13 public event PrintMsg PrintMsg;14 15 public DelegateAsync...阅读全文
posted @ 2011-12-15 11:22 Joe Zhou 阅读(159) 评论(0) 编辑
摘要: Code 1 using System; 2 3 namespace Demo 4 { 5 class Program 6 { 7 static void Main(string[] args) 8 { 9 //实验110 Console.WriteLine("实验1,弱引用");11 Object obj = new Object();12 WeakReference wr = new WeakReference(obj);13 ...阅读全文
posted @ 2011-12-07 14:47 Joe Zhou 阅读(22) 评论(1) 编辑
摘要: 下载阅读全文
posted @ 2011-12-04 16:20 Joe Zhou 阅读(21) 评论(0) 编辑
摘要: HTML:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>错误警告组件</title> <link href="Styles/JExtension.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.6.min.js" type="text/javascript&qu阅读全文
posted @ 2011-11-03 18:02 Joe Zhou 阅读(135) 评论(0) 编辑
摘要: 效果图:阅读全文
posted @ 2011-10-25 15:02 Joe Zhou 阅读(274) 评论(2) 编辑
摘要: /******************************************************CreateBy:joe zhou *CreateDate:2011-10-18 *Description:装饰器模式实现的拦截器*****************************************************/using System;namespace T4Mvp{ /// <summary> /// 组件接口 /// </summary> public interface IComponent { /// <...阅读全文
posted @ 2011-10-18 10:22 Joe Zhou 阅读(116) 评论(0) 编辑
摘要: /*****************************************************CreateBy:joe zhou*CreateDate:2011-9-20*Description:数组统计函数****************************************************/$.extend({ max: function (arr) { return cacl(arr, function (item, max) { if (!(max > item)) { return...阅读全文
posted @ 2011-09-21 09:37 Joe Zhou 阅读(135) 评论(1) 编辑
摘要: 你值得拥有!!!阅读全文
posted @ 2011-09-13 09:01 Joe Zhou 阅读(233) 评论(0) 编辑
摘要: 1 /**************************************************** 2 *CreateBy:joe zhou 3 *CreateDate:2011-9-4 4 *Description:字符串辅助函数 5 ****************************************************/ 6 //String.prototype = { 7 // caption: function () { 8 9 // },10 // leftPad: function (padChar, width) {11 // ...阅读全文
posted @ 2011-09-08 08:58 Joe Zhou 阅读(142) 评论(0) 编辑
摘要: 网上看了一些关于整数的正则表达式都不如人意,最大的毛病在于他们不能验证'023'这样的数字的正确性,还有些是不能正确校验负数,我想比较正确的写法应该是这样子的:exp=/^-?([1-9]+\d*|[0])$/;阅读全文
posted @ 2011-08-09 09:25 Joe Zhou 阅读(50) 评论(0) 编辑
摘要: Entity:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.Serialization;namespace Entity{ [DataContract] public class User { [DataMember] public string Name { get; set; } [DataMember...阅读全文
posted @ 2011-08-04 16:27 Joe Zhou 阅读(390) 评论(3) 编辑
摘要: <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>表格</title><style type="text/css">.editText{ border-width:1px; border-top-style:none; border-left-st阅读全文
posted @ 2011-08-04 08:43 Joe Zhou 阅读(805) 评论(1) 编辑
摘要: 方法1:str==""方法2:str==string.Empty方法3:str.Length==0方法4:string.IsNullOrEmpty(str)方法3效率最高,原因数字的比较速度最快!!!Reflector查看源码结果:阅读全文
posted @ 2011-06-25 16:26 Joe Zhou 阅读(143) 评论(3) 编辑
摘要: 刚刚发现了一款超级好的xml相关的编辑工具Liquid XML Studio,带图形编辑界面,非常好用,特别是在编辑xsd和xslt的时候. XSD Code 1 <?xml version="1.0" encoding="utf-8" ?>2 <!--Created with Liquid XML Studio Developer Edition 9.0.11.3078 (http://www.liquid-technologies.com)-->3 <xs:schema elementFormDefault="阅读全文
posted @ 2011-05-23 09:07 Joe Zhou 阅读(221) 评论(0) 编辑
摘要: 看了一些架构都支持xml配置,自己也想搞一套支持xml配置的东东.其实许多人会以为是采用序列化方式,这个说法貌似不是那么正确.由于没有很强烈的对应关系,而且必要时必须要可以检查你的配置有没有写错,如果采用默认的xml序列化方式并不是一种好的方式.对于模仿Microsoft的配置的那一套,也米有必要,原因在于没必要搞那么复杂,不仅效率低而且很多方法并没有实际的作用.好的办法是自定义xml序列化器(IXmlSerializer),自己定义一个序列化器好了,关于验证嘛,自己添加一个setting,加入xsd添加验证的回调就OK了.阅读全文
posted @ 2011-05-19 17:46 Joe Zhou 阅读(27) 评论(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.IO.Compression; 5 using System.Linq; 6 using System.Text; 7 using System.Runtime.Serialization.Formatters.Binary; 8 9 namespace Kingge.Mini.Network10 {11 /// <summary>12 /// 压缩工具类,可以用于减小流量,提升传输效率13 /// </s阅读全文
posted @ 2011-05-09 10:13 Joe Zhou 阅读(316) 评论(0) 编辑
摘要: 样式样式非常有用,它就像是html中的CSS.如果你要将某一样式应用到某一类型元素实例,那么你应该只设置Style的TargetType属性而不设置Key属性(同时设置将不产生作用).Code 1 <Window.Resources> 2 <Style TargetType="Rectangle"> 3 <Setter Property="Fill"> 4 <Setter.Value> 5 <SolidColorBrush Color="Yellow"></SolidC阅读全文
posted @ 2011-05-04 16:50 Joe Zhou 阅读(213) 评论(0) 编辑