Windows API — ShellExecute function

ShellExecute function

Syntax

Continue Reading…

理解并使用 Windows 函数

我们在Windows上进行一些开发的时候,能善于利用Windows开放出来的应用程序编程接口(Windows API)往往能使我们事半功倍。而且往往有些操作不可避免的需要使用Windows的内部函数。
Microsoft在MSDN上将每个Windows函数的原型和使用方法(基于C++)都公布出来了。

(小技巧:在已知函数名的情况下可以百度或Google“函数名 function (Windows)”获得其在MSDN中的页面。)

怎样阅读并使用Windows API?

以ShellExecute函数为例:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx

函数原型句法(Syntax):

Continue Reading…

Microsoft Online Test for Core Technical Positions 4: Most Frequent Logs

Time Limit:10000ms
Case Time Limit:3000ms
Memory Limit:256MB

Description

In a running system, there are many logs produced within a short period of time, we’d like to know the count of the most frequent logs.

Logs are produced by a few non-empty format strings, the number of logs is N(1<=N<=20000), the maximum length of each log is 256.

Here we consider a log same with another when their edit distance (see note) is <= 5.

Also we have a) logs are all the same with each other produced by a certain format string b) format strings have edit distance  5 of each other.

Your program will be dealing with lots of logs, so please try to keep the time cost close to O(nl), where n is the number of logs, and l is the average log length.

Note edit distance is the minimum number of operations (insertdeletereplace a character) required to transform one string into the other, please refer to

http://en.wikipedia.orgwikiEdit_distance for more details.
Continue Reading…