下面是对 CSDN 上网友的一些问题的答复. 根本不算什么文章, 只是放在这里躲过 blog.joycode.com 的主页.

看你精力很充沛,不分日夜地都能看到你,你一天睡几个小时

I'm a normal person, so I need about 6 to 8 hours of sleeping a day. But I am posting on CSDN, I could be either at home or at work, that makes it seems longer. Tell you a secret, saucer(思归/MVP)  needs much less sleep than me.

How many years have you spent in programming

I entered college in the spring of 1978, so around 1980 I started programming using Algol 60 on made-in-China DJ-709 machine. I went to Singapore in 1991, to work on an embroidery CAD software. I have been making a living as software engineer ever since. 

How long did it take you to write the book "Windows Graphics Programming Win32 GDI and DirectDraw

The book took two years to published from the time I wrote publisher a book proposal. But the actual time I spent on writing is about one year, around 2000 hours. Basically, for every week, I work 40 hours for HP, and 40 hours on my book. This means four hours on weekdays and ten hours on weekends for a whole year. 

要进微软要什么条件

That is hard to say in a few sentences. My impression is that Microsoft hires two kinds of people, new college hires straight out of shool and experienced engineers. For experienced engineers, normally you need to be a good programmer and be quite good in certain area. For example, the group I'm working for now has quite a few openings for someone knowlegable about GDI/DDI/printer driver/printer languages. If you happen to have worked in those areas, those jobs are not hard to get.

Also remember that, software design engineer is just one class of job at Microsoft. The other two big classes of jobs are software design engineer in test and program manager. 

Can you introduce MS to us? including the culture, work style and life. In addition, tell us how to be eligible to join MS

I will write something here when I have time, may be this weekend.

程序员到底应以什么为目标:技术还是以技术为基础的服务

It depends on what do you want to achieve in your life and your accessment of your own ability. Some people would like to stay technical. Some people want to stay half technical and half management; some people want to go to management or even start his/her bussiness as soon as possible. You may even adjust your goal from time to time, adjust to your other needs like family.

不知道该继续读书好,还是工作好

It depends on your current situation and long term plan. If your goal is getting a software engineer job, get a job first if you already have a bachelaor degree if you can find a suitable one. If your goal is becoming a professor or researcher, get a master degree or Ph.D degree will be needed. If job is hard to find and further education will enhance your chance of getting a better job, continue your education. The most important thing is do not waste your time, spend time on things which will improve your ability to prepare you for your future career.

还会说中文吗

中文当然会说, 不过大不如前, 何况我打汉字很慢. 另外我觉得对学计算机的人, 英文非常重要, 所以我也想逼大家多用英文.

说说你成功的秘诀

先听听真正成功的人: http://www.kaifulee.com/

What is the fastest way to copy a large block of memory on Intel CPU

For large block of memory, DWORD aligned DWORD copy is normally the fastest way to copy memory. But loading/storing 8-bytes at a time on 64-bit boundary using floating point register is even faster. For details, check http://www.agner.org/assem/.

As a software engineer, you do not need to know the exact line of assembly code to do that. But you need to have the basic idea and be able to find places for possible performance improvement during your design, coding and code review. Similar programs will arise a lot in image processing software, low-level graphics routines, printing, etc.

How do you calculate pi to 1 million digits

First, you need a formula to calculate pi. One commonly used formula is pi = 16 * arctan(1/5) - 4 * arctan(1/239). Then you can expand arctan using Taylor expansion. For final implementation, use an array to store a million digit number, and you only need to implement a few simple operations on it.

To get the formula, suppose tan女孩 = 1/5, calculate tan(2x) = (1/5 + 1/5) / ( 1-1/25) = 5/12, tan(4x) = 120 / 119.

Because 120/119 is little bit over 1, tan(45 degree), we can assume tan(45 degree + y) = 120 / 119, so tan太棒了 = 1/239.

So 4x = 45 degree + y, 45 degree = 4x - y = 4 * arctan(1/5) - arctan(1/239), as 45 degree is pi/4. we get

                                                           pi = 16 * arctan(1/5) - 4 * arctan(1/239).

For software engineers, mathematical skill like shown here is essentail. Programming is basic a form of algebra. When you're writing programs, you are writing symbolical formulas which you need to prove to be right, mentally or through testing or both.