28.关于一个梦

昨天,做了一个梦。

日本,某个大学,我被应邀参加一个会议。
可是,不知道为什么,学校里正在开展一个学生运动,简称学运,
很不幸的是,我也被日本警察带进了所里。
没有拷问,没有虐待。
我悄悄的溜走了,还不忘带走一件警察的衣服。
可是我不会日语。
夜晚。
某个小店的灯亮着,招牌是“定制中山装”,oh,肯定是中国人。
于是我走进店里。
“老板,我需要一个向导”
“你想要做什么?”
“我要回中国”
……
梦醒了,中国梦!
Posted in 那年夏天 | Tagged | 2 Comments

Unit Testing

http://artofunittesting.com/definition-of-a-unit-test/

 

A
good unit test is:

§  Able
to be fully automated

§  Has
full control over all the pieces running (Use mocks or stubs to achieve this
isolation when needed)

§  Can
be run in any order  if
part of many other tests

§  Runs
in memory (no
DB or File access, for example)

§  Consistently returns
the same result (You always run the same test, so no random numbers, for
example. save those for integration or range tests)

§  Runs fast

§  Tests
single
logical concept
 in the system

§  Readable

§  Maintainable

§  Trustworthy (when
you see its result, you don’t need to debug the code just to be sure)

A test is not a unit test if:

1.It talks to the database

2.It communicates across the network

3.It touches the file system

4.It can’t run at the same time as any of your other unit tests

5.You have to do special things to your
environment (such as editing config files) to run it.

 

2. Unit Test Best
practice

http://www.slideshare.net/nickokiss/unit-testing-best-practices?from_search=7

 

3. Testable Code

Based on lots of
practices, we found the testable code is fundamental for unit test, here is a
article from Google to use.

http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf

Posted in 技术开发 | Leave a comment

ATL::CRegKey trick

please pay attention on REGSAM.

HKEY m_hKey;

    REGSAM m_samWOW64;  

NND, default is HKEY_READ | HKEY_WRITE, so you understood.
Posted in 技术开发 | Tagged | 1 Comment

Windows Security programming sample

Good to find below article about windows security such as SID, ACE, DCL etc.
Just download that tand building with VS2008.
Enjoy!
Posted in 技术开发 | Tagged , | Leave a comment

RemoteIE试用

不知道我的机器为什么,总是装不上IE11,于是想试试MS 最新的remoteIE,申请了一个账号,如上图。
然后直接点击 Ie 那个图标,然后就像 Remote Desktop PC 一样。如下图:
让你感觉不到有个容器 包含着IE。
看 winspy 抓到的窗口层级:
可以看到是 RDP的协议,窗口名称告诉我们了。
在我家VPN的情况下,运行速度还是比较可以接受的。
MS 提供这个是为了 非windows 平台的人更容易测试IE。
你可以用来测试azure的APP。
当你把你的site publish之后,或者放在azure里面的话,这个测试,还是蛮方便的。
Posted in 技术开发 | Tagged | Leave a comment