2008年5月21日星期三

Ensuring Only One Instance of Your Application Is Running -- 确保只有一个程序实例运行

Many applications must ensure that they have only one instance running. There are several ways to do this in Windows XP. Among them are the following:
许多程序都要确保只能运行一个实例。这个有多个实现方法。总的有以下:

→Use FindWindow or FindWindowEx to search for a known window that your application opens. If that window is already open, you can use that as an indication that the application is already running.
使用FindWindow或者FindWindowEx去查找你的应用程序窗口,如果窗口打开了,就说明程序已经在运行。

→Create a mutex or semaphore object when your application is opened, and close that object when the application terminates. The global object namespace is separated for each desktop, allowing a unique list of mutex and semaphore objects for each.
当你的应用程序打开时创建一个互斥或者信号对象,在程序结束时关闭这个对象。这个全局的对象名字空间在每个桌面是分开的,每个桌面允许有一系统的唯一的互斥和信号对象。

[Reference from MSDN-User Accounts with Fast User Switching and Remote DesktopUser Accounts with Fast User Switching and Remote Desktop]

2008年5月15日星期四

Out-of-band / 带外数据

1. A person is involved in a discussion with a group of people. During the discussion, he decides that some information is best kept between himself and one other member of the group, exclusively -- whether for privacy reasons, or merely the need to avoid saturating the entire group with information they do not need. His communication with that individual may be considered out-of-band, relative to the group discussion.

1. 一个人加入到一个讨论组中。在这个讨论期间,他决定有些信息最好对这个组的其他人保密。无论是私人的原因或者是仅仅是为了避免这些对这个组无用的信息。他的这个与个别人的这种交流就可以看成是out-of-band(相对于这个讨论组)

2. A person is at his place of work, and he is communicating with someone outside of his work place (for example, by Internet or telephone, using his employer's computer or telephone equipment). He decides that key parts of his conversation are best kept private from his employer, such as if he were discussing plans to change jobs. He would use his personal cell phone to transmit sensitive messages to, and receive related messages from, his external contact, in order to avoid use of his employer's phone or computer network. In this situation, his personal cell phone communications are considered out-of-band, relative to the main conversation.

2. 一个人在他的工作场所,他与外面的人交流(如打电话).他觉得有些谈话内容最好不要让老板知道,如想跳槽。他可以用他的手机来发送,接收敏感的信息,而不通过老板电话或计算机网络。这种情况下,手机就可以称做是out-of-band了,相对于这个主要的谈话。

[From wikipedia]

2008年3月9日星期日

apply one job

apply job of SDET(beyonesoft)

2008/3/10 14:47

压力测试-负载测试

负载测试主要关注系统内部的情况,如容量、可扩展性、功能等。例如,能够存储多少个TB的数据?如果同时调用全部的功能会不会出问题? 压力测试主要关心系统外部的表象。例如,能够同时处理多少人的数据操作?能够坚持多少小时不出问题? 负载过关了,但是压力不一定能够过关。你能够挑100斤,但是不一定能够连续挑一个月

2008年3月6日星期四

海尔芙拉

这种睡莲名为“海尔芙拉”,为微型珍稀品种,花朵一般在午间开放,夜晚闭合

2008年3月5日星期三

Pointer of function

void (*pf) (const string &, const string &);
typedef void (*pf) (const string &, const string &);
pf pf1;
void cmp(const string &, const string &);
pf1 = cmp;
pf1("hello", "hell");

void useBigger(const string &, const string &,
bool(const string &, const string &));

the same as:

void useBigger(const string &, const string &,
bool (*) (const string &, const string &));

2008年3月4日星期二

Format of EXE

Windows use PE format to store exe program