導入自 renren

From: Bill Gates

’-- Sent: Sunday, January 24, 1999 8:41 AM

Jeff Westorinon; Ben Fathi ;

TO: Carl Stork (Exchange); Nathan Myhrvofd; Eric Rudder

Subject: ACPI extensions

One thing I find myself wondering about is whether we shouldn’t try and make the "ACPI" extensions somehow Windows specific.

It …

導入自 renren

據說是一道微軟的面試題。如題,寫程序,讓Windows的任務管理器中的性能監視器呈現正弦曲線。

正弦曲線 正弦曲線

潛心鑽研良久,得代碼:(java)

public class sincpu {
    private static final int cycle=1024,tick = 256;
    public static void main (String[] args) throws InterruptedException {
        for(int i = 0;;i++){
            work(calcNextSleep(i % cycle));
            sleep(tick - calcNextSleep(i % cycle));
        }
    }

    private static long calcNextSleep(long i){
        return (int …