Monthly Archives: December 2005


  环境: Windows Server 2003 Enterprise Edition with SP1 Microsoft .NET Framework v2.0.50727 Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200)   一句话摘要:System.Web.Configuration.WebConfigurationManager.GetSection的返回值不能cast成对应的类型,怀疑其返回类型不正确,是bug。估计System.Configuration.ConfigurationManager.GetSection有类似问题,不过没有测试过。   System.Web.Configuration.WebConfigurationManager静态类提供了操作Web Application配置文件的很多实用方法。 WebConfiguration.GetSection用于返回一个ConfigurationSection,很奇快MSDN里面说其返回值是Object,既然用于返回ConfigurationSection,为何要用Object作为返回类型而不返回ConfigurationSection类型?System.Configuration.Configuration.GetSection就返回ConfigurationSection。 文档里面说要将返回值Cast成section的实际类型,还推荐使用as:  "Notes to Implementers The return value must be cast to the expected configuration … Continue reading

Posted in .NET | 4 Comments


Incoming remote instruction… Identification: OK Last hop: Diana Querying emotional database… Synthesizing… —————————————- She’s kind (enough to eliminate unnecessary hatred) She’s good looking (essentially important for my being a bit artistic) She’s open to the outer world and has a multidimensional filter … Continue reading

Posted in Life | 5 Comments

Every time I pass by the courtyard

Every time I pass by the courtyard leaving my grandmother’s house, I look above at the building, find her window to see her standing there watching me. I can feel that gentle warmth casting down which is a physically existing … Continue reading

Posted in Life | 3 Comments


  利用Prefilter重写Smarty delimiters,实现设计时变量tag可见,逻辑tag不可见 设计时:{$variable} <!–{setction name=aaa loop=$bbb}–> …content <!–{/section}–>   实现思想: delimiter 分为design time delimiter和parse time delimiter两种 由Prefilter把design time delimiter重写为parse time delimiter 如果有时候,design time delimiter为可见(非HTML comment tag),但是Smarty tag太长了,也会影响布局。可以引入fake design time delimiter的概念,例如(|和|),在fake design time delimiter间写在DW中看起来爽的,而把真正给Smarty的tag选成HTML coment tag写在后面,利用prefilter在编译之前把所有fake design time delimiter间的内容remove掉

Posted in PHP Rocks | 2 Comments

解决PHP include的路径问题

  解决PHP include的路径问题 Where does include look for file given as a relative path? (from PHP manual) Files for including are first looked in include_path relative to the current working directory and then in include_path relative to the directory of … Continue reading

Posted in PHP Rocks | 2 Comments