七月 23 2010

自动检测COM口分配情况的方法讨论

          要想让程序自动检测到插入的USB转UART设备的COM端口号,就需要通过查询注册表的方式来获得。当某台PC安装了USB转UART设备的驱动之后,第一次插入设备,会在下列注册表的位置建立新的文件夹以存储相应的端口:

          HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Control/Class/{4D36E978-E325-11CE-BFC1-08002BE10318}

          其中文件夹“0000”表示COM1,“0001”表示COM2,依次类推。

          每个端口文件夹中包含有两个关键的键值,一个为“DriverDesc”为端口驱动描述,对于CP2102的驱动来说,该键值会显示“CP210X USB to UART Bridge Controller”。相同驱动的设备,无论插入多少个,该键值都一样。

          当插入多个设备时,就要靠键值“SavedInstanceNumber”来判断依次分配的端口。该键值为“0”的端口分配给最先插入的该类设备,键值为“1”的端口分配给第二个插入的该类设备,依次类推。

          创建端口的顺序是从端口号最小的未使用的端口开始创建。假设计算机已经存在COM1、COM3、COM4和COM6,则插入三个设备,会依次分配COM2、COM5和COM7。

          如果要实时监控设备,则需要用到WDM模型中的DriverEntry方法,由于涉及核心编程,待研究后再讨论。

七月 22 2010

中关村奸商啊

        前段时间在北京陪同学去买电脑,遇到了中关村e世界的奸商。价格差距倒不大,其实也没怎么受骗,但是就是好好的买卖,愣是被那个销售说的心里难受跟上当了一样。那个搞销售的,满嘴巴拉屎,真叫个恶心。总之,买电脑最好选好买家,先交订金,不要直接付全款。

        再鄙视一下,祝中关村早日萧条,关门大吉,免得练就一批厕所来的销售,满嘴喷粪,污染环境和心情。

七月 09 2010

朱师兄,一路走好

       最近出了大事儿,身边认识的人被人谋财害命。那就是高我一级的朱胜伟师兄。事情一出,我才发现,原来谋财害命的事儿,真的不是只有在新闻中和电影中才有的,那么真切的发生在了师兄身上,一个生命,蓦然的消失了。

        师兄高我一级,由于教研室的制度,我上了研二才认识了师兄。彼时大家都已近搬去了新校区,在一起的时间变得很多,于是很快就互相熟悉了。常常一起在实验室偶尔打一把游戏,师兄通常都是一拨的领头者,而我,通常都是大家的经验书。虽然爱玩儿,但是师兄的论文还是做得很好。后来,实验室一个小伙失踪,师兄也是陪着我们整天到处寻找。临近毕业,师兄还将我叫去他宿舍,送了我很多东西,包括一个漫步者的音箱。原本我毕业的时候准备送给师弟们,结果阴差阳错他们都不要,于是我千里迢迢将音箱带回了家。现在,却成了我唯一的师兄的纪念品。

        但就是这样一个善良并且聪明的师兄,被一个凶残的凶手杀害了,被一个与他无冤无仇的人剥夺了活着的权利。虽然凶手已经落网,但是千刀万剐也无法弥补那些爱着师兄的亲人和朋友们心中的创伤。当得知噩耗的时候,我脑中想起师兄那酷酷的表情,那低调却充满幽默的言语。师兄,你一路走好!

七月 05 2010

ZZ何毓琦:For young scholars - How to wrtie a technical paper

 

On Writing a Technical Paper

There is a joke that a technical paper published in a professional journal is read on the average by five persons – the author, the editor, and the three reviewers of the paper. This is not far from the truth because most technical papers are difficult to understand and follow even for the professionals. This does not even take into account the other approximately three times of the amount rejected due to poor writing and incomprehensibility. 

Thus, if the purpose of your writing a paper is to have it accepted AND to have your ideas widely known, then special care must be taken to write the paper. It is worth remembering that three entirely separate, different , and equally important tasks are:

1. having a good idea and work out the required analysis, experimentation, and verifications.

2. devising a powerpoint presentation that can impress your audience and "sell" your ideas.

3. write a technical paper of archival quality that will be read and referenced by others; and in some rare instances, stand the test of time.

Most young or beginning authors consider #1 to be 90% of a technical person's effort. Tasks #2 and #3 are considered as unpleasant and minor exercises unworthy of much attention. When most authors undertake tasks #2 and #3, they tend to follow the recipe of recording their stream of conscious thought – a totally self-centered experience. However, if tasks #2 and 3 are to be accomplished successfully, the effort must be READER- or AUDIENCE-CEDNTERED. We have discussed the "how-to" for #2 elsewhere [see Introduction To The World Of Science For Young Scholars, Y.C. Ho, et al Tsinghua University Press 2004]. This short article is devoted to task #3. 

There are generally three types of readers for your paper. First type is the reader who only wish to find out if the paper contains material of interest to him. A well written abstract is what you need here. Generally, as far as transmitting contents are concerned, short paragraphs is much more difficult than long texts (Recall here the famous quote attributed to Samuel Johnson who apologizes for writing a long letter because he does not have the time to write a short one.) Thus do not dismiss this as a simple task. Secondly, there are readers who is only interested in the basic idea and/or history of the paper but not necessarily the detail "nuts and bolts" of the paper. S/he is willing to spend sometime reading the introductory section or two to accomplish his/her goal.  You do this using everyday not technical language so that the maximal number of readers can follow your text. Remember an average reader can retain the definition and meaning of only four or five mathematical symbols at anytime . Thus use mathematics only when absolute necessary in introductory sections and these must be repeatedly reinforced later on. Appeal to intuition and common sense to convey the big picture here and avoid details like the plague. The second type of reader may stop reading after the introductory sections either because s/he got what they wanted or decided that s/he has no more interest to read further. Ineither case, s/he will thank you for not waste his/her time which is often the most precious resources a scholar possesses. Even if you are the third type of reader who is interested in all the gory details, a well written introductory sections will have properly prepared you to follow the details. A map reading metaphor is appropriate here. If you have a clear picture of the general geography of an area in terms of major roadway and sign posts, then it is much more difficult to get lost and easier to follow a detail map. Several of the advices and techniques discussed in carrying out task #2 in the above reference are also conceptually applicable for writing the introductory sections. Finally. when you write for the third type of detail oriented reader, you still need to differentiate important details from those that are side issues or branches of thought. Thus, you often see a theorem or result precisely stated and its significance carefully explained. But the proof of the theorem or the detail derivation is relegated to an appendix. The principle to observe here is that you want the reader to follow the details in one smooth reading without constantly pausing to think, backtracking, remembering a particular definition several pages earlier, (or worse, to have to read another paper referenced) and any act that interrupts the thought you want him to follow as you develop your text.

To get a paper accepted, you must win the approval of the reviewers of your paper. They are not willing readers of your paper. They are forced to be reader type number three. Thus, the more you make their job easier, the better impression you will make. You may also want to go a step beyond a reader-centered writing by becoming reviewer-centered. Again this is discussed elsewhere in the above reference. The main point is that "walk in other people's shoes".

Other specific comments:

o Don't over inflate your claims or over promise what is to come in your introductions. It is bad form and often you live to regret it.

o Give proper credit and reference to others. Don't be stingy.

o Don't turn one paper into three slightly different versions of the same idea. You can give a good presentation talk several times. But publishing essentially the same paper several times is bad form.

o Do not submit a paper to several journals at the same time in the hope of increasing the chance of acceptance. This is unethical and waste valuable reviewers' time which are always in short supply. .Editors will hate you for it. Unfortunately, at least in areas I am familiar with, Chinese authors have already acquired a bad international reputation for doing this.  

The discipline of mathematics has her own set of traditions and protocol for writing mathematical papers. This note applies only to scientific and engineering type of technical papers.

本文引用地址: http://www.sciencenet.cn/m/user_content.aspx?id=4939

 

七月 03 2010

记录一下荷兰战胜巴西

2010年7月2日晚10:00(北京时间),务实而又流畅的荷兰队,战胜了脚下肮脏,挟持裁判,最终落败的丑陋巴西。特此纪念。