天下最危险者,无过良善暗懦人

我有个习惯,就是在新闻或者别的地方看到一个历史人物相关的文章后,总是要去维基百科上再查一下,今天查了下黎元洪。让我感兴趣的是严复对于黎元洪的评价:

黎公道德,天下所信。然救国图存,断非如此道德所能有效。何则?以柔暗故!遍读中西历史,以为天下最危险者,无过良善暗懦人。下为一家之长,将不足以庇其家,出为一国之长,必不足以保其国”

这个评价其实颇为中肯,他的女儿黎绍芳便是牺牲者之一,1914年与袁世凯第九子袁克玖订婚,这是袁世凯在位时与黎元洪达成的一桩政治婚姻。被迫嫁入袁家时已经二十八岁。因对婚姻不满,忧郁终日而患精神病。1934年与袁克玖完婚, 婚后感情不合,病情加重,被送入精神病院。1945年4月15日抑郁而终,未生育儿女。而张勋复辟也是他一手造成的,却也不是保国的人物。
记得曾国藩家书中有一句,“男儿以懦弱无刚为大耻”,看到这些背后颇有些凉意,自己其实何尝不是一个这样的人呢?善良并非一种过错,但是优柔寡断,懦弱无刚则是致命的缺陷。又想起史记中妇人之仁的项羽,”项王见人,恭敬慈爱,言语呕呕,人有疾病,涕泣分食饮,至使人有功,当封爵者,印刓弊,忍不能予,此所谓妇人之仁也”,终究还是无颜见江东父老。
历史是一面镜子,从中看到别人的经验和教训,也要成为自我反思的一种途径,这也是读书的一个重要目的。自勉!

快乐有时候就是一种简单

读论语的时候,看到孔子与弟子讨论人生理想的时候,提到了“莫春者,春服既成,冠者五六人,童子六七人,浴乎沂,风乎舞雩,咏而归”。在我看来应该是强调人和自然地接触很重要,一种超然的心态也是儒家非常重视的。
暮春,是指农历三月,今天应该是农历三月三。正好前几天同事热心组织今天出去爬鹫峰,想到孔子的理想,于是便欣然同意。这次出游又一次证明了计划赶不上变化,约好了九点半的聚会在十点半的时候还是没有到齐,终于还是分头行事了。七八个人便决定去颐和园玩三国杀。
门口自然还是有兜售便宜门票的,20块钱,是通过在公园年票上作假来实现的,比正式的门票要便宜15块钱。以我以前的性格自然是不会做这种事情的,总有一种做贼的感觉。但是既然有人同意这样那也便随大流了,毕竟做人还是要灵活一些。只是感慨一下,只要有漏洞就一定会有人钻,到底是制度的问题还是人的本性如此?
颐和园里面依旧熙熙攘攘的人流,在下坡的小路中撞到正在亲热的一对,我们便自觉绕开了,只是感慨春色满园关不住啊,春天毕竟是春天啊,万物发春啊。
终于找到一块地方,在一起玩三国杀和杀人游戏,输了的人翻跟头或者做30个俯卧撑,颇吸引了不少游客的眼光。以前的我是很难在大庭广众之下翻跟斗的,但是现在看来似乎的确没啥,毕竟,简单点,自己开心才是最重要的。学会放松,学会坦然的生活。很多事情远比你想象中的简单和随意。

自助者天助之,自弃者天弃之

最近颇有些自暴自弃,花费了不少时间在网上玩三国杀,甚至还完全打乱了自己的生活作息规律和学习的计划,心里面总是有些事情堵着在。如果这样继续下去,你到底要往哪里去呢?
想起那句话性格决定命运,如今的处境和你的性格有莫大的关系。如果你不解决问题,你自己就会成为问题,你现在自己就是一个大问题。你知道现在的生活不是你想要的,但是却没有任何行动去改变现实,而是坐视时光一天天溜走,每次打电话回家之后总是内心充满了愧疚。
自助者天助之,自勉!不要等到以后再后悔!

[Powershell] Script to install software

Today I want to check whether the Windbg is installed on the target machine with expected version, and if not, install the correct version with Powershell. It turns out that Powershell is really powerful to do such things.

$dbgApp = get-wmiobject -class "Win32_Product" -namespace "root\CIMV2" | where {$_.Caption -like '*Debugging Tools for Windows*'};
if ($dbgApp -eq $null -or !$dbgApp.Version.StartsWith("6.13"))
{
    msiexec /passive /i D:\Debug\dbg_amd64.msi;
}

Windbg + SOS complains Failed to load data access DLL, 0x80004005

When I debug one .Net 4.0 program with SOS. After .loadby sos clr then run any SOS command results in following errors:

Failed to load data access DLL, 0x80004005 Verify that
1) you have a recent build of the debugger (6.2.14 or newer)
2) the file mscordacwks.dll that matches your version of mscorwks.dll is in the version directory
3) or, if you are debugging a dump file, verify that the file mscordacwks_.dll is on your symbol path.
4) you are debugging on the same architecture as the dump file. For example, an IA64 dump file must be debugged on an IA64 machine.
You can also run the debugger command .cordll to control the debugger's load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload. If that succeeds, the SOS command should work on retry.
If you are debugging a minidump, you need to make sure that your executable path is pointing to mscorwks.dll as well.

By google, some posts were found with same error info. But most of them are focus on the debugging dump on another machine with differnt mscordacwks version. This is not the case as I’m doing living debug. From the 1) hint of the error message I check the Windbg version is 6.6 and then install the newest version 6.13.0006. It works!
~~~~~~~
The same error happened during debug a Waston dump. The solution is

0:000> .cordll -ve -u -l
CLRDLL: Unable to find mscordacwks_AMD64_AMD64_2.0.50727.5005.dll by mscorwks search
CLRDLL: Unable to find 'mscordacwks_AMD64_AMD64_2.0.50727.5005.dll' on the path
CLRDLL: Unable to find mscorwks.dll by search
CLRDLL: ERROR: Unable to load DLL mscordacwks_AMD64_AMD64_2.0.50727.5005.dll, Win32 error 0n2
CLR DLL status: ERROR: Unable to load DLL mscordacwks_AMD64_AMD64_2.0.50727.5005.dll, Win32 error 0n2

The version we are trying to find is 2.0.50727.5005, while check the attribute of file mscordacwks.dll under D:\Windows\Microsoft.NET\Framework64\v2.0.50727 it turns out its version is 2.0.50727.4454. Copying the mscordacwks.dll from the machine where the dump was generated to the root path where Windbg is installed and rename it to mscordacwks_AMD64_AMD64_2.0.50727.5005.dll. It works!

掩耳盗铃

2011年的开始便颇有些热闹,YD作秀接见上*访的P民的确很不!和%谐^,而房产税在上海重庆的试点更是吸引眼球。
房产税实在不是什么新的东西,记得经济学原理里面提到了19世纪Henry George就提出了类似的土地税的概念,原因是他认为地主从整个经济增长中得到的利益大于他们应该得到的,是基于对经济福利分配的关注。当然网络上更有人考证出咱们的祖宗更伟大,在汉武帝时候便有更彻底的财产税,根据是史记中的“各以其物自占,率缗钱二千一算千而一算。诸作有租及铸,率缗钱四千一算”。
这个东西据说出发点是好的,据说可以调节贫富差距,这也是税收的一个重要目的,很不幸的是,This is China.
首先政府当然是永远的赢家。解决价格问题无非是两个途径,增加供给或者降低需求。而当供给或者需求缺乏弹性的时候,税收的无谓损失小。很不幸的是供给是非常缺乏弹性的,因为政府垄断了土地,所以市场会以最小的代价把财富转让给政府。这里可以明显看出来政府对于土地财政的依赖,而房产税更是火上浇油,同时可以看到政府不愿意损失自己的利益,否则增加土地出让的速度,控制出让的价格是明眼人都能看出来更有效的途径。
其次,这个事情无法调节贫富差距。某些垄断了重要资源的既得利益集团在没有任何有效制约的情况下必然是无休止地聚敛财富,真的能有效统计出他们有多少房产?那样的话估计很多人民的公仆都可以直接双规了。另一方面,如果租房市场的供给不充分,房东是很容易把这个代价转移到租房者的身上,而我没有看到任何相匹配的措施比如新建大量的公共租赁房。所以结果很可能适得其反。
我觉得房产税不过是掩耳盗铃中的手罢了。顺便感慨一下,同一阳光之下没有新的东西,比如去年的恨爹不成刚,在史记货殖列传中便有“千金之子,不死于市”的谚语。我也相信小到一个家庭,大到一个国家都是”富无经业,货无常主,能者辐射,不肖者完结”,有些事情前车之鉴尤未远,却没有看到成为后事之师,也许中国还是跳不出那个循环吧。
不好,不能愤青!

Patterns of Enterprise Application Architecture Chapter 1&2

After reading several design pattern books including “Head first design pattern” and “Java and Pattern” I turned my focus to one new book named Patterns of Enterprise Application Architecture. From the comments of amazon it seems that it’s one pretty good book. Considering the limited memory now, writing down some key ideas from the book should be able to keep the reading more interesting.
The preface section defines the scope of this book which is architecture for enterprise application. The common patterns of enterprise applications include data persistence, concurrent access, huge data process, complex UI, and integration to other enterprise application.  Here the UI involves Web and traditional rich client application. Also the authors gives some points on the measurement for performance. Finally the form of pattern is given which contains name, intention, summary,  how it works, when to use it and further reading, also some examples maybe also presented for better understanding.
The first chapter talks about layering. This topic starts from the evolution from the Client/Server model to three principal layers. One problem of the traditional C/S model is that the domain logic is hard to organized. It’s a bad idea to mix the logic in client UI directly which may easily causes duplicated code and maintain issues. Alternative way is putting them to the server side which usually presented as database store procedure. Here the store procedure is limited and may causes difficulty to switch to different database.
These short comes naturally involves idea to separate the domain logic in the object oriented world. This results in the new three principle layers including Presentation, Domain and Data source. one interesting point raised by author to think about the Presentation and Data source layer is that “Presentation is an external interface for a service your system offers to someone else, whether it be a complex human or a simple remote program. Data source is the interface to things that are providing a service to you”. Also one principle here is “The domain and data source should never be dependent on the presentation” which means we should be able to easily change our presentation layer without requiring changes in domain logic layer.
The benefits of layering contains: Easy to understand separated layer, minimize dependencies between different layers, substitute layers with alternative implementations of the same basic services. One obvious drawback of layering is that performance as we need to pass data to different layers. But compare to the benefits usually the cost is worthwhile.
The chapter 2 discusses about the way to organize domain logic.  Transaction Scripts, Domain Model, and Table Module. They all have pros and cons. The recommended way is Domain Model which is good at complexity when the problems scope increase.