mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

随笔分类 -  [计算机]Tech

摘要: 阅读全文

posted @ 2014-03-18 21:25 mrfangzheng 阅读(171) 评论(0) 推荐(0)

摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usinglog4net.Appender;usingSystem.Windows.Forms;usinglog4net.Core;usinglog4net.Layout;namespaceUI{///<summary>///Usage:///log4net.Config.BasicConfigurator.Configure();///varlogPattern="%date[%thread]%-5level%log 阅读全文

posted @ 2012-11-29 18:43 mrfangzheng 阅读(677) 评论(0) 推荐(0)

摘要:jQuery Selectors and Attribute SelectorsSelectorExampleDescriptionList accurate as of jQuery 1.3*$(‘*’);This selector is a wild card method and will select all elements in a document.#id$(‘#id’);This selector selects an element with the given ID..class$(‘.class’)The class selector will gather all el 阅读全文

posted @ 2011-11-05 20:42 mrfangzheng 阅读(205) 评论(0) 推荐(0)

摘要:红色表示 absolute块 父容器必须是relative, 否则这些块就以整个网页为参照物定位和比例都是以参照物(父容器)计算, 比如: 100%指的是父容器的尺寸absolute的体积不计算到父容器中 蓝色表示 relative块 参照物为自身占位不变(如图: 蓝色div和随后的绿色div之间有空隙, 后者仍用前者定位之前的所占位置计算)体积计算到父容器中 修正了一个IE6的bug (container要加上 'zoom:1;')<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"&quo 阅读全文

posted @ 2011-09-23 15:51 mrfangzheng 阅读(1350) 评论(0) 推荐(0)

摘要:ORMSQL 开发速度 快 慢 运行性能 慢快 方便修改可维护性高低ORM最大的问题是复杂查询2者同时使用?简单地方用ORM复杂地方用SQL 阅读全文

posted @ 2011-09-19 15:24 mrfangzheng 阅读(513) 评论(0) 推荐(0)

摘要:publicstaticvoidBindCmdWithEventSrc(objecteventSrc,stringeventName,ICmdcmd){Actionact=delegate{if(cmd!=null){cmd.Execute();}};EventInfoei=eventSrc.GetType().GetEvent(eventName);varhandlerType=ei.EventHandlerType;vareventParams=handlerType.GetMethod("Invoke").GetParameters();//lambda:(objec 阅读全文

posted @ 2011-08-12 15:51 mrfangzheng 阅读(447) 评论(0) 推荐(0)

摘要:正确性 : 如何保证代码是正确的永远是第一位 如何测试: 有无现成单元测试框架如何日志: 有无现成日志模块如何处理错误: try-catch-finally, 或者如何模拟性能 : 从用户角度, 高性能, 这是最基本的用户体验, 也是程序不被轻易复制之根本 高性能的循环内存变量复用可维护性 : 从开发者角度,需求会不停的变化, 代码会飞速的膨胀, 写程序就是不断地和"变化"斗争 如何避免命名冲突(名字空间)如何重用代码(共享库)编写可重用的代码模块创建可重用的GUI模块 如何解耦: 接口, 事件, 回调, functor功能 如何与其他语言编写的程序交互如何调用操作系统AP 阅读全文

posted @ 2010-07-14 09:48 mrfangzheng 阅读(231) 评论(0) 推荐(0)

摘要:1) Create a device independant bitmap using CreateDIBSection (use a negative heigh to make the DIB top->down so the pointer is to pixel (0,0) in the upper left corner)2) Create a memory DC using Cr... 阅读全文

posted @ 2010-06-30 22:34 mrfangzheng 阅读(283) 评论(0) 推荐(0)

摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--publicvoidDoMouseClick(){//Calltheimportedfunctionwiththecursor'scurrentpositionintX=Cursor.Position... 阅读全文

posted @ 2010-04-29 10:01 mrfangzheng

摘要:改变窗口的Style1. 无标题栏2. 可改变大小代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--HWNDhwnd=this->m_hWnd;intindex=GWL_STYLE;//readexistingvalueLONGstyleVal... 阅读全文

posted @ 2010-03-23 13:51 mrfangzheng 阅读(764) 评论(0) 推荐(0)

摘要:Spring.NET 1.3.01.配置web.config代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<sectionGroupname="spring"><sectionname="context"type="Spring... 阅读全文

posted @ 2010-02-02 14:48 mrfangzheng 阅读(417) 评论(0) 推荐(0)

摘要:环境:Spring.NET 1.1.2IIS 7问题:IIS7 integrated pipeline "The HttpRuntime.ProcessRequest method is not supported by IIS integrated pipeline mode"解决:IIS7->ApplicationPools->选中App->右键 Basic Settings... 阅读全文

posted @ 2010-01-30 09:48 mrfangzheng 阅读(507) 评论(0) 推荐(0)

摘要:只有2种情况下catch异常catch到的异常能够必须马上处理, 否则就不catch, 由系统自动向上抛在每个线程栈最顶端或者代码的边界处catch所有的异常比如:-程序的Main(), Winforms的ThreadException-自定义线程函数 -边界处: 实现COM接口的每个方法(把异常转化成错误代码传给COM调用者) 阅读全文

posted @ 2010-01-19 15:42 mrfangzheng 阅读(209) 评论(0) 推荐(0)

摘要:LoggingUtility Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSyst... 阅读全文

posted @ 2010-01-07 18:18 mrfangzheng 阅读(357) 评论(1) 推荐(0)

摘要:ElementNameThe ElementName property is used to reference an object by the name of the object. This is particularly useful in XAML, where you can directly reference other elements defined in XAML. 举例&l... 阅读全文

posted @ 2009-11-26 09:32 mrfangzheng 阅读(7856) 评论(0) 推荐(0)

摘要:UserControl必须实现ISupportInitialize接口.[代码] 阅读全文

posted @ 2009-11-25 10:02 mrfangzheng 阅读(791) 评论(0) 推荐(0)

摘要:一般的, ListBox.ItemSource<==> ObservableCollection<User>如果经常更新数据源的话, 会引起子控件不断的创建和销毁, 从而引起性能问题.一个办法是:ListBox.ItemSource<==> ObservableCollection<UserProxy> <==> ObservableCo... 阅读全文

posted @ 2009-11-24 15:36 mrfangzheng 阅读(264) 评论(0) 推荐(0)

摘要:使用顺序: DataTemplate, UserControl, ControlTemplate, CustomControl尽量使用Template. Template分2种: "纯XAML"和"XAML+CodeBehind"尽量使用"纯XAML"类型的Template, 纯XAML的Template可以放在任何资源中, 包括没有CodeBehind的ResouceDictionary中.方法... 阅读全文

posted @ 2009-10-30 10:35 mrfangzheng 阅读(1684) 评论(0) 推荐(0)

摘要:当Windows的用户退出系统或者关闭系统是, Windows会向每个应用程序发出WM_QUERYENDSESSION消息和WM_ENDSESSION消息. 在WPF中, Application的SessionEnding事件可以处理WM_QUERYENDSESSION消息. 然而, 应用程序有时却不会关闭, 特别是主窗口时TopMost时, 即使手动调用Application.Shutdown(... 阅读全文

posted @ 2009-10-23 11:01 mrfangzheng 阅读(392) 评论(0) 推荐(0)

摘要:Sub CollapseLogRegions() Dim objSelection As TextSelection objSelection = DTE.ActiveDocument.Selection objSelection.StartOfDocument() While (objSelection.FindText( "^.*region.*(DEBUG|ERROR|INFO|WARN).... 阅读全文

posted @ 2009-10-16 16:11 mrfangzheng 阅读(201) 评论(0) 推荐(0)