Posted in 2005

Free MSDN Visual Studio 2005 Team Suite with MSDN Premium Subscription for awardee of Microsoft Award for of Customer Excellence/ Microsoft MVP?

Weeks ago I got an email promising free Visual Studio 2005 if I qualify for the Microsoft Award for Customer Excellence from www.microsoft-ace.com, which, according to some Microsoft employees, is a genuine Microsoft program website, but is also registered by a third party, and has a problem with the SSL certificate.

Today, I got a UPS package with 3 Visual Studio Team System with MSDN Premium redemption cards and a Microsoft-watermarked paper stating “thank you for your passionate support for VSTS”… but from www.mvpinvite.com, another website registered by 3rd party and seems has something to do with my MVP membership? So confusing…

Read more ...


jiangsheng的CSDN统计数据

CSDN帐号:jiangsheng

注册时间:2000-4-29 0:09:00

目前是:.NET技术 VC.NET 小斑竹
目前是:VC/MFC 大斑竹
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
截至目前,得分在100分以上的大板块依次是:
Web 开发 得专家分 665
专题开发/技术/项目 得专家分 1862
Windows专区 得专家分 551
扩充话题 得专家分 3555
其他开发语言 得专家分 1417
VC/MFC 得专家分 145304
VB 得专家分 5356
.NET技术 得专家分 8083
Delphi 得专家分 5609
Java 得专家分 760
C++ Builder 得专家分 3246
C/C++ 得专家分 1654
PowerBuilder 得专家分 185
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==================================================================
微软技术社区每月发帖量统计
2001年07月 1
2001年09月 1
2002年01月 4
2002年04月 1
2002年05月 1
2002年06月 3
2002年10月 1
2002年11月 1
2003年12月 1
2004年04月 2
2004年06月 1
2004年07月 1
2005年04月 1
2005年08月 1
2005年10月 1
微软技术社区每月回复量统计
2000年04月 3
2000年05月 4
2000年06月 15
2000年07月 4
2000年08月 27
2000年09月 13
2000年12月 1
2001年03月 7
2001年05月 3
2001年07月 4
2001年08月 1144
2001年09月 848
2001年10月 296
2001年11月 273
2001年12月 127
2002年01月 378
2002年02月 220
2002年03月 320
2002年04月 459
2002年05月 390
2002年06月 316
2002年07月 305
2002年08月 143
2002年09月 95
2002年10月 128
2002年11月 156
2002年12月 112
2003年01月 124
2003年02月 31
2003年03月 105
2003年04月 193
2003年05月 152
2003年06月 166
2003年07月 150
2003年08月 95
2003年09月 167
2003年10月 184
2003年11月 185
2003年12月 277
2004年01月 240
2004年02月 45
2004年03月 246
2004年04月 89
2004年05月 114
2004年06月 332
2004年07月 441
2004年08月 301
2004年09月 288
2004年10月 205
2004年11月 330
2004年12月 344
2005年01月 279
2005年02月 144
2005年03月 231
2005年04月 292
2005年05月 200
2005年06月 213
2005年07月 416
2005年08月 290
2005年09月 152
2005年10月 290
2005年11月 422
2005年12月 251
微软技术社区每月得专家分统计
2000年05月 40
2000年06月 180
2000年07月 30
2000年08月 165
2000年09月 126
2000年10月 50
2000年11月 80
2000年12月 30
2001年03月 6
2001年04月 20
2001年05月 20
2001年06月 20
2001年08月 3159
2001年09月 3300
2001年10月 1324
2001年11月 1727
2001年12月 1765
2002年01月 2086
2002年02月 1420
2002年03月 2445
2002年04月 4555
2002年05月 5358
2002年06月 3544
2002年07月 4576
2002年08月 3966
2002年09月 1854
2002年10月 1737
2002年11月 2203
2002年12月 2157
2003年01月 1750
2003年02月 484
2003年03月 1220
2003年04月 2357
2003年05月 2444
2003年06月 2913
2003年07月 2329
2003年08月 1634
2003年09月 3558
2003年10月 3049
2003年11月 2985
2003年12月 4367
2004年01月 2619
2004年02月 1330
2004年03月 3429
2004年04月 1839
2004年05月 763
2004年06月 3522
2004年07月 5204
2004年08月 3897
2004年09月 6338
2004年10月 2372
2004年11月 3846
2004年12月 3962
2005年01月 3350
2005年02月 2461
2005年03月 3598
2005年04月 3392
2005年05月 2427
2005年06月 2803
2005年07月 4835
2005年08月 4879
2005年09月 3277
2005年10月 2607
2005年11月 5535
2005年12月 2738
微软技术社区每月解决问题数统计
2000年05月 1
2000年06月 8
2000年07月 1
2000年08月 6
2000年09月 6
2001年03月 2
2001年08月 260
2001年09月 182
2001年10月 67
2001年11月 65
2001年12月 47
2002年01月 82
2002年02月 63
2002年03月 97
2002年04月 156
2002年05月 132
2002年06月 98
2002年07月 97
2002年08月 60
2002年09月 40
2002年10月 37
2002年11月 52
2002年12月 36
2003年01月 52
2003年02月 14
2003年03月 35
2003年04月 69
2003年05月 55
2003年06月 68
2003年07月 59
2003年08月 45
2003年09月 66
2003年10月 79
2003年11月 63
2003年12月 121
2004年01月 96
2004年02月 21
2004年03月 104
2004年04月 31
2004年05月 44
2004年06月 159
2004年07月 206
2004年08月 148
2004年09月 143
2004年10月 85
2004年11月 179
2004年12月 155
2005年01月 124
2005年02月 71
2005年03月 112
2005年04月 131
2005年05月 81
2005年06月 91
2005年07月 191
2005年08月 128
2005年09月 72
2005年10月 110
2005年11月 162
2005年12月 62
==================================================================

Read more ...


Win32 & .Net Q&A 200512

I would like to keep tracking some interesting CSDN discussions, but sometimes I can not find them due to the limit of the CSDN favorite and the CSDN full text search. So again I list some interesting discussions here. For details about the discussion, go to http://search.csdn.net and search posts by their topics. For previous Q&A discussions

MSXML4的文档对象的async属性默认是真,这时候Load是异步的,要等待对象触发事件再访问文档内容。也可以把文档的async属性设置成false切换到同步模式,这样Load调用之后就可以读DOM了。

Read more ...


整理旧照片……

Source: http://www.flickr.com/photos/jiangsheng/sets/1514328/show/

2004年4月微软MVP峰会前参观上海微软

image1

2005年西雅图微软MVP峰会华人MVP于微软会议中心

image2

插队……趁金雪根和黄际洲没注意……

image3

测试黄际洲和地心之间的引力

image4

2005年9月西雅图微软MVP峰会 陈本峰 孙鹏 陈缘 蒋晟

image5

2005年西雅图MVP峰会 Visual C++ MVP

image6

后面那个是来宣传MSBuild的……

2005年9月MVP峰会MVP Party 蒋晟于Space Neddle门口

image7

2005年微软MVP峰会间隙加紧学习圣经

image8

2005年9月MVP峰会MVP Party 黄际洲 蒋晟于Space Neddle门口

image9

蒋晟 孙鹏 陈本峰 2005年9月29日于微软园区

image10

蒋晟2005年9月于微软会议中心前……沉思……

image11

蒋晟2005年9月于微软会议中心前

image12

蒋晟 孙鹏 陈本峰 陈缘 微软会议中心前合影

image13

2005年9月29日微软全球峰会

照人者恒被人照

image14

但是Grace也被牵连进来了……

Read more ...


Nomination of Microsoft Award for Customer Excellence

Dear Sheng Jiang, Thank you for being a great contributor to Microsoft Visual Studio 2005. You have been nominated to receive the Award for Customer Excellence. This award recognizes your extraordinary contribution to the Visual Studio 2005 product and will be shipped to you without charge.  Please click the following link to arrange shipment of your award: (link omitted) Should you have any questions about this award, please contact (email omitted). All the best, S. Somasegar Corporate Vice President, Microsoft Developer Division

However, I’v already got VS2005 from my one year free MSDN Premium Subscription (for Visual Studio 2005), as a part of Microsoft Most Valuable Professional Award package. It may be better if they put something else in the ACE award package …

Read more ...


MSN messenger exceeds capacity

This is the first time I get this message when trying to sign in to MSN messenger service

We can’t sign any more people in right now. Please try signing in again later.

Click below to sign in:

It seems Microsoft may need more servers now…

Read more ...


从Sony招回含疑似间谍软件的CD说起

面对消费者日益严重的不满,Sony BMG害怕自己的正版音乐产品受到版权保护“后门”的影响,于今天宣布撤回商店货架内所有涉及Rookit软件的CD产品,并为消费者提供免费的非DRM版CD更换。 http://computer.online.sh.cn/computer/gb/content/2005-11/16/content_1380298.htm

关于这个软件包含的安全性和稳定性问题,参考`Sony <http://www.sony.com>`__,`Rootkits <http://en.wikipedia.org/wiki/Rootkit>`__ and Digital Rights Management <http://en.wikipedia.org/wiki/Digital_rights_management>`__Gone Too Far http://www.365key.com/forward.aspx?id=1286254 以及 `More on Sony: Dangerous Decloaking Patch, EULAs and Phoning Home http://www.365key.com/forward.aspx?id=1286280

Read more ...


Find and replace specific formatting in Word 2003

In Microsoft Word 2003, you can replace text as in other programs. However, you can replace line breaks, graphics, and special formats as well. For example, to seperact and to add a serial number before every sentence, you can replace sentence-ending punctuations, such as periods and question marks, to the same punctuations plus a line break, click the numbering toolbar button, and make some minor manual changes for misreplacement.

Steps to numberize sentences:

  1. Add a empty line to the end of the document by pressing Enter

  2. Select the last line.

  3. On the Edit menu, click Copy.

  4. On the Edit menu, click Replace.

  5. If you don’t see the Format button, click More.

  6. In the Find what box, enter a period.

  7. In the Replace With box, type a period.

  8. In the Replace With box, type “^C”, or Click Special, and select Clipboard Contents

  9. Click Replace All

  10. Repeat step 6-9 for every other punctuation.

  11. Repeat step 6-9 for each common misreplacement, such as Dr. or URL. Use ^C instead of a line break in finding and replacing.

  12. click the numbering toolbar button on the Formating toolbar.

  13. Make manually correction for other misreplacements.

Reference: http://office.microsoft.com/en-us/assistance/HP051894331033.aspx

Read more ...


FAQ:如何在……中获得……的指针(MFC)

问:请问如何在一个全局函数中,获得视图类,文档类得指针啊? 问:如何在一个对话框中,获得视图类,文档类得指针啊?

答:虽然你可以使用AfxGetMainWnd或者AfxGetApp之类的函数来访问全局变量,但是不建议这么做。你应该尽量少使用全局函数和变量以增加代码的可移植性。你可以在对象中声明变量来保存和传递需要使用的对象和指针,调用函数或者创建对象时传递指针。

Read more ...


Visual C++ 2005 中的XML注释

C#程序员可以用三个斜杠来开始XML格式的注释,而且编译器可以据此生成可用于自动生成帮助文档的XML文件。Visual C++ 2005中的编译器也支持了这个功能,而且对非托管函数也生效,前提是必须打开/clr和/DOC开关,并且不能使用/clr:oldSyntax开关编译。

有空的话,多去微软的反馈中心提提对产品的建议是很有好处的……

Read more ...


Talking about Where does power come from?

Quote

The teacher said this confidently: Believe me, ten years later, you will still find those words insightful.
Planning=Power

I do believe so.

People who are able to plan, and to implement the plans which facilitate innovation and change are invaluable.

According to Clementino Mendonca’s speech “The new MSF - competing with development process “, only 16% chaos (unplanned or almost unplanned) software projects were successful. Although I don’t remember the success rate of methodized software projects, I am sure it is much higher than the chaos model.

In China, as far as I know, most “workshop” style software companies use chaos models. It may be improved by using the new Visual Studio 2005 Team System, but I am not sure about it, since other software management products, such as Visual Source Safe, are not widely used in these companies.

See also

Read more ...


How to use Visual C++ with Perl

Microsoft Visual C++ and later do not support perl scripts by default. That is, the Developer Studio does not associate any special significance to perl scripts without being informed otherwise. However, there are several viable options, namely custom build rules, which enable the creation of projects that depend directly upon perl scripts. The remainder of this article discusses the following three methods for adding perl script files to a Visual C++ project:

Using custom build rules

Read more ...


创建和自动化Internet Explorer和资源管理器窗口

下载示例工程 - 34 Kb jiangsheng/Samples

我在很久之前就开始用程序自动化Shell窗口——主要对象是IE窗口。有时浏览器控件或者MFC类CHTMLView可以满足我的需要,但是很多时候我需要从头嵌入浏览器控件并且尽可能模拟IE的行为,例如实现IDocHostUIHandler来启用自动完成功能。一个很自然的替代方案是直接操作IE窗口。

Read more ...


托管C++中函数调用的双重转换(Double Thunking)

在VC.Net中使用默认设置/clr编译时,一个托管函数会产生两个入口点,一个是托管的,供托管代码调用,另外一个是非托管的,供非托管代码调用。但是函数地址,特别是虚函数指针只能有一个值,所以需要有一个默认的入口。

非托管入口点可能是所有调用的默认入口(在 Visual Studio .NET2003 中,编译器总是会选择非托管入口,但是在Visual Studio 2005中,如果参数或者返回值中包含托管类型,那么编译器会选择托管入口),而另外一个只是使用托管C++中的互操作功能对默认入口的调用。在一个托管函数被另一个托管函数调用的时候,这可能会造成不必要的托管/非托管上下文切换和参数/返回值的复制。如果函数不会被非托管代码使用指针调用,那么可以在声明函数时用VC2005新增的__clrcall修饰符阻止编译器生成两个入口。 现在用简单的冒泡排序算法来比较一下使用__clrcall之后的性能改善程度。

Read more ...


西雅图MVP峰会见闻

个人觉得这次MVP峰会最大的进步就是技术相关的Session数量大大增加,按照MVP专长来分类;而不像上次那样按主题分类。我只需要在VC产品组的日程里面选择就可以了,而不是像上回那样不得不去听移动开发。当然这回也有MVP不去参加VC的Session,跑去听IE和移动开发。内容方面也比上次活泼很多,Don Box还是那么幽默,比尔·盖茨也有搞笑的演出,不过他看起来比去年七月份在北京的时候老多了。

一些可能有人会感兴趣的技术信息

Read more ...


Win32 & .Net Q&A 200509

I would like to keep tracking some interesting CSDN discussions, but sometimes I can not find them due to the limit of the CSDN favorite and the CSDN full text search. So again I list some interesting discussions here. For details about the discussion, go to http://search.csdn.net and search posts by their topics. For previous Q&A discussions, see my blogs Win32 & .Net Q&A and VC/MFC Q&A 200407 . A topic may appear in these Q&A blogs more than once, but I will try to cover every interesting discussion if I can.

我们知道在电源选项 属性 里面可以设置

Read more ...


Access your documents from internet.

一个飓风刚走,另一个更大的飓风又来了,这回是直冲本州而来。新奥尔良和休斯敦疏散过来一大堆人,但是这里很可能也得疏散。希望休斯敦不会成为第二个新奥尔良。

原文(英文):http://cn.geocities.com/sheng_jiang/accessdocumentsfrominternet.doc

Read more ...


C++/CLI中的默认属性访问

目前版本的VC2005测试版中,default关键字不仅用于指定类级别的索引器,而且也用于访问默认属性。但是奇怪的是,默认属性的原名不能访问了,也就是说,如果要把下面的代码段从托管C++移植到VC2005附带的C++/CLI,不仅需要更改指针的类型,而且要把属性的名称更改为default:

如果继续使用原来名字来访问属性的话,会报告编译错误:

Read more ...


集成桌面搜索,模拟器

This is a revised version of an earlier blog at http://blog.joycode.com/jiangsheng/archive/2005/07/19/59725.aspx, published July 19, 2005. The source code is available at jiangsheng/Samples

微软的桌面搜索API推出也有一段时间了,但是网上可以找到的相关技术资料还不多。官方的资料在https://web.archive.org/web/20051030062212/http://addins.msn.com/devguide.aspx可以看到,而且网页上有SDK和一个C#的示例供下载。

Read more ...


MFC,欢乐与痛苦

MFC提供了许多十分有用的类和对象,在很多时候在Office插件、BHO、常规DLL这样的工程中加入MFC支持是一个不错的选择。但是,MFC中的很多功能,例如资源查找,消息预处理等等都依赖于在进程或者线程创建时被初始化的MFC内部数据;而对于需要添加MFC支持的工程,这些数据并不会被自动地初始化。

这时候使用一些MFC的功能,例如使用CString从字符串表加载一个字符串,或者使用CDialog::DoModal()创建一个模态对话框,都会有断言错误,用ATL向导创建的支持MFC的程序也没有多少改善,在CWinApp的DLL版本中没有初始化线程数据,所以调用AfxGetThread会返回空指针。解决这个问题的一个办法是使用AfxBeginThread来启动一个MFC线程,这样MFC会初始化线程相关的数据。

Read more ...


PIC 16F88 Microcontroller Servo Controller Project

1) Introduction

The goal of this assignment is to control the position of a servomotor by generate pulses on the output pin for a time specified by various voltage of the input pin of the chip. The voltage should also be displayed by a 7-segment LEDconnected to some output pins of the chip.

2) Overview of the PIC 16F88 Microcontroller

PIC16F88 is a member of the huge Microcontroller Chip Family with 16 I/O pins and 2 power pins. It contains a lot of functions which are abundant to this project. The essential features used by this project are · Programmable Flash

· Data Memory

· Interrupt

· Internal clock and multiple time modules

· A/D Module

Information of other features, such as EPROM access or power management, can be found in the datasheet of this chip, which is available at www.microchip.com.

a) Programmable Flash

PIC16F88 has a 13 bit program counter, which can address 8K*14 addresses, or up to 1FFFh. However, it is paged so that accessing above 4K*14 will cause a wraparound. That is, the actual address is the address masked with 3FFh. The size of the code in this project is far from this limit, however. The starting address after power up, named Reset vector, located at 0000h. The interrupt vector, called by the chip when an interrupt occurs, located at 0004h. Stack memory is hardware implemented, and is indirectly manipulated by some instructions such as CALL and RETURN.

b) Data memory

Similar to IBM-PC, data memory is divided into several parts, called Banks in this chip, and a bank selection must be made before accessing an address outside current bank. Each bank has a 128 bytes extent, and some of them are mapped to the same position for convenience. The lower part of bank is reserved for Special Function Registers, and above them are General Purpose Registers, implemented as static RAM. To reduce bank selection, this project use 70h-7fh, the General Purpose Registers mapped to the same position in every bank. Some Special Function Registers are also accessed to perform tasks such as A/D I/O or timing. Accessing to these registers will be discussed later.

c) Interrupt

An interrupt is generated when predefined condition met, and the chip will make a call to the interrupt vector located at 0004h in the Programmable Flash. Some special flag bit in Some Special Function Registers are set before this call. This project use the A/D, Time0 and Time1 overflow interrupts for asynchronous operation. The general tasks of the interrupt handler are 1. First, disable all interrupt to prevent reentry

2. Save context information, such the value of W register, the Status register and program counter.

3. Check desired flag bits to see if the reveal the desired type of the interrupt occurs, and handle it with the flag bits cleared for future handling.

4. Restore context information to enable the program continues as usual after the interrupt occurs.

  1. At last, enable interrupts to enable future interrupts

d) Internal clock and multiple time modules

The chip comes with 3 timer modules, and 2 are used by this project. TMR0 and TMR1 are prescalable timers with different ranges. The TMR0 register and TMR1H/TMR1L are readable and writeable counter register for these two timers, along with the Status register for synchronous operations. Interrupts are also generated when these counters overflow, and this project use them to invoke asynchronous operations and generate signals with varied time interval.

e) A/D Module

The chip comes with a 10-bit, 7-channel Analog to Digital module to convert input signals to 10 bit digital number. If the module is configured properly, after a flag bit in the ADCON0 register is set, an A/D conversation begins, and when it finishes, the result is placed into A/D result registers, namely ADRESH and ADRESL, and the flag bit is cleared. An peripheral interrupt is also generated to allow asynchronous operations

3) Description of the test circuit

Here is a block diagram in the assignment guideline of this project. Connection specification:

Pin number

Description

Connected to

17

A/D input,  0-5V

Variable voltage

18

Digital output, 33HZ signal

Servomotor

6-13

Digital output

7-segment LED

5

Ground reference

Ground

14

Positive supply

Power

4) Development of the control program

This program is divided into following modules:

  • Initialization module

    • Port A Configuration

    • Port B Configuration

    • Frequency Setting

    • Interrupt Setting

  • Interrupt handler modules

    • A/D Interrupt

    • TMR1 Interrupt

    • TMR0 Interrupt

With the reset and interrupt vector fixed, the program placed a jump instruction at the reset vector, and the destination of the jump is the actual beginning of the program. The program then calls the initialization module, and then enters an infinite loop and is ready for interrupts.

a) Initialization module

This module is spitted into 4 modules. These modules are independent, so they can be composed into one, but they are separated for easier debugging and understanding.

i) Port A Configuration

The task of this module is to set analog input and digital out pins. TRISA register is set to 1, indicates the pin RA0 is set to analog input, and the rest pings on PortA are set to digital output. The ANSEL register is also set to 1 to select RA0 for A/D conversation, and the ADCON0 is set to b’11000001’ in accordance. After the configurations are finished, the first A/D conversation is triggered after a short wait.

ii) Port B Configuration

Because PortB is used for 7-segment LED display, both TRISB and PORTB registers are cleared to display nothing at the beginning.

iii) Frequency Setting

The internal clock is set to 4MHZ, which is specified in the assignment guideline. This is implemented by setting the OSCCON register to b’01101110’.

iv) Interrupt Setting

This project uses 3 interrupts, A/D, TMR0 and TMR1. A/D is used for A/D conversations, TMR1 for a 33HZ signal generator, and TMR0 for pulses. INTCON and PIE1 are configured to enable these interrupts, and T1CON and OPTION_REG are used to scale TMR0 to 1:16, and TMR1 to 1:1. TMR1L and TMR1H are initialized so that the first TMR1 overflow interrupt will occur 1/33 second later, and the timers are started when the configurations are done.

b) Interrupt handler modules

After necessary tasks of the interrupt handler are done, the flags bits of interrupts will be checked. If a flag bit of an interrupt is set, a corresponding handle routine will be called. Routinely interrupt handler tasks will be performed at last.

i) TMR1 Interrupt

Both the initialization and the handler routine set TMR1H and TMR1L to 35233 to ensure the overflow interrupt will occur after 30303 cycles, or 1/33 seconds, thus generate a 33HZ clock. For convenience, a high pulse signal output for the Servomotor and an A/D conversation request is also placed here. In other words, the pulse is set to high every 1/33 seconds, and the A/D conversation is also triggered every 1/33 seconds. The TMR0 timer is also enabled to set the pulse to low after a period of time. This period is calculated after the voltage is read.

ii) A/D Interrupt

This interrupt handler does the heaviest job in the program. First, it copy the digitalized voltage into user defined variable named AnalogResultH and AnalogResultL, and AnalogResultL is abandoned since a continuum specified by AnalogResultH is enough. Then the duration of the high stage of the output pulse and the LAD output will be calculated. According to the document of the Servo, a high stage of 0.36ms will cause the Servo turn to left, and 2.3 ms will cause it to turn right. Suppose the A/D result 0 means left, and 255 means right, then the duration of the high stage can be calculated by the following formula: Duration       = 0.36+AnalogResultH/256 * 1.94 ms = 360+AnalogResultH*1,940/256   cycles to store the duration in TMR0, we need to prescale it to fit. The upper bound of it is 2.3 ms, or 2,300 cycles. To make the maximum duration fit into a byte, the timer need to be prescaled to 1:16. Duration =360/16+(AnalogResultH/256) *(1,940/16) ticks =22.5+ AnalogResultH/256* 121.25 ticks Of course I can not do it with such precision with the little instruction set of the chip. Round downs are inevitable Duration ≈22 + AnalogResultH/256*121 ≈22 + -AnalogResultH/64 -AnalogResultH/128 -AnalogResultH/256 So, to make the TMR0 overflows Duration ticks after the TMR1 interrupt rise the pulse signal, the TMR0 register must be set to TMR0           =256- Duration. This result is stored in a variable named Time0Interval, and is used by the TMR1 interrupt handler routine. This routine also scales the analog result to one digit value and displays it on a 7-segment LED. It is done by getting the high 4 bits of the high byte of the analog result.

iii) TMR0 Interrupt

This interrupt handler routine merely turn the TMR0 interrupt off, and output a low signal to end a pulse. ** **

5) Overview of testing done before burning the chip

The test is done in the emulator. After loading the program into emulator, and execute it, it reads the value set on RA0, and output a pulse every 1/33HZ.

Read more ...


Microchip PIC16F88A Emulator Project

Resources:

document

PIC16F88 resource center

USB driver in order to communicate with the board http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm#VCP

driving guide of the servo from a robotics project that used the Motorola 68HC11 microcontroller http://www.austincc.edu/rblack/COSC2425/Lectures/Day27/servo.pdf

Read more ...


Visual Studio 2005中MFC的变化

关于新功能的说明 http://msdn2.microsoft.com/library/y8bt6w34(en-us,vs.80).aspx

一些源代码的变化:

Read more ...


Use windbg as an external tools of Visual C++

在我的前一篇BLOG(使用WinDbg调试VC程序)中我提到了如何使用WinDbg来调试Visual C++程序。但是从IDE到命令行之间的切换比较麻烦,为了偷懒起见,可以把WinDbg加到Visual Studio的工具菜单中,这样就可以直接从IDE启动WinDbg来进行调试了。下面是外部工具配置界面的设置

标题 : WinDbg

Read more ...


Error 3e6 with WriteFile

It looks like you will get error 3E6 when you call write file with an address not aligned to DWORD.

Update: Raymond Chen explained the reason in his blog https://devblogs.microsoft.com/oldnewthing/20250605-00/?p=111250, basically Windows SDK requires aligned pointers, except for those decorated with UNALIGNED. E.g.

Read more ...


Lab5 Step4

;=====================================================================
; DrawLine.asm - help routine to draw table lines
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/24/05
;=====================================================================
 INCLUDE lab5.inc
 .Code
DrawTableLine  PROC   USES eax ecx esi,
 _TableWidth : DWORD,
 beginChar : BYTE,
 textBuffer:PTR BYTE,
 textLen :DWORD,
 fillChar:BYTE,
 endChar:BYTE
 LOCAL printtextlen : DWORD, totalTextLen :DWORD
 mov  eax,_TableWidth
 sub  eax,2
 mov  totalTextLen,eax   ;totalTextLen=_TableWidth-2
 .IF(totalTextLen>0)
  ;beginChar, the left border
  mov   al,beginChar
  call  WriteChar

  ;cut the text if it is too long
  ;printtextlen=min(_TableWidth-2,textlen);
  mov   eax,textLen
  .IF(eax>totalTextLen)
   mov eax,totalTextLen
   mov printtextlen,eax ;overflow
  .ELSE
   mov printtextlen,eax
  .ENDIF
  mov   ecx, printtextlen

  ; print the text part
  mov  esi,textBuffer
DrawTableLinePrintText:
  ;if no text left,jump to fill the line
  jcxz DrawTableLineFillLine
  mov  al,byte ptr [esi]
  call  WriteChar
  inc  esi
  loop DrawTableLinePrintText

DrawTableLineFillLine:
  ;fill the rest of table line
  ;will _TableWidth-2-printtextlen fillchars
  mov  ecx,totalTextLen
  sub  ecx,printtextlen
  mov  al,fillChar
DrawTableLineFillLineLoop:
  ;if no text left,jump to end the line
  jcxz DrawTableLineFillEndLine
  call WriteChar
  loop DrawTableLineFillLineLoop
DrawTableLineFillEndLine:
  mov  al,endChar
  call WriteChar
  call Crlf
 .ENDIF
 ret
DrawTableLine ENDP

 END;

=====================================================================
; drawwrap.asm - help routine to draw table lines
; wrap to seperate lines if the text is too long, or delimiters were found in the text
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/24/05
;=====================================================================
 INCLUDE lab5.inc
 .Code
DrawTableLineWithWrap PROC USES eax edx esi edi,
 _TableWidth : DWORD,
 beginChar : BYTE,
 textBuffer: PTR BYTE,
 textLen :DWORD,
 fillChar:BYTE,
 endChar:BYTE,
 _Delimiter:BYTE
 LOCAL EndOfBuffer:PTR BYTE,  ; stop point of a buffer;textBuffer+textLen-1
 EndOfLineWrap:DWORD,    ; stop point of a line;_TableWidth -3
 curlinebase:PTR BYTE ,    ; pointer to the beginning of the current line
 curlineLen:DWORD,    ; length of the current line
 bTerminate:BYTE,    ; stop scanning
 bDelimiter:BYTE     ; include the current char in printing or not

 ;edi=esi=textBuffer;
 ;while(!bTerminate)
 ;{
 ; if(edi==EndOfBuffer){bDelimiter=(_Delimiter==[edi];bTerminate=TRUE;}
 ; else if([edi]==’’){bDelimiter=TRUE;bTerminate=TRUE;}
 ; else if([edi]==_Delimiter)
 ; {
 ;  if(edi==curlinebase){edi++; curlinebase=edi;continue;}//skip leading delimiters
 ;  else bDelimiter=TRUE;
 ; }
 ; else if(edi==curlinebase+_TableWidth -3) /*wrap*/{bDelimiter=FALSE;}
 ; else {edi++; continue;}
 ; DrawTableLine(_TableWidth ,MLBORDER,curlinebase,bDelimiter?edi-curlinebase:edi-curlinebase+1,FILLSPACE,MRBORDER);
 ; edi++;
 ; curlinebase=edi;
 ;}
 mov   esi,textBuffer
 mov   edi,esi
 mov   eax,esi
 add   eax,textLen
 sub   eax,1
 mov   EndOfBuffer,eax
 mov   eax,_TableWidth
 sub   eax,3
 mov   EndOfLineWrap,eax
 mov   bTerminate,0
 mov   bDelimiter,0
 mov   curlinebase,esi
 .WHILE(bTerminate==0)
  mov eax,curlinebase
  add eax,EndOfLineWrap
  mov dl,byte ptr [edi]
  .IF(edi==EndOfBuffer)
   mov bTerminate,1
   .IF(dl==_Delimiter)
    mov bDelimiter,1
   .ELSE
    mov bDelimiter,0
   .ENDIF
  .ELSEIF(dl==0)
   mov bDelimiter,1
   mov bTerminate,1
  .ELSEIF(dl==_Delimiter)
   mov bDelimiter,1
  .ELSEIF(edi==eax)
   mov bDelimiter,0
  .ELSE
   inc edi
   .CONTINUE
  .ENDIF
  mov eax,edi
  sub eax,curlinebase
  .IF(bDelimiter==0)
   inc eax
  .ENDIF
  mov curlineLen,eax
  invoke DrawTableLine, _TableWidth,beginChar,curlinebase,curlineLen,fillChar,endChar
  inc edi
  mov curlinebase,edi
 .ENDW
 ret
DrawTableLineWithWrap ENDP
END;
=====================================================================
; lab5.asm - build a program that displays the Fibonacci numbers for a user defined input upper bound
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/21/05
;
;=====================================================================


 INCLUDE lab5.inc

    ;costants

 .Data
 menuSelection     BYTE 0
 menustring      BYTE “Menu| |Press [I] to Display program instructions|Press [N] to enter an integer number (0 - 20)|Press [F] - Display the first N Fibonacci numbers on the console|Press [X] - Quit the program”,0
 menustringLen     DWORD $-menustring
 menuDelimiter     BYTE “|”
 menuPromptstring    BYTE “Enter your selection(upper case or lower case)[I/N/F/X]:”,0
 instructionString    BYTE “This program displays the Fibonacci numbers for a user defined input upper bound(up to 20)|Type N to input the number, and type F to display results.”,0
 instructionStringLen   DWORD $-instructionString
 numberPromptstring    BYTE “Enter a upper bound (0-20) and press ENTER:”,0
 invalidNumberPromptstring  BYTE “only numbers from 0 to 20 are allowed”,0
 ExitPromptstring    BYTE “Exiting…”,0
 invalidSelectionPromptstring BYTE “Invalid selection. the selection must be one of I/N/F/X”,0
 ShowFibPromptString    BYTE “The requested Fibonacci numbers are:”,0
 ExitFlag      BYTE SHOWMENU_CONTINUE
 isNumberEntered     BYTE 0
 number       SDWORD ?
 PUBLIC  menustring
 PUBLIC  menuDelimiter
 PUBLIC  menustringLen
 PUBLIC menuPromptstring
 PUBLIC ShowFibPromptString
 .CODE


;invoke WriteFile,hOutPut,lpszText,sl,ADDR bWritten,NULL
main  PROC
   .REPEAT
    invoke ShowMenu,offset menuSelection
    mov  ExitFlag,al
    ;toupper(menuSelection)
    .IF(menuSelection>’Z’)
     mov al,menuSelection
     sub al,32
     mov menuSelection,al
    .ENDIF
    .IF(menuSelection==’I’)
     call Clrscr
     invoke DrawTableLine,TABLEWIDTH,ULCORNER,0,0,HBAR,URCORNER
     invoke  DrawTableLineWithWrap,TABLEWIDTH, VBAR,OFFSET instructionString,instructionStringLen,BLACKSPACE,VBAR,menuDelimiter
     invoke DrawTableLine,TABLEWIDTH,LLCORNER,0,0,HBAR,LRCORNER
     call Crlf
    .ELSEIF(menuSelection==’N’)
     call Crlf
     mov isNumberEntered,0
     .REPEAT
ReadNumber:
      call Crlf
      mov  edx,offset numberPromptstring
      call WriteString
      call ReadInt
      jno  ReadNumberSuccess
      call Crlf
      mov  edx,OFFSET invalidNumberPromptstring
      call WriteString
      call Crlf
      jmp  ReadNumber   ;go input again
ReadNumberSuccess:  ;validate number

      .IF(eax>20)
       mov isNumberEntered,0
      .ELSEIF(eax<0)
       mov isNumberEntered,0
      .ELSE
       mov isNumberEntered,1
       mov  number,eax   ;store good value
      .ENDIF

      .IF(isNumberEntered==0)
       mov  edx,OFFSET invalidNumberPromptstring
       call WriteString
       call Crlf
       .CONTINUE
      .ENDIF
     .UNTIL(isNumberEntered)
    .ELSEIF(menuSelection==’F’)
     invoke ShowFibonaccinumbers,number
    .ELSEIF(menuSelection==’X’)
     call Crlf
     call Crlf
     mov  edx,OFFSET ExitPromptstring
     call WriteString
     call Crlf
    .ELSE
     call Crlf
     call Crlf
     mov  edx,OFFSET invalidSelectionPromptstring
     call WriteString
     call Crlf
    .ENDIF
   .UNTIL(ExitFlag==SHOWMENU_EXIT)
   exit
main  ENDP
   END  main;
=====================================================================
; lab5.inc - build a program that displays the Fibonacci numbers for a user defined input upper bound
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/24/05
;=====================================================================
 .386
 option casemap:none
 ; —————————————————————–
 ; include files that have MASM format prototypes for function calls
 ; —————————————————————–
 INCLUDE Irvine32.inc
 ; ————————————————
 ; Library files that have definitions for function
 ; exports and tested reliable prebuilt code.
 ; ————————————————
 includelib gdi32.lib
 includelib user32.lib
 includelib kernel32.lib
 includelib Irvine32.lib
 ;constants
 CR EQU 0Dh
 LF EQU 0Ah
 TABLEWIDTH EQU  79
 HBAR        EQU  196
 VBAR        EQU  179
 ULCORNER    EQU  218
 URCORNER    EQU  191
 MLBORDER EQU  195
 MRBORDER EQU  180
 LLCORNER    EQU  192
 LRCORNER    EQU  217
 BLACKSPACE EQU  32
 SHOWMENU_EXIT equ 1
 SHOWMENU_CONTINUE equ 0
 LAB5DEBUG EQU  1

 DrawTableLine  PROTO,_TableWidth : DWORD,
  beginChar : BYTE,
  textBuffer: PTR BYTE,
  textLen :DWORD,
  fillChar:BYTE,
  endChar:BYTE

 DrawTableLineWithWrap PROTO, _TableWidth : DWORD,
  beginChar : BYTE,
  textBuffer: PTR BYTE,
  textLen :DWORD,
  fillChar:BYTE,
  endChar:BYTE,
  _Delimiter:BYTE
 ShowMenu PROTO, pcharTyped: PTR BYTE
 ShowFibonaccinumbers PROTO, boundary:SDWORD
#=====================================================================
# lab5 - build a program that displays the Fibonacci numbers for a user defined input upper bound
# Author: Sheng_Jiang
# Course: COSC 2425
# Date: 6/21/05
#=====================================================================
PROJECT = Lab5
NAME = Sheng_Jiang
Date = 6/21/05
ROOTDRIVE  = C
VERSION   = V1
SRCS   =
    $(PROJECT).asm
    drawline.asm
    drawwrap.asm
    showmenu.asm
    makefile
MASM32   = $(ROOTDRIVE):/masm32
ML    = $(MASM32)/bin/ml
LINK   = $(MASM32)/bin/link
Zip    = H:/mydoc/Tools/Bin/zip
DEBUG   = c:/masm32/debug/windbg
Irvine32  = H:/mydoc/MyProjct/COSC2425/Lib32
MLFLAGS   = /I. /I $(MASM32)include /I $(MASM32)macros /I $(Irvine32) /Zi /Zd /Zf /c /Fl /coff /Cp
LINKFLAGS  = /subsystem:console /libpath:$(MASM32)lib /libpath:$(Irvine32) /debug
DEBUGFLAGS  = -g -G -QY -logo $(PROJECT).log -QSY -sdce -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm DrawLine.obj DrawWrap.obj showmenu.obj showFib.obj
 $(ML) $(MLFLAGS) $(PROJECT).asm
$(PROJECT).exe: $(PROJECT).obj
 $(LINK) $(LINKFLAGS) /out:$(PROJECT).exe  $(PROJECT).obj DrawLine.obj DrawWrap.obj showmenu.obj showFib.obj

DrawLine.obj: DrawLine.asm
 $(ML) $(MLFLAGS) DrawLine.asm

DrawWrap.obj: DrawWrap.asm DrawLine.obj
 $(ML) $(MLFLAGS) DrawWrap.asm

ShowMenu.obj: ShowMenu.asm DrawWrap.obj
 $(ML) $(MLFLAGS) ShowMenu.asm
showFib.obj: showFib.asm
 $(ML) $(MLFLAGS) showFib.asm
clean:
 del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk *.log
zip: clean
  del $(NAME)_$(PROJECT)_$(VERSION).zip
  $(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)
debug: $(PROJECT).exe
  $(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe

;=====================================================================
; ShowFib.asm - help routine to draw table lines, and get user input
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/24/05
;=====================================================================
 INCLUDE lab5.inc
 .Data
 extern ShowFibPromptString:BYTE
 .Code

Fibonacci PROC USES ecx edx, x:SDWORD
 .IF(x<2)
  mov eax,x
 .ELSE
  mov edx,0
  mov ecx,x
  dec ecx
  invoke Fibonacci,ecx
  mov edx,eax
  dec ecx
  invoke Fibonacci,ecx
  add edx,eax
  mov eax,edx
 .ENDIF
 ret
Fibonacci ENDP
ShowFibonaccinumbers Proc USES ecx edx, boundary :SDWORD
   call Crlf
   mov edx,OFFSET ShowFibPromptString
   call Crlf
   mov ecx,0
   .WHILE(ecx<=boundary)
    invoke Fibonacci,ecx
    call WriteInt
    mov al,BLACKSPACE
    call WriteChar
    inc ecx
   .ENDW
   ret
ShowFibonaccinumbers EndP
 END
;=====================================================================
; ShowMenu.asm - help routine to draw table lines, and get user input
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/24/05
;=====================================================================
 INCLUDE lab5.inc
 .Data
 extern menustring  :BYTE
 extern menustringLen :DWORD
 extern menuDelimiter :BYTE
 extern menuPromptstring :BYTE
 .Code

ShowMenu Proc USES edx, pcharTyped: PTR BYTE
   call Crlf
   invoke DrawTableLine,TABLEWIDTH,ULCORNER,0,0,HBAR,URCORNER
   invoke  DrawTableLineWithWrap,TABLEWIDTH, VBAR,OFFSET menustring,menustringLen,BLACKSPACE,VBAR,menuDelimiter
   invoke DrawTableLine,TABLEWIDTH,LLCORNER,0,0,HBAR,LRCORNER
   call Crlf
   mov edx,offset menuPromptstring
   call WriteString
   call ReadChar
   mov edx,dword ptr [pcharTyped]
   mov byte ptr [edx],al
   .IF(al==’X’)
    mov al,SHOWMENU_EXIT
   .ELSEIF(al==’x’)
    mov al,SHOWMENU_EXIT
   .ELSE
    mov al,SHOWMENU_CONTINUE
   .ENDIF
   ret
ShowMenu EndP
 END

Read more ...


Lab5 Draft3

reference: http://homepages.ius.edu/jfdoyle/c335/Html/ProcInvoke.htm

;=====================================================================
; lab5.asm - build a program that displays the Fibonacci numbers for a user defined input upper bound
; Author: Sheng_Jiang
; Course: COSC 2425
; Date: 6/23/05
;=====================================================================
   .386
   option casemap:none

   INCLUDE Irvine32.inc
   ; —————————————————————–
   ; include files that have MASM format prototypes for function calls
   ; —————————————————————–

   ; ————————————————
   ; Library files that have definitions for function
   ; exports and tested reliable prebuilt code.
   ; ————————————————
   includelib gdi32.lib
   includelib user32.lib
   includelib kernel32.lib
   includelib Irvine32.lib

       ;costants
   CR EQU 0Dh
   LF EQU 0Ah
   TABLEWIDTH EQU  11
   HBAR        EQU  196
   VBAR        EQU  179
   ULCORNER    EQU  218
   URCORNER    EQU  191
   MLBORDER EQU  195
   MRBORDER EQU  180
   LLCORNER    EQU  192
   LRCORNER    EQU  217
   FILLSPACE EQU  32
   .Data
   menuSelection BYTE 0
   menustring  BYTE “Menu|I - Display program instructions|N - The user is to enter an integer number from 0 to 20|F - Display the first N Fibonacci numbers on the console|X - Quit the program”
   menustringLen DWORD $-menustring
   menuDelimiter DWORD “|”
   IsExitSelected BYTE 0
   number   BYTE 0
   .CODE

;draw a table line with text and delimiters
DrawTableLine  PROC NEAR C,
 tableWidth : DWORD,
 beginChar : BYTE,
 textBuffer:NEAR PTR BYTE,
 textLen :DWORD,
 fillChar:BYTE,
 endChar:BYTE
 LOCAL sum : DWORD
 push eax
 push ebx
 push ecx
 ; do nothing if TableWidth<2
 cmp textLen,2
 jb DrawTableLineCleanup
 ;beginChar, the left border
 mov   al,byte ptr [ebp+24]
 call  WriteChar
DrawTableLineCleanup:
 pop  ecx
 push ebx
 pop  eax
 ret
DrawTableLine ENDP




   ;the text

   ;ebx=min(TableWidth-2,textlen);
   mov   ebx,[ebp+16]    ;ebx=textlen
   mov   eax,ebx
   add   eax,2      ;eax=textlen+2
   cmp   eax,ecx      ;textlen+2<=TableWidth?
   jbe   DrawTableLinePrintText  ;yes, print it
   mov   ebx,ecx      ;otherwise cut the string to TableWidth-2 characters
   sub   ebx,2      ;ebx=TableWidth-2
DrawTableLinePrintText:
   ;if no text to print,jump to fill the whole line
   cmp   ebx,0
   je   DrawTableLineFillLine
   ; print the text part
   push  ebx
   mov   edx, [ebp+20]
   mov   ebx,eax
   call  WriteString
   pop   ebx
DrawTableLineFillLine:
   ;fill the rest of table line
   ;call (fillchar,TableWidth-2-ebx)
   mov   eax, [ebp+28]
   sub   eax, 2
   sub   eax, ebx

   push  ecx
   mov   ecx,eax
DrawTableLineFillLineLoop:
   mov   al, [ebp+12]
   call  WriteChar
   loop  DrawTableLineFillLineLoop
   pop   ecx

   ;endChar, the right border
   mov   al,[ebp+8]
   call  WriteChar
   ;change line
   mov   al,CR
   call  WriteChar
   mov   al,LF
   call  WriteChar
DrawTableLineCleanup:
   pop  esi
   pop  edx
   pop  ecx
   pop  ebx
   pop  eax
   mov  esp,ebp
   pop  ebp
   ret
DrawTableLine ENDP
;draw a table top line(using ASCII code)
;usage:
;push TableWidth
;call DrawTableTop
;pop TableWidth
DrawTableTop PROC
   push  ebp
   mov   ebp , esp
   ;call DrawTableLine(TableWidth,ULCORNER,NULL,NULL,HBAR,URCORNER)
   push  [esp+8];TableWidth
   push  ULCORNER
   push  0;
   push  0;
   push  HBAR
   push  URCORNER
   call DrawTableLine
   add  esp,24
   mov  esp,ebp
   pop  ebp
   ret
DrawTableTop ENDP
;draw a table buttom line(using ASCII code)
;usage:
;push TableWidth
;call DrawTableButtom
;pop TableWidth
DrawTableButtom PROC
   push  ebp
   mov   ebp , esp
   ;call DrawTableLine(TableWidth,LLCORNER,NULL,NULL,HBAR,LRCORNER)
   push  [esp+8];TableWidth
   push  LLCORNER
   push  0;
   push  0;
   push  HBAR
   push  LRCORNER
   call DrawTableLine
   add  esp,24
   mov  esp,ebp
   pop  ebp
   ret
DrawTableButtom ENDP
;draw a table middle line(using ASCII code)
;usage:
;push TableWidth
;call DrawTableMiddleLine
;pop TableWidth
DrawTableMiddleLine PROC
   push  ebp
   mov   ebp , esp
   ;call DrawTableLine(TableWidth,MLBORDER,NULL,NULL,FILLSPACE,MRBORDER)
   push  [esp+8];TableWidth
   push  MLBORDER
   push  0;
   push  0;
   push  FILLSPACE
   push  MRBORDER
   call DrawTableLine
   add  esp,24
   mov  esp,ebp
   pop  ebp
   ret
DrawTableMiddleLine ENDP
;draw table lines and print text (using ASCII code)
;wrap to seperate lines if the text is too long, or delimiters were found in the text
;usage:
;push TableWidth
;push stringbuffer
;push stringlen
;push delimiter
;call DrawTableLineWithWrap
;pop delimiter
;pop stringlen
;pop stringbuffer
;pop TableWidth
DrawTableLineWithWrap PROC
   push  ebp
   mov   ebp , esp

   push  eax ;
   push  ebx ;
   push  ecx ;
   push  edx ;
   push  edi ;
   push  esi ;
   mov   ebx ,[ebp+8] ;delimiter
   mov   ecx ,[ebp+12] ;stringlen
   mov   edx ,[ebp+20] ;TableWidth
   mov   esi ,[ebp+16] ;stringbuffer

   ;DWORD curlinebase=esi;
   ;BOOL bTerminate=FALSE;
   ;BOOL bDelimiter;
   ;edi=esi;
   ;
   ;while(!bTerminate&&edi<esi+ecx)
   ;{
   ; if(edi==esi+ecx-1 /*end of buffer*/){bDelimiter=FALSE;bTerminate=TRUE;}
   ; else if([edi]==’’){bDelimiter=TRUE;bTerminate=TRUE;}
   ; else if([edi]==ebx /*delimiter*/)
   ; {
   ;  if(edi==curlinebase){edi++; curlinebase=edi;continue;}//skip leading delimiters
   ;  else bDelimiter=TRUE;
   ; }
   ; else if(edi==curlinebase+TableWidth-3) /*wrap*/{bDelimiter=FALSE;}
   ; else {edi++; continue;}
   ; DrawTableLine(TableWidth,MLBORDER,curlinebase,bDelimiter?edi-curlinebase:edi-curlinebase+1,FILLSPACE,MRBORDER);
   ; edi++;
   ; curlinebase=edi;
   ;}

   mov   edi ,esi
   ;allocate local vars
   sub   esp ,12
   ;DWORD& curlinebase=*(ebp-36);6 pushed registers
   ;BOOL& bTerminate=*(ebp-32)
   ;BOOL& bDelimiter=*(ebp-28)
   mov  dword ptr [ebp-36],esi
   mov  dword ptr [ebp-32],0
DrawTableLineWithWrapLoop:
   ;if(bTerminate==TRUE) goto DrawTableLineWithWrapCleanup
   cmp  dword ptr [ebp-32],0
   jne  DrawTableLineWithWrapCleanup
   ;if(edi>=esi+ecx) goto DrawTableLineWithWrapCleanup
   mov  eax,esi
   add  eax,ecx
   cmp  edi,eax
   jae  DrawTableLineWithWrapCleanup

   dec  eax
   ;if(edi==esi+ecx-1) goto DrawTableLineWithWrapEndOfBuffer
   cmp  edi,eax
   je  DrawTableLineWithWrapEndOfBuffer

   ;if([edi]==0) goto DrawTableLineWithWrapNullTerminator
   cmp  byte ptr [edi],0
   je  DrawTableLineWithWrapNullTerminator

   ;if([edi]==ebx) goto DrawTableLineWithWrapDelimiter
   cmp  byte ptr [edi],bl
   je  DrawTableLineWithWrapDelimiter

   ;if(edi==curlinebase+TableWidth-3) goto DrawTableLineWithWrapLineWrap
   mov  eax,[ebp-36]
   add  eax,edx
   sub  eax,3
   cmp  edi,eax
   je  DrawTableLineWithWrapLineWrap
   inc  edi
   jmp  DrawTableLineWithWrapLoop
DrawTableLineWithWrapEndOfBuffer:
   ;bTerminate=TRUE,bDelimiter=FALSE;
   mov  dword ptr [ebp-32],1
   mov  dword ptr [ebp-28],0
   jmp  DrawTableLineWithWrapDrawLine
DrawTableLineWithWrapNullTerminator:
   ;bTerminate=TRUE,bDelimiter=TRUE;
   mov  dword ptr [ebp-32],1
   mov  dword ptr [ebp-28],1
   jmp  DrawTableLineWithWrapDrawLine
DrawTableLineWithWrapDelimiter:
   ; if([edi]==ebx /*delimiter*/)
   ; {
   ;  if(edi==curlinebase){edi++; continue;}//skip leading delimiters
   ;  else bDelimiter=TRUE;
   ; }
   cmp  edi,[ebp-36]
   je  DrawTableLineWithWrapDelimiter2
   mov  dword ptr [ebp-28],1
   jmp  DrawTableLineWithWrapDrawLine
DrawTableLineWithWrapDelimiter2:
   inc  edi
   ; curlinebase=edi;
   mov  [ebp-36],edi
   jmp  DrawTableLineWithWrapLoop
DrawTableLineWithWrapLineWrap:
   ;bDelimiter=FALSE;
   mov  dword ptr [ebp-28],0
   ;jmp  DrawTableLineWithWrapDrawLine
DrawTableLineWithWrapDrawLine:
   ; DrawTableLine(TableWidth,MLBORDER,curlinebase,bDelimiter?edi-curlinebase:edi-curlinebase+1,FILLSPACE,MRBORDER);
   push edx    ;TableWidth
   push MLBORDER  ;beginchar
   push [ebp-36]  ;stringbuffer
   ;eax=bDelimiter?edi-curlinebase:edi-curlinebase+1
   mov  eax,edi
   sub  eax,[ebp-36]
   cmp  dword ptr [ebp-28],0
   jne  DrawTableLineWithWrapDrawLine2
   add  eax,1
DrawTableLineWithWrapDrawLine2:
   push eax    ;bufferlen
   push FILLSPACE   ;fillchar
   push MRBORDER  ;endchar
   call DrawTableLine
   add  esp,24
   ; edi++;
   inc  edi
   ; curlinebase=edi;
   mov  [ebp-36],edi
   jmp  DrawTableLineWithWrapLoop
DrawTableLineWithWrapCleanup:
   add   esp ,12
   pop   esi
   pop   edi
   pop   edx
   pop   ecx
   pop   ebx
   pop   eax
   mov  esp,ebp
   pop  ebp
   ret
DrawTableLineWithWrap ENDP

ShowMenu Proc
   push  ebp
   mov   ebp , esp

   push TABLEWIDTH
   call DrawTableTop
   ;add  esp,4

   ;push TABLEWIDTH
   push OFFSET menustring
   push menustringLen
   push menuDelimiter
   call DrawTableLineWithWrap
   sub  esp,12

   ;push TABLEWIDTH
   call DrawTableButtom
   add  esp,4

   mov  esp,ebp
   pop  ebp
   ret
ShowMenu EndP
;invoke WriteFile,hOutPut,lpszText,sl,ADDR bWritten,NULL
main  PROC
   int  3

   call ShowMenu
;text code of OutputChar
;   push VBAR
;   call OutputChar
;   add  esp,4
;test code of  DrawTableLineWithWrap
;   push TABLEWIDTH
;   push OFFSET menustring
;   push menustringLen
;   push menuDelimiter
;   call DrawTableLineWithWrap
;   sub  esp,12

   exit
main  ENDP
   END  main
#=====================================================================
# lab5 - build a program that displays the Fibonacci numbers for a user defined input upper bound
# Author: Sheng_Jiang
# Course: COSC 2425
# Date: 6/21/05
#=====================================================================
PROJECT = Lab5
NAME = Sheng_Jiang
Date = 6/21/05
ROOTDRIVE       = C
VERSION         = V1
SRCS   =
    $(PROJECT).asm
    makefile
MASM32          = $(ROOTDRIVE):/masm32
ML              = $(MASM32)/bin/ml
LINK            = $(MASM32)/bin/link
Zip    = H:/mydoc/Tools/Bin/zip
DEBUG   = c:/masm32/debug/windbg
Irvine32  = H:/mydoc/MyProjct/COSC2425/Lib32
MLFLAGS         = /I. /I $(MASM32)include /I $(MASM32)macros /I $(Irvine32) /Zi /Zd /Zf /c /Fl /coff /Cp
LINKFLAGS       = /subsystem:console /libpath:$(MASM32)lib /libpath:$(Irvine32) /debug
DEBUGFLAGS  = -QY -g -G -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm
 $(ML) $(MLFLAGS) $(PROJECT).asm
$(PROJECT).exe: $(PROJECT).obj
 $(LINK) $(LINKFLAGS) $(PROJECT).obj
clean:
 del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk
zip:    clean
  del $(NAME)_$(PROJECT)_$(VERSION).zip
        $(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)
debug: $(PROJECT).exe
  $(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe


Read more ...


Lab5 Draft2

;=====================================================================

; lab5.asm - build a program that displays the Fibonacci numbers for a user defined input upper bound

; Author: Sheng_Jiang

; Course: COSC 2425

; Date: 6/21/05

;=====================================================================

.386

.MODEL flat, stdcall

option casemap:none

include windows.inc ; always first

include macros.asm ; MASM support macros

; —————————————————————–

; include files that have MASM format prototypes for function calls

; —————————————————————–

include masm32.inc

include gdi32.inc

include user32.inc

include kernel32.inc

; ————————————————

; Library files that have definitions for function

; exports and tested reliable prebuilt code.

; ————————————————

includelib masm32.lib

includelib gdi32.lib

includelib user32.lib

includelib kernel32.lib

;costants

CR EQU 0Dh

LF EQU 0Ah

TABLEWIDTH EQU 10

HBAR EQU 196

VBAR EQU 179

ULCORNER EQU 218

URCORNER EQU 191

MLBORDER EQU 195

MRBORDER EQU 180

LLCORNER EQU 192

LRCORNER EQU 217

.Data

menuSelection BYTE 0

menustring BYTE “Menu|I - Display program instructions|N - The user is to enter an integer number from 0 to 20|Display the first N Fibonacci numbers on the console|Quit the program”

menustringLen DWORD $-menustring

menuDelimiter DWORD “|”

IsExitSelected BYTE 0

number BYTE 0

.CODE

;print a string

;usage: push stringBuffer

; push stringlen

;

;call OutputStringN

; pop stringlen

; pop stringBuffer

OutputStringN PROC

push ebp

mov ebp , esp

sub esp , 8 ;//2 local var

push eax

push ecx

push edx

;eax=GetStdHandle(STD_OUTPUT_HANDLE)

invoke GetStdHandle, STD_OUTPUT_HANDLE

mov [ebp-4] , eax ;

;[ebp-8]=ebp-8;

mov eax ,ebp

sub eax ,8

mov [ebp-8] , eax;

;WriteFile outputHandle, stringBuffer,stringlen,&bytesWritten,0

invoke WriteFile, [ebp-4], near ptr [ebp+12], [ebp+8], near ptr [ebp-8],0

;cleanup

pop edx

pop ecx

pop eax

add esp , 8

mov esp,ebp

pop ebp

ret

OutputStringN ENDP

;print a char for count times.

;usage: push char

; push count

; call OutputCharN

; pop count

; pop char

OutputCharN PROC

push ebp

mov ebp , esp

push eax

push ecx

push edi

mov ecx,[ebp+8] ;ecx=count

JCXZ OutputCharNCleanup; do nothing if count=0

;allocate count bytes on the stack

;from esp-count to esp

;and initialize to char

;BYTE buffer[count]

;edi=buffer;

;push ecx;

;while(ecx)

;{

; edi[ecx]=char

;}

;pop ecx

mov al,BYTE PTR [ebp+12]

mov edi,esp

sub esp,ecx

push ecx

OutputCharNLoop:

dec edi

mov [edi], al

loop OutputCharNLoop

pop ecx

;call OutputStringN(buffer,ecx)

push edi

push ecx

call OutputStringN

pop ecx

add esp,4

;free count bytes on the stack

add esp,ecx

OutputCharNCleanup:

pop edi

pop ecx

pop eax

mov esp,ebp

pop ebp

ret

OutputCharN ENDP

;print a char

;by calling OutputStringN with a count of 1

;usage: push char

; call OutputChar

; pop char

OutputChar PROC

push ebp

mov ebp , esp

push eax

;DWORD dwchar;

sub esp,4

mov eax,[ebp+8] ;eax=char

mov dword ptr[ebp-8],0 ;dwchar=0

mov byte ptr[ebp-8],al ;dwchar=char & 0x000000FF

;call OutputStringN(&dwchar,1)

mov eax,ebp

sub eax,8

push eax

push 1

call OutputStringN

add esp,12

pop eax

mov esp,ebp

pop ebp

ret

OutputChar ENDP

;draw a table line with text and delimiters

;usage:

;push TableWidth

;push beginChar

;push textbuffer

;push textlen

;push fillchar

;push endChar

;call DrawTableLine

;pop endChar

;pop fillchar

;pop textlen

;pop textbuffer

;pop beginChar

;pop TableWidth

DrawTableLine PROC

push ebp

mov ebp , esp

push eax

push ebx

push ecx

; do nothing if TableWidth<2

mov ecx,[ebp+28] ;ecx=TableWidth

cmp ecx,2

jb DrawTableLineCleanup

;beginChar, the left border

push [ebp+24]

call OutputChar

add esp,4

;the text

;ebx=min(TableWidth-2,textlen);

mov ebx,[ebp+16] ;ebx=textlen

mov eax,ebx

add eax,2 ;eax=textlen+2

cmp eax,ecx ;textlen+2<=TableWidth?

jbe DrawTableLinePrintText ;yes, print it

mov ebx,ecx ;otherwise cut the string to TableWidth-2 characters

sub ebx,2 ;ebx=TableWidth-2

DrawTableLinePrintText:

;if no text to print,jump to fill the whole line

cmp ebx,0

je DrawTableLineFillLine

; call OutputStringN to print the text part

push [ebp+20]

push ebx

call OutputStringN

pop ebx

add esp,4

DrawTableLineFillLine:

;fill the rest of table line

;call OutputCharN(fillchar,TableWidth-2-ebx)

mov eax, [ebp+28]

sub eax, 2

sub eax, ebx

push [ebp+12]

push eax

call OutputCharN;

add esp,8

;endChar, the right border

push [ebp+8]

call OutputChar

add esp,4

;change line

push CR

call OutputChar

add esp,4

push LF

call OutputChar

add esp,4

DrawTableLineCleanup:

pop ecx

pop ebx

pop eax

mov esp,ebp

pop ebp

ret

DrawTableLine ENDP

;draw a table top line(using ASCII code)

;usage:

;push TableWidth

;call DrawTableTop

;pop TableWidth

DrawTableTop PROC

push ebp

mov ebp , esp

;call DrawTableLine(TableWidth,ULCORNER,NULL,NULL,HBAR,URCORNER)

push [esp+8];TableWidth

push ULCORNER

push 0;

push 0;

push HBAR

push URCORNER

call DrawTableLine

add esp,24

mov esp,ebp

pop ebp

ret

DrawTableTop ENDP

;draw a table buttom line(using ASCII code)

;usage:

;push TableWidth

;call DrawTableButtom

;pop TableWidth

DrawTableButtom PROC

push ebp

mov ebp , esp

;call DrawTableLine(TableWidth,LLCORNER,NULL,NULL,HBAR,LRCORNER)

push [esp+8];TableWidth

push LLCORNER

push 0;

push 0;

push HBAR

push LRCORNER

call DrawTableLine

add esp,24

mov esp,ebp

pop ebp

ret

DrawTableButtom ENDP

;draw a table middle line(using ASCII code)

;usage:

;push TableWidth

;call DrawTableMiddleLine

;pop TableWidth

DrawTableMiddleLine PROC

push ebp

mov ebp , esp

;call DrawTableLine(TableWidth,MLBORDER,NULL,NULL,HBAR,MRBORDER)

push [esp+8];TableWidth

push MLBORDER

push 0;

push 0;

push HBAR

push MRBORDER

call DrawTableLine

add esp,24

mov esp,ebp

pop ebp

ret

DrawTableMiddleLine ENDP

;draw table lines and print text (using ASCII code)

;wrap to seperate lines if the text is too long, or delimiters were found in the text

;usage:

;push TableWidth

;push stringbuffer

;push stringlen

;push delimiter

;call DrawTableLineWithWrap

;pop delimiter

;pop stringlen

;pop stringbuffer

;pop TableWidth

DrawTableLineWithWrap PROC

push ebp

mov ebp , esp

push eax ;

push ebx ;

push ecx ;

push edx ;

push edi ;

push esi ;

mov ebx ,[ebp+8] ;delimiter

mov ecx ,[ebp+12] ;stringlen

mov edx ,[ebp+20] ;TableWidth

mov esi ,[ebp+16] ;stringbuffer

;DWORD curlinebase=esi;

;BOOL bTerminate=FALSE;

;BOOL bDelimiter;

;edi=esi;

;

;while(!bTerminate&&edi<esi+ecx)

;{

; if(edi==esi+ecx-1 /*end of buffer*/){bDelimiter=FALSE;bTerminate=TRUE;}

; else if([edi]==’’){bDelimiter=TRUE;bTerminate=TRUE;}

; else if([edi]==ebx /*delimiter*/{bDelimiter=TRUE;}

; else if(edi=curlinebase+TableWidth-2) /*wrap*/{bDelimiter=FALSE;}

; else {edi++; continue;}

; DrawTableLine(TableWidth,MLBORDER,curlinebase,bDelimiter?edi-curlinebase:edi-curlinebase+1,HBAR,MRBORDER);

; edi++;

; curlinebase=edi;

;}

mov edi ,esi

;allocate local vars

sub esp ,12

;DWORD& curlinebase=*(ebp-36);6 pushed registers

;BOOL& bTerminate=*(ebp-32)

;BOOL& bDelimiter=*(ebp-28)

mov dword ptr [ebp-36],esi

mov dword ptr [ebp-32],0

DrawTableLineWithWrapLoop:

;if(bTerminate==TRUE) goto DrawTableLineWithWrapCleanup

cmp dword ptr [ebp-32],0

jne DrawTableLineWithWrapCleanup

;if(edi>=esi+ecx) goto DrawTableLineWithWrapCleanup

mov eax,esi

add eax,ecx

cmp edi,eax

jae DrawTableLineWithWrapCleanup

dec eax

;if(edi==esi+ecx-1) goto DrawTableLineWithWrapEndOfBuffer

cmp edi,eax

je DrawTableLineWithWrapEndOfBuffer

;if([edi]==0) goto DrawTableLineWithWrapNullTerminator

cmp byte ptr [edi],0

je DrawTableLineWithWrapNullTerminator

;if([edi]==ebx) goto DrawTableLineWithWrapDelimiter

cmp byte ptr [edi],bl

je DrawTableLineWithWrapDelimiter

;if(edi==curlinebase+TableWidth-2) goto DrawTableLineWithWrapLineWrap

mov eax,[ebp-36]

add eax,edx

sub eax,2

cmp edi,eax

je DrawTableLineWithWrapLineWrap

inc edi

jmp DrawTableLineWithWrapLoop

DrawTableLineWithWrapEndOfBuffer:

;bTerminate=TRUE,bDelimiter=FALSE;

mov dword ptr [ebp-32],1

mov dword ptr [ebp-28],0

jmp DrawTableLineWithWrapDrawLine

DrawTableLineWithWrapNullTerminator:

;bTerminate=TRUE,bDelimiter=TRUE;

mov dword ptr [ebp-32],1

mov dword ptr [ebp-28],1

jmp DrawTableLineWithWrapDrawLine

DrawTableLineWithWrapDelimiter:

;bDelimiter=TRUE;

mov dword ptr [ebp-28],1

jmp DrawTableLineWithWrapDrawLine

DrawTableLineWithWrapLineWrap:

;bDelimiter=FALSE;

mov dword ptr [ebp-28],0

;jmp DrawTableLineWithWrapDrawLine

DrawTableLineWithWrapDrawLine:

; DrawTableLine(TableWidth,MLBORDER,curlinebase,bDelimiter?edi-curlinebase:edi-curlinebase+1,HBAR,MRBORDER);

push edx ;TableWidth

push MLBORDER ;beginchar

push [ebp-36] ;stringbuffer

;eax=bDelimiter?edi-curlinebase:edi-curlinebase+1

mov eax,edi

sub eax,[ebp-36]

cmp dword ptr [ebp-28],0

jne DrawTableLineWithWrapDrawLine2

add eax,1

DrawTableLineWithWrapDrawLine2:

push eax ;bufferlen

push HBAR ;fillchar

push MRBORDER ;endchar

call DrawTableLine

add esp,24

; edi++;

; curlinebase=edi;

inc edi

mov [ebp-36],edi

jmp DrawTableLineWithWrapLoop

DrawTableLineWithWrapCleanup:

add esp ,12

pop esi

pop edi

pop edx

pop ecx

pop ebx

pop eax

mov esp,ebp

pop ebp

ret

DrawTableLineWithWrap ENDP

ShowMenu Proc

push ebp

mov ebp , esp

push TABLEWIDTH

call DrawTableTop

;add esp,4

;push TABLEWIDTH

push OFFSET menustring

push menustringLen

push menuDelimiter

call DrawTableLineWithWrap

sub esp,12

;push TABLEWIDTH

call DrawTableButtom

add esp,4

mov esp,ebp

pop ebp

ret

ShowMenu EndP

;invoke WriteFile,hOutPut,lpszText,sl,ADDR bWritten,NULL

main PROC

int 3

; call ShowMenu

;text code of OutputChar

; push VBAR

; call OutputChar

; add esp,4

;test code of DrawTableLineWithWrap

push TABLEWIDTH

push OFFSET menustring

push menustringLen

push menuDelimiter

call DrawTableLineWithWrap

sub esp,12

exit

main ENDP

END main

#=====================================================================

# lab5 - build a program that displays the Fibonacci numbers for a user defined input upper bound

# Author: Sheng_Jiang

# Course: COSC 2425

# Date: 6/21/05

#=====================================================================

PROJECT = Lab5

NAME = Sheng_Jiang

Date = 6/21/05

ROOTDRIVE = C

VERSION = V1

SRCS =

$(PROJECT).asm

makefile

MASM32 = $(ROOTDRIVE):/masm32

ML = $(MASM32)/bin/ml

LINK = $(MASM32)/bin/link

Zip = H:/mydoc/Tools/Bin/zip

DEBUG = c:/masm32/debug/windbg

MLFLAGS = /I. /I $(MASM32)include /I $(MASM32)macros /Zi /Zd /Zf /c /Fl /coff /Cp

LINKFLAGS = /subsystem:console /libpath:$(MASM32)lib /debug

DEBUGFLAGS = -QY -g -G -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm

$(ML) $(MLFLAGS) $(PROJECT).asm

$(PROJECT).exe: $(PROJECT).obj

$(LINK) $(LINKFLAGS) $(PROJECT).obj

clean:

del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk

zip: clean

del $(NAME)_$(PROJECT)_$(VERSION).zip

$(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)

debug: $(PROJECT).exe

$(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe

Read more ...


Lab5 Draft1

;=====================================================================

; lab5.asm - build a program that displays the Fibonacci numbers for a user defined input upper bound

; Author: Sheng_Jiang

; Course: COSC 2425

; Date: 6/15/05

;=====================================================================

.386

.MODEL flat, stdcall

option casemap:none

include windows.inc ; always first

include macros.asm ; MASM support macros

; —————————————————————–

; include files that have MASM format prototypes for function calls

; —————————————————————–

include masm32.inc

include gdi32.inc

include user32.inc

include kernel32.inc

; ————————————————

; Library files that have definitions for function

; exports and tested reliable prebuilt code.

; ————————————————

includelib masm32.lib

includelib gdi32.lib

includelib user32.lib

includelib kernel32.lib

;costants

CR EQU 0Dh

LF EQU 0Ah

DOCOMMAND_CONTINUE equ 1

DOCOMMAND_END equ 0

.Data

menuSelection DWORD 0

DoCommandResult DWORD 0

.Code

ShowMenu Proc

print chr$(“Menu”,CR,LF,”[I,N,F,X]”)

ret

ShowMenu EndP

;

;usage:

;push someThingToAllocateTheReturnValue

;push command

;call DoCommand

;pop command

;pop someThingToAllocateTheReturnValue

;the return value can be one of the following:

; DOCOMMAND_CONTINUE equ 1

; DOCOMMAND_END equ 0

DoCommand PROC

push ebp

mov ebp, esp

push eax

push ebx

mov bl, BYTE PTR [ebp+8]

cmp bl, ‘x’

je DoCommandEnd

cmp bl, ‘X’

je DoCommandEnd

mov eax, DOCOMMAND_CONTINUE

jmp DoCommandCleanup

DoCommandEnd:

mov eax, DOCOMMAND_END

DoCommandCleanup:

mov [ebp+12],eax

pop ebx

pop eax

mov esp,ebp

pop ebp

ret

DoCommand ENDP

main PROC

int 3

cls

ShowMenuLoop:

call ShowMenu

mov menuSelection, input()

push DoCommandResult

mov eax,menuSelection

push [eax]

call DoCommand

pop menuSelection

pop DoCommandResult

cmp DoCommandResult,DOCOMMAND_CONTINUE

je ShowMenuLoop

exit

main ENDP

END main

#=====================================================================

# lab5 - build a program that displays the Fibonacci numbers for a user defined input upper bound

# Author: Sheng_Jiang

# Course: COSC 2425

# Date: 6/15/05

#=====================================================================

PROJECT = Lab5

NAME = Sheng_Jiang

Date = 6/15/05

ROOTDRIVE = C

VERSION = V1

SRCS =

$(PROJECT).asm

makefile

MASM32 = $(ROOTDRIVE):/masm32

ML = $(MASM32)/bin/ml

LINK = $(MASM32)/bin/link

Zip = H:/mydoc/Tools/Bin/zip

DEBUG = c:/masm32/debug/windbg

MLFLAGS = /I. /I $(MASM32)include /I $(MASM32)macros /Zi /Zd /Zf /c /Fl /coff /Cp

LINKFLAGS = /subsystem:console /libpath:$(MASM32)lib /debug

DEBUGFLAGS = -QY -g -G -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm

$(ML) $(MLFLAGS) $(PROJECT).asm

$(PROJECT).exe: $(PROJECT).obj

$(LINK) $(LINKFLAGS) $(PROJECT).obj

clean:

del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk

zip: clean

del $(NAME)_$(PROJECT)_$(VERSION).zip

$(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)

debug: $(PROJECT).exe

$(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe

Read more ...


Lab4

;=====================================================================

; lab4.asm - Example function call to get the 20th Fibonacci number

;; Author: Sheng_Jiang

; Course: COSC 2425

; Date: 6/13/05;=====================================================================

.386

.MODEL flat, stdcall

option casemap:none

include windows.inc ; always first

include macros.asm ; MASM support macros

; —————————————————————–

; include files that have MASM format prototypes for function calls

; —————————————————————–

include masm32.inc

include gdi32.inc

include user32.inc

include kernel32.inc

; ————————————————

; Library files that have definitions for function

; exports and tested reliable prebuilt code.

; ————————————————

includelib masm32.lib

includelib gdi32.lib

includelib user32.lib

includelib kernel32.lib

;costants

cr equ 0dh

lf equ 0ah

.Data

.STACK 4096h ;RECURSION need large stacks

.CODE

;Function Fibonacci returns n’th Fibonacci number

;It uses RECURSION

;__stdcall unsigned int f(int x)

;{

; return (x<2) ? 1 : f(x-1) + f(x-2);

;}

;usage:

;push SomethingToAllocateTheReturnValue

;push Parameter;

;call Fibonacci

;stack changes during function call:12

Fibonacci PROC

push ebp

mov ebp , esp

push ecx ; this register is used to calculate the parameters of the function calls

push esi ; sum goes here

FibonacciFunctionBegin:

mov ecx,[ebp+8] ;ecx=param1 = esp/*old*/+4/*new esp*/+4/*pushed ebp*/

cmp ecx,2 ;ecx<2 ?

jge FibonacciRecursion ;return f(x-1) + f(x-2);

mov esi,1 ;otherwise return 1

jmp FibonacciCleanup ;exit function

FibonacciRecursion:

dec ecx ;calculate f(x-1)

push ecx ;allocate the returnValue

push ecx ;ecx=x-1

call Fibonacci

pop esi

dec ecx ;calculate f(x-2)

push ecx ;allocate the returnValue

push ecx ;ecx=x-2

call Fibonacci

pop ecx

add esi,ecx

FibonacciCleanup:

mov dword ptr [ebp+12],esi; //set return values

pop esi

pop ecx

mov esp,ebp

pop ebp

ret 4

Fibonacci ENDP

;int main(int argc, char* argv[])

;{

; printf(“the 20th Fibonacci number is:rn”;

; return 0;

;}

main PROC

int 3

push ecx ;allocate the return value

push 13 ;

call Fibonacci

print chr$(“the 20th Fibonacci number is:”,cr,lf)

pop ecx

print str$(ecx);

print chr$(cr,lf)

exit

main ENDP

END main

# makefile for Lab4

PROJECT = Lab4

NAME = Sheng_Jiang

Date = 6/13/05

ROOTDRIVE = C

VERSION = V1

SRCS =

$(PROJECT).asm

makefile

MASM32 = $(ROOTDRIVE):/masm32

ML = $(MASM32)/bin/ml

LINK = $(MASM32)/bin/link

Zip = H:/mydoc/Tools/Bin/zip

DEBUG = c:/masm32/debug/windbg

MLFLAGS = /I. /I $(MASM32)include /I $(MASM32)macros /Zi /Zd /Zf /c /Fl /coff /Cp

LINKFLAGS = /subsystem:console /libpath:$(MASM32)lib /debug

DEBUGFLAGS = -QY -g -G -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm

$(ML) $(MLFLAGS) $(PROJECT).asm

$(PROJECT).exe: $(PROJECT).obj

$(LINK) $(LINKFLAGS) $(PROJECT).obj

clean:

del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk

zip: clean

del $(NAME)_$(PROJECT)_$(VERSION).zip

$(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)

debug: $(PROJECT).exe

$(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe

Read more ...


Assignment1

makefile

Read more ...


使用WinDbg调试VC程序

虽然在VC6.0中可以通过安装Visual C++ Toolkit(https://archive.org/details/microsoft-visual-c-toolkit-2003)来编写基于最新版本的平台SDK、DirectX SDK的程序以及托管代码,但是VC6附带的调试器并不支持新版本的调试信息,所以实际上是不能用VC6来调试新版本编译器生成的程序的。

一个替代的解决方案是使用新版本的Windows调试工具Windbg(https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/)。Windbg的调试功能基本和Visual C++中的相同,但是需要手动设定源文件和调试符号文件的搜索路径(可以参考VC6.0中的对应设置)。

Read more ...


Lab3

.386

.MODEL flat, stdcall

option casemap:none

include windows.inc

include kernel32.inc

include masm32.inc

includelib kernel32.lib

includelib masm32.lib

.DATA

val1 DWORD 10000h

val2 DWORD 40000h

val3 DWORD 20000h

finalVal DWORD ?

.CODE

main PROC

int 3

mov eax,val1

add eax,val2

sub eax,val3

mov finalVal,eax

invoke ExitProcess, 0

main ENDP

END main

# makefile for Lab3

PROJECT = Lab3

NAME = Sheng_Jiang

Date = 5/25/05

ROOTDRIVE = C

VERSION = V1

SRCS =

$(PROJECT).asm

makefile

MASM32 = $(ROOTDRIVE):/masm32

ML = $(MASM32)/bin/ml

LINK = $(MASM32)/bin/link

Zip = H:/mydoc/Tools/Bin/zip

DEBUG = H:Progra~1Debugg~1windbg

MLFLAGS = /I. /I $(MASM32)include /Zi /Zd /Zf /c /Fl /coff /Cp

LINKFLAGS = /subsystem:console /libpath:$(MASM32)lib /debug

DEBUGFLAGS = -QY -g -G -WF $(PROJECT).WEW

all: $(PROJECT).exe

$(PROJECT).obj: $(PROJECT).asm

$(ML) $(MLFLAGS) $(PROJECT).asm

$(PROJECT).exe: $(PROJECT).obj

$(LINK) $(LINKFLAGS) $(PROJECT).obj

clean:

del $(PROJECT).exe *.obj *.lst *.map *.pdb *.ilk

zip: clean

del $(NAME)_$(PROJECT)_$(VERSION).zip

$(Zip) $(NAME)_$(PROJECT)_$(VERSION).zip $(SRCS)

debug: $(PROJECT).exe

$(DEBUG) $(DEBUGFLAGS) $(PROJECT).exe

Read more ...


Lab2

Assignment 2: A Hello World program for Windows written in assembly language.

Read more ...


Attending Machine Language Class

I am going to take the machine language class at ACC. a lot of posts are going to focus on my experience.

https://web.archive.org/web/20041110185729/https://www.austincc.edu/rblack/COSC2425/index.html

Read more ...


Read Twice to reveal the clues(Orson Scott Card,SPEAKER FOR THE DEAD)

Thanks to Austin Public Library, I have a chance to continue my navigating with Ender the Great Commander, the Xenocide, and the Speaker for the Dead. I’v noticed a significant difference between the style of Ender’s Game and Speaker for the Dead, and I like this change. It make ender a less hero, but a greater philosopher. His unconscious victory now considered crime, and he became his own accuser for 3,000 years. However, he still execl in this work. He removed the barrier between human and peggies, and made the treatment between the 3 species.

I did not notice the importance of the irrelevant quotation at the beginning of each chapter, but I found they are noteworthy for better understanding. They are kind of background information, and some sources appeared in the body part later.

“We question all our beliefs, except for the ones we really believe, and those we never think to question. “

Read more ...


在线地址本服务

我收到的来自在线地址本服务的邀请现在越来越频繁了。今天我又收到了一封这样的邮件:

Add yourself to xxx’s address book! Open your invitation This invitation was sent to my email address on behalf of xxxxxx (xxxxxx@hotmail.com) If you do not wish to receive invitations from this Ringo member, click here. To stop receiving invitations from all Ringo members, click here.

Read more ...


Notes

common law and jury system
legal system of country or the system of justice reflect the history and culture of the country

philosophical question about law, courts,trial,concept of innocent&guilt
people from diff cultures may answer it differently
1 preferable for a dozen guilty people to go free rather than to punished one innocent people unjustly? or  sometime nessary to punish innocent so no guilty people escape justine?
2 guilty until proven innocent or is innocent until proven guilty?
Different between US system and other systems
1 Common Law and how it differs from civil law
not unique, brought over from the first settlers from England.
Civil law (other eu countries) consult written code of laws to decide innocent/ guity and what sentence
Common Law(English speaking countries) developed case by case, not only by legal law, but also consider precedent et by other cases.
2 jury system. Constitution ensure the right of trial by jury.
Not judge,but also jury.Listen to testimony and reach a verdict.
Civil law suit:Which side is right and how much to pay damages.
Criminal law suit:Guity or innocent.
How jury reach the decision? Judge deals with the law, jury deal with the fact(sth happened or not )
If beyond a resonable doubt ,must acquit.
required number of jurors don’t agree, hang jury, law requires new trial with new new jury.
Not too efficient.e.g. hang jury, jury selection takes additional time. Attoney select reject jurors who interested and prejudiced, or with no reason. Unbiased group of citizens.Prefer Not by authority.
3 plea bargaining.
Only about 20% legal cases accurally reached the court. Accused plea guity to a lesser crime. Civil cases set off despute with layers, or criminal cases plea bargaining (accuse with guity with a lesser crime). Large number of cases, otherwise the court is too crowded, no trail in court save time & money. Only if cooprate with the presecutor and bring others to justice for less servere punishment,

Read more ...


Blog, past and present

A Introduction

Story of Sen. Treat Lott

Read more ...


Notes

Government by constitution, separation of checks, powers, and balances.
1983, mark the 200 university of us constitution. US is a young country, but the constitution is the oldest written one continues to be use. Remained basically unchanged.

2 principles written into the constitution 200 years ago,effect today.

1 division or separation of powers.
2 a system of checks and balances.

1.1 3 branch (legislative, Executive, Judicial) compose the us gov.

1.2 legislative: Congress, electing or make new law.
1.3 Executive: execute laws that originated from legislative, President sign the law, put laws into effect.Responsible of seeing the law is enforce or carried out
1.4 Judicial: Dealing persons or cooperations that accused of breaking law and legal dispute;handle trial and court cases, review existing law, make sure they are  consistent with the constitution. Judge legality of law,use constitution as a guide.

2.1 Each branches have its specific task in relation of the country’s laws, and particular power that is not share by other branches. The writer of constitution to ake sure no single branch have all power, make sure no abuse, no more powerful than other branches. A system of checks and balances is written in the constitution . A specific way to check or control on other branches.

2.2 Executive->legislative: Presidential power of veto. Law unwise,wong, may refuse to sign the law. congress difficult to have the majority to overwrite presidential veto. May put the law away forever.
2.3 legislative->Executive:DC. 1973, executive was suspect to have the illegal action to reelect Nixon. Have the right to remove the present from office. President resigned, but processes were initiated.
2.4 Judicial->legislative:legality  of abortion.Abortion were illegal in most states. 1973 Supreme Court found these laws unconstitutional, made the abortion legal. Women can made the abortion in all 50 states today.  Civil right:Supreme Court declared unconstitutional some state law discriminate african-american. Result: illegal for any state to practice racial discrimination in any form. Desegregation of public school. Also reviews and determine the constitutionality of Fed. laws originated in Congress.
2.5 Executive,legislative->Judicial:President nominate the candidate of Supreme Court. Congress must approve the nomination. Each answer to other two.
Imbalance of power does not usually last long.

Read more ...


Blog, past and present

At December 5, 2002, on Sen. Strom Thurmond’s 100th birthday celebration, Sen. Trent Lott (R-MS) stunned his audience with his words “I want to say this about my state. When Strom Thurmond ran for president, we voted for him. We’re proud of it. And if the rest of the country had followed our lead, we wouldn’t have had all these problems over the all these years either.”, and probably stunned the mainstream media, made them unable to report this comment widely. But two bloggers,“Atrios” and Joshua Marshall noticed it and wrote it down on their blog. Soon blogs about this comment were so widely spread that on December 10, the mainstream media restored their attention, and on December 20, Lott resigned as Majority Leader.

What is Blog? Why is it so influential?

Read more ...


登鹳雀楼(王之焕)

白日依山尽,黄河入海流

The sun beyond the mountains glows;/The Yellow River seaward flows.

欲穷千里目,更上一层楼

You will enjoy a grander sight/ By climbing to a greater height.

Read more ...


请勿向第三方公开你的个人密码

Please don’t show your password to 3rd party.

一直以来我都持续收到一些加入在线手机社区http://www.sms.ac的邀请,因为我没有手机(要找我的人注意:我醒着的话一般都挂在MSN上),所以总是看过就算。但是今天收到了来自一个不是很熟的朋友的加入这个社区和另外一个社区http://www.bebo.com的邀请,所以上网搜索了一下一些个人BLOG对这两个网站的引用。搜索的结果触目惊心。

Read more ...


Blog

Blog, or weblog, refers to certain kind of online journal that, it is time-stamped articles posted on websites, usually in reverse chronological order. In addition, it usually enables visitors to leave comments on the same web page of article, trace related blogs between different websites, and get notification if the blog is updated. It can also refer to the action of writing blogs.

In a famous blog by Rebecca Blood, she observed that Jorn Barger named his website, which with daily articles consisted of interesting links to websites and comments of these websites; as Weblog, and it is Peter Merholz who once broke Weblog into the phrase “we blog”. (Blood, R., September 7, 2000), which was shortened to “blog” during spreading. The number of bloggers boosted after web based blog tools, such as one provided by Blogger.com since 1999, enabled writing blog or comments online, and publishing it with a few mouse clicks. But blog had not much attention at that time.

Read more ...


http://meta.wikimedia.org/wiki/Chinese_conversion

Automatic conversion between simplified and traditional Chinese

http://meta.wikimedia.org/wiki/Chinese_conversion

方言的翻译一直是一个很麻烦的翻译,由于中文的词之间没有空格,而且一些用语的字数不同(例如电脑和计算机)人工智能处理这些翻译很麻烦,采取人工的手段也是一种解决方案。

Read more ...


Visual C++ 2005的版本区别

经常看见有些人问Visual C++ 2005里面为什么没有了MFC。实际上,MFC只是在目前免费下载测试版的Express版本里面没有,在其它的版本里面都有——但是一般都是要付钱的。具体的各个版本的比较可以参见参考部分的链接。不过对于用VC来学习.Net开发的程序员来说,Express版就足够了。

小道消息:

Read more ...


程序员之懒

程序员在我看来是比较会偷懒的一个群体。为了在开发软件的时候减少人工操作,他们会使用各种各样的软件和语言特性,例如IDE和预处理宏。李建忠在他的BLOG(http://blog.joycode.com/lijianzhong/archive/2005/05/08/50440.aspx)中提到,为了简化声明属性的工作,他的同事自己写了一些小工具来生成需要的代码。在C++托管扩展中,这个工作稍微简单一些,用预处理宏就可以了。

当然,如果使用C++/CLI的话,这个工作更加简单:

Read more ...


Visual C++ 2005 Beta 2中的变动

stdcli::language名称空间被取消,代之以cli名称空间。

MFC对.Net控件的事件支持宏VENT_DELEGATE_ENTRY的参数类型变化:例如

Read more ...


VC的自动化向导的BUG

BUG: ClassWizard Omits Methods with BYTE or BYTE* As Parameters (http://support.microsoft.com/kb/q241862/)

BUG: VTS_UI1 and VTS_PUI1 are Defined Incorrectly in AfxDisp.h (http://support.microsoft.com/kb/242588/)

Read more ...


Litblogs

Uniting the leading literary weblogs for the purpose of drawing attention to the best of contemporary fiction, authors and presses that are struggling to be noticed in a flooded marketplace.

Lbcheader_1

http://www.lbc.typepad.com/

Read more ...


假如抓到一条美人鱼(转自机战世界论坛,水星的爱发)

【凯迪社区】之猫眼看人:
  她首先是个人,然后才是条鱼,所以她是有人权的,要给她说话的自由。她要留在陆地,还是回到海洋,是她的选择,我们要尊重她。想想吧,她一定有一个温馨的家,也许她还是一个温柔的母亲,也许她的孩子在家中嗷嗷待哺,想想吧,置那孩子不顾,独留她在这陌生的世界,于心何忍?还是让她回去吧。
  —————————————————————————————————————————
  回复:
  1、自提一下。
  2、深思ing。
  3、不能让她生活在一个专制的世界里,海底要自由得多。
  4、同意楼主的观点。
  5、海底有着高度发达的文明,比我们陆地发达百倍。
  6、说得对。
  7、海底才是真正的自由社会。
  8、岸上我都生存不下去了,何况人鱼?
  9、···············



  【新华社区】之发展论坛:
  她因为浮上水面才被人捕获,这说明海底世界一定很黑暗,腐败横行,根据理工科思维,海底根本就没有人性,没有文明度可言,有的只是野蛮与杀戮。所以她要逃脱那个非人的世界。虽然我们陆地也有腐败,也有不公现象,但这是我们初级建设阶段的不可避免的,相比海底来说,还是清明许多的。
  ———————————————————————————————————————————
  回复:
  1、有道理,顶!
  2、完全同意。
  3、不要意淫了,浮上来就是因为逃离吗?
  4、楼上的,难不成浮上来是要阳光浴?
  5、顶楼主一把,沿着我们道路坚定地走下去!
  6、楼主看哪儿的报道说人鱼世界腐败横行,新闻联播的吧?
  7、谁潜到海底亲眼见识过深海世界了,没见过的怎么如此肯定?
  8、··········


  【天涯社区】之天涯杂谈:
  从人鱼那凄丽湿润的双眼中,我见到了我的影子,一样的凄美,一样的孤单。我们是如此的相象,惆怅与无奈交织在心头。她让我想起我的三十次相亲史。何时,才能找到一个母亲满意,我也满意的人呢?独坐于秋夜的露台,任一杯蓝山咖啡在霜冷月色中冷却,期待着第三十一个他,不会让我失望··
  ——————————————————————————————————————————–
  回复:
  1、终于抢到沙发了。2、楼上的不厚道,抢我沙发。
  3、嗯,咖啡,我最喜欢卡布其诺,有种酸,有种苦,白白的泡沫,转瞬即逝,象初恋···
  4、我为楼主的三十次相亲感到叹息,我见楼主犹怜,因为我也有三十次的相亲史,加我QQ123··
  5、我期待着我是你的第三十一个他。
  6、楼上的不要这么直接嘛。
  7、我昨晚去相了第一次亲,感到很恐怖哟,唉。
  8、楼上小MM,那是因为你还没遇到我
  9、···················
【强国论坛】之时政讨论区:
  幸好这条鱼没被穷棒子小左们抓到,否则一定被他们当场宰了吃。小左们的素质就是低。(张三:2005-04-12 21:10:11)
  胡说八道!这种事只有你们缺德小右才干得出来!你们糜烂小右还恨不得包人鱼为二奶呢。(李四:2005-04-12 21:10:18)
  你不懂就别乱叫,包二奶的都是大左,大左在现实中享受既得利益,小左却在这里穷叫唤,傻不傻啊你们?(张三:2005-04-12 21:10:21)
  你懂个鸭子?!右派才是真正既得利益者,剥削工人血汗。左派是真正追求人民当家作主的!(李四:2005-04-12 21:10:28)
  哈哈哈,你作主了吗?国家听你的?(张三:2005-04-12 21:10:33)
  你这条洋奴走苟,你听你主子的?你主子每天给你发多少美元日元??!!(李四:2005-04-12 21:10:42)
  你自已活生生一个家奴太监,没有任何个人权利,空喊一些不着边际的口号倒挺会。(张三:2005-04-12 21:10:56)
  你臭蛆一条,一定要把你们这些小右、网特全抓出来剃阴阳头,戴高帽,挂木牌游街!(李四:2005-04-12 21:11:01)
  你不要满嘴喷粪,不要幻想回到那个时代了,当年怎么没把你饿死啊?(张三:2005-04-12 21:11:23)
  ··············
  (一分钟后)
  大家好,现在发布通告,刚才有两名网友因违反强坛管理条例,笔名已被封。1、张三,2、李四。(李晶:2005-04-12 21:12:20)
【百度贴吧】之日本吧:
看着就象个女U,一定是来自日本海!玩死她!玩死她全家!!玩死她组宗拾捌代!!!
   ———————————————————————————————————————————
  回复:
  1、顶!
  2、强顶!
  3、爽啊!也算我一个。
  4、你们素质太低了。我都替你们感到害躁。
  5、楼上的你搭嘛才素质低!衮!
  6、四楼的我抄你嘛鼻!!
  7、四楼的是诸!
  8、四楼的是网特!别理它!!玩遍日本海女人鱼!!!!!
  9、四楼的HJ,衮出中国人的地盘!低稚日货!坚决反对日本入场!!
  10、·······
 【西祠胡同】之无厘头以人为本;
  曾经有一条美丽德美人鱼放在我面前,我没有珍惜,等我失去的时候我才后悔莫及。人世间最痛苦的事莫过于此。如果上天能给我一个再来一次的机会,我会对那条美人鱼说三个字:我爱你。如果非要给这份爱加上一个期限,我希望是一万年!
  ———————————————————–
  1、楼主品位太差了吧!(猪八)
  2、红烧还是清蒸,是个问题。(郑屠)
  3、真羡慕,不长痔疮!(有痔青年)
  4、楼上兄弟一定用药不对,一般药物制标不制本,而且用了之后很不舒服,整晚失眠,!说起那个痔疮药,去年我在陈家村认识了一位江湖郎中,他药效好、价钱又公道、童叟无欺,干脆我介绍你去买一个疗程吧!(痔在四方)
  5、楼上你妈贵姓?(满嘴废话)
  6、2楼不要开杀戒吗,做鱼就象做人一样,要有仁慈的心,有了仁慈的心,就不再是鱼,是人鱼。(凌空一屁)
  7、放过她?你给我一个不杀你的理由!(郑屠)
  8、正在想……你给我个杀她的理由先!(凌空一屁)
  .
  .
  .
  N楼、楼上的,你们知不知道什么是铛铛铛铛铛铛?

 【Mop版】
  如果真被俺抓到,俺立马就切个十八块,做个美人鱼全席,羡慕死那些无聊的moper,做些有意义的事,好过整日混MOP。表照,照了木有小鸡鸡!
  —————————————————————————————————————————
  回复:
  1、我是美人鱼,如果楼主被俺抓到,俺立马就切个十八块,做个楼主全席,羡慕死那些小鸡鸡!
  2、欧速菜刀,欧还没磨快,怎么垛楼主的小鸡鸡?
  3、偶是刀垫,偶还是喜欢美人鱼躺在偶上面,不喜欢楼主的小鸡鸡。
  4、偶是无聊的moper……
  5、偶是MOP……
  6、偶是中国电信……
  7、偶是网通……
[晋江原创网]之耽美闲情
  标题:假如抓到一条美人鱼……

  RT

  回复:
  1 马上让把她弄哭——鲛人的眼泪素珍珠耶~~
  2 摇头,楼上的8cj。谁说人鱼一定素MM了?偶说这条就是个“他”!
  3 可远观8可亵玩的诱受
   以上
  4 非也非也。如今科技那么发达,只有我们想不到的没有小受做不到的
  5 黑旺才= =|||
  6 那天,我第一次看到了祖辈口耳相传的东海鲛人。他显然还未成年,一头银发刚刚及肩。
  7 我的心中似有什么声音在叫嚣。不待细想,手中的金乌丝渔网已经撒出——只知道,自己一定要得到他!
  8 楼上的大人们继续阿~~期待后续发展ing!!
  9 阿,华丽丽地人鱼恋阿……
  10 难道又一篇接龙强文要出现了吗~cj地仰望。
sina版:xx地惊现美人鱼,上身赤裸引人围观(有图)

  ———————————————————
  1.xx地惊现美人鱼,上身赤裸引人围观?????
  妓者..哈哈哈.

  2.苗一下,是帮主的马甲

  3.不是被广东人抓到了吧,可怜,吃前还要被人用眼睛强奸一遍

  4.顶
  【原帖】 2005-04-11 11:18:00 新浪网友 IP:219.232.59.*
  不是被广东人抓到了吧,可怜,吃前还要被人用眼睛强奸一遍

  5.反对
  【原帖】 2005-04-11 11:18:00 新浪网友 IP:219.232.59.* 不是被广东人抓到了吧,可怜,吃前还要被人用眼睛强奸一遍

  6. IP:219.232.59.* 河南XX地,CAO你吗的河南人,广东人怎么得罪你们了,你们那全是骗子流氓
  【原帖】 2005-04-11 11:18:00 新浪网友 IP:219.232.59.* 不是被广东人抓到了吧,可怜,吃前还要被人用眼睛强奸一遍
  ………..

  N.大家不要骂了,都是中国人嘛

  N+1.管理员我X你吗,为什么删我帖子
onlylady版:

  原文: 我抓住了一条美人鱼,有PP在此:

  1. 哇,皮肤好好啊,不愧是人鱼,保湿做得就是好,羡慕死了
  2. 眼妆不错,有点小烟熏的效果
  3. 我也要翘PP,楼主你能不能和人鱼打听一下她身材是怎么锻炼出来的
  4. 真的是人鱼吗?怎么看着象章小强那个骚货?贱人!见一次我就骂一次!
  5.人鱼的珍珠手链真好看,谁能代购?
  6. 哇塞,楼主你真没经济头脑,这么珍贵的照片你要是卖到媒体会卖好多钱,
  7. 这个人鱼看着象卡米拉,一副二奶像
  8. 支持叉叉姐姐,把二奶踩到脚底,让她永远不能翻身!
  9. 楼上的你反二奶成毛病了?看见一条人鱼也联想到二奶,一副怨妇像!
  10. 说我是怨妇?那祝你LG早日包二奶!
  。。。。。。。
TENCENT QQBBS版。

  假如发现一条美人鱼,亲爱的丫友们,你会怎么办呢?

  1,你想通过网络赚钱么.XXXX网站,注册申请,每天几十美元……..

  2,上网也能赚钱,你想信么??。。。。。。。

  3,网络赚钱新方法,注册网站,即得美元……..

  4,告诉你一个边上网边赚钱的好方法,我一天收了几百美元…..

  5,赚钱……..

  6,江苏一16岁女孩,被网友欺骗,至今下落不明,请把这条消息发几十个在线网友,你的QQ名字将自动变成金黄色。

  7,河南一15岁女孩……..

  8吉林………
机战世界论坛:
1.image1真的么?
2.人鱼是什么,能吃么image2
3.脑白金吃多了,上来冒个泡
4.image3虾,你有伴了
5.管我什么事,能给我自然好啦
6.车,你不厚道,跑到海里把人家逼出来了
7.不要乱说,车又不能下水,他又不是水陆两用车
8.不管怎么用,车还是会湿的……
9.你们image4…………
10.你们别这样
11.这个人鱼看上去满像OL姐姐的
12.是吗?我就说过用海藻养颜的效果不错image5
13.那好,下次我们不要天天卖黄瓜了
14.你是不想天天买菜吧
15.这贴怎么还没看见DIO
16.你有办法打开人鱼的腿么?DIO应该正在想办法呢
17.我只对陆地上的女人感兴趣
18.遥叔,又来造谣了

Read more ...


Spread of Blog

Spread of Blog

Blog, or weblog, refers to certain kind of online journal that, it is time-stamped articles posted on websites, usually in reverse chronological order. In addition, it usually enables visitors to leave comments on the same web page of article, trace related blogs between different websites, and get notification if the blog is updated. It can also refer to the action of writing blogs.

In a famous blog by R Blood, she observed that Jorn Barger named his website, which with daily articles consisted of interesting links to websites and comments of these websites; as Weblog, and it is Peter Merholz who once broke Weblog into the phrase “we blog”.( Blood, R., September 7, 2000), which was shortened to “blog” during spreading. The number of bloggers boosted after web based blog tools, such as one provided by Blogger.com since 1999, enabled writing blog or comments online, and publishing it with a few mouse clicks. But blog had not much attention at that time.

The influence of blogs was boosted by political events. After the beginning of War on Terrorism, while interactive blogs focused on the war, namely warblogs, spread and gain readership because their immediacy and interactivity, and anonymity of comments, while the reaction of mainstream media were slowed by censorship. By the spring of 2003, Forbes Magazine used “war blogger” in this larger sense when listing the “best warblogs.” In the U.S. presidential election of 2004, Blogs by celebrity, such as journalists, politicians and president candidates, gained public attention. Recently, Microsoft said that the free blogging service, called MSN Spaces, had attracted 4.5 million users during its preliminary test phase, which began last December and end a few days ago. The use of the word “blog” was so common that, “blog” was included in the Oxford English Dictionary soon (Quarterly updates to OED Online, March 13, 2003).

Many mainstream medias noticed this tendency.

Google bought blogger.com

I started my first blog at September, 2003. I had been looking for a web application for simplify updating my personal homepage for a long time. The recent update page in my website consisted of paragraphs in reverse chronological order, with a timestamp to mark the date of update, so that the visitors will notice the new updates easily. Despite of its usability, to perform an update of my homepage, I had to find the proper insert-point in the page, add new paragraphs, and then use some FTP (file transfer protocol) software applications to upload the whole modified page to the web server. Soon I found guest books, where visitors can leave messages and internet forums, where registered users can start a discussion or join a discussion, are very useful but both of them are not eligible for a recent update part of my website because they are open for visitors,.

they are hard to attract a wild range of visitors. The visitors can not discuss with the author about an online article without using other applications, such as email, and this limited the influence of websites. Soon online guest books appeared, enabled visitors to post comments of all articles in a single page. Soon internet forums were designed for discussion, enabled users to post comments of an individual article and then visitors can read the article and its comments in the same page. However, unlike internet forums and online guest books, blog articles have static address for individual entries, which enables search engines to list them in search results, and the large amount of trans-website links were considered as citation by the page rank systems, which used by search engines to sort results, made them appears in the front of the search result lists, thus increased the influence of blogs. Many blog tools also automatically add TrackBacks, or links between an article and the articles its references to simplify the difficulty when the visitors tracking between related articles. These features of blogs made trans-website discussion much easier, and these conveniences speed up the spreading of blog.

In addition, several tools and services are developed for the proliferated demand and boosted new demands. Trackbacks make the related blogs linked together, and comments made it possible for authors to discuss their articles on the same page of the article. Blog hosting sites launched one another, and a lot of personal homepage providers became blog providers. News aggregators appeared to simplify posting and reading blogs. The page rank system used by search engines, promoted the most cited blogs by revealing their trackbacks International blog service providers made it possible to write blogs on localized websites. Such conveniences made blogging easier and more and more people became bloggers.

Since the number of blogger increased so fast; it has formed many communities.

Influence

As a result of explosion of number of bloggers, several communities were created on certain topics and direct the discussion in existing communities such as warblogs, Blawgs, tech blogs and team blogs, sometimes called blogosphere. Opinions, ideas and discussions around a particular subject or controversy can easily spread in blogospheres through trackbacks and dominate the topic of a blogosphere in a period of time. In order to keep the high discussion quality of the blogospheres, some bloggers dispatch their posts into different blogospheres. For example, I have 5 blogs, one to trace the new technologies, one to discuss common technologies, 2 for archive, and 1 for other posts.

Some blogospheres have great influence. They have quicker responses to breaking news than major media (Conference Examines Blogs’ Impact on News. Nov 14, 2004), and some news stories were knock down by bloggers (Macht J., Sept 27, 2004). They were also responsible for pushing the story of Trent Lott, then the Republican leader of the Senate into the news, after the mainstream media missed it, and caused his resign. MSDN blog, a group of blogs of Microsoft employees and product teams, became the information and feedback center of Microsoft related technologies.

Businessman will never ignore such a large group. For one, Google’s AdSense, which deliver content-relative ads to pages, became ubiquitous on blogs, and some bloggers can earn a lot of money by talking about certain products.(Gard,L. Dec 13, 2004). For another, many people tried a lot to post unwanted blog spam to promote the spammer’s website, and made major search engines changed their page ranking system.

Conclusion

.    Despite of some tiny problems, more and more people will start blogging, entering blogosphere, and try to promote themselves. Blog will become as popular as email, or even more. Popular.

Reference

Associated Press. Conference examines blogs’ impact on news.( Nov 14, 2004). eWeek.

Blood, R..(September 7, 2000) Weblogs: A history and perspective, Rebecca’s Pocket... <http://www.rebeccablood.net/essays/weblog_history.html”>.(April 14, 2005)

Gard,L. (Dec 13, 2004). The business of blogging; explosive growth means web logs are suddenly in Madison Avenue’s sights. Business Week. 2004(3912) p117.

Macht J.( Sept 27, 2004). How to knock down a Story: THE BLOGGERS. Time 164(13). p30.

Quarterly updates to OED Online (March 13, 2003) Oxford English Dictionary<http://www.oed.com/help/updates/motswana-mussy.html>.(April 14, 2005)

Read more ...


Champ de Coquelicots, Environs de Giverny

I fell comfort with the first look to Champ de Coquelicots, Environs de Giverny. It is basically green, with red flowers in the center and dirty yellow sky at the top. The usage of implied lines, height of plants and shadows expressed the shape of the field.

Read more ...


Lincoln’s assassination

The assassination of A. Lincoln on April 14, 1865 may be the result of his making enemies by his good qualities and acts. He represented the poor, freed the slaves, which may have led to him being killed.

Read more ...


4-11日全球互联网群发性故障

美国中部夏令时4月11日,本市多个因特网服务商,包括Yahoo DSL和得克萨斯州教育网的服务短时间中断。根据报道,在同一时间部分中国和澳洲因特网服务商的服务也出现中断。

一些论坛有发帖声明此次网络故障是由于中国电信遭受到了日本黑客的攻击,号召向日本发动网络攻击。也有人声明上海的国际出口海底光缆被一艘日本托船故意搞断。还有人声明日本黑客在其网站宣布对这次攻击负责,理由是CNN网的投票中国人投反对票的人越来越多,所以日本黑客攻击中国网络,是为了让中国人无法参加投票。

Read more ...


Summary

Story: http://www.reuters.com/newsArticle.jhtml?type=internetNews&storyID=8109019

SEATTLE (Reuters) - Microsoft Corp.  The world’s largest software maker, launched on Wednesday its MSN service allowing Web users to publish and track each other’s blogs, or online journals.

Redmond, Washington-based Microsoft said that the free blogging service, called MSN Spaces, had attracted 4.5 million users during its preliminary test phase, which began last December.

Microsoft’s MSN Internet division also launched the latest version of its MSN Messenger for swapping instant messages and sharing photos.

Blogs, short for “Web logs,” have become a popular way for Web users to publish their opinions, observations and information on the Internet to a wide audience.

“We expect this to have wide appeal outside the United States,” said Blake Irving, vice president of communication services at Microsoft’sMSN Internet division, adding that MSN Spaces would be available in 15 languages in 30 markets.

Yahoo Inc., MSN’S rival, also launched a new Web log and social networking service called “Yahoo 360.” Google Inc., Microsoft’s newest rival in online search and Web-based services, also has a popular blogging service called Blogger that the Web search company bought in 2002.

According to Reuters, Microsoft is expanding its online services to fit new demands, such as blogging and winks in MSN Messenger. This step is likely to invoke a new round of service competitions among major online service providers, such as Yahoo and Google.

Summary:

Microsoft is updating its service to fit new demands, such as blogging, and attracted a lot of users in a short time. This step may boost competitions between Microsoft and its rivals.

Response:

In modern internet age, a successful new service will be followed with a competition in no time. After Google announced its GMail plan a year ago, which provide record high 1GB free email accounts, almost every free major email service provider increased their user storage limit, such as Hotmail (from 2M to 250M) and Yahoo (from 6M to 1G) After Google acquired Blogger.com, Microsoft began the beta test of MSN spaces, which include major function of old MSN groups and introduced the blog function. It is still too early to say who will win this the competition, but the immediately result of it is the improvement of user satisfaction, which is the most effective way to maintain user’s loyalty and attract potential users.

Question:

  • What is you email service provider? Why did you select it?

  • Why do you check many email boxes, if you have more than one email service provider?

  • How will you react if the service provider sends advertisement email to your email box, or adds advertisement to your homepage?

  • How will you react if you are told that you email service is not longer free?

  • How you think about personal online publishing, such as blogging?

  • Do you think internet censorship may affect personal online publishing?

Read more ...


Blogging

Given the graphs from “Population, Poverty and the Local Environment”, I conclude that the decreasing percentage of American women’s share of paid employment is a contribution of increasing unpaid working in home, when the number of children increases. For one, in the second graph, the unpaid house work-load increases gradually until the number of children exceed 7, which showed expressed a sharp increase for 7 or more children. Generally speaking, an American woman who has more children would have more house work. For another, according to the third graph, the percentage of American women’s share of paid employment steadily decreases when the number of children increases. That is to say, the percentage of American women’s share of paid employment steadily decreases when unpaid house working gradually increases. According to graph “Federal Expenditures, 1983 TOTAL: 624.2 Billion”, I found that the money spent on national defense and international relations is too much, and more money should be invested in welfare. While the other major countries, such as China and Russia, spend less on national defense either in amount or in percentage, and more on welfare, maintain such high military expenditure is not efficient, and this outcome has less little benefit to the economy than welfare programs. According to Reuters, Microsoft is expanding its online services to fit new demands, such as blogging and winks in MSN Messenger. This step is likely to invoke a new round of service competitions among major online service providers, such as Yahoo and Google.. In modern internet age, a successful new service will be followed competition in no time. After Google announced its GMail plan a year ago, which provide record high 1GB free email accounts, almost every free email service provider increased their user storage limit, such as Hotmail (from 2M to 250M), Yahoo (from 6M to 1G), Sina (from 50M to 1G) and Netease (from 50M to 2G). After google acquired Blogger.com, Microsoft began the beta test of MSN spaces, which include major function of old MSN groups and introduced the blog function.

It is still too early to say who will win this the competition. But the immediately result is the improvement of user satisfaction. That is the most effective way to maintain user’s loyalty and attract potential users.

Read more ...


Xu Beihong

influential Chinese artist and art educator who, in the first half of the 20th century, argued for the reformation of Chinese art through the incorporation of lessons from the West.

Xu was first taught art in his childhood by his father, Xu Dazhang, a locally known portrait painter. In the period from 1919 to 1927, he studied in France and graduated from Paris Higher Art School He returned to China in 1927 and successively worked as a teacher in Shanghai South China College of Fine Arts He went to Beijing in 1946 and worked as the President of Public Beijing Arts and History School and the Chairman of Beijing Art Workers Association. In 1949, he was elected as the Chairman of National Painters Association by the representative conference of all-China literary and art workers.

Grazing Horse, dated 1932
Xu Beihong (Chinese, 1895–1953); Qi Baishi (Chinese, 1864–1957)
Hanging scroll; ink on paper; 20 1/2 x 14 3/4 in. (52.1 x 37.5 cm)
Inscribed by the artist and by Qi Baishi
Gift of Robert Hatfield Ellsworth, in memory of La Ferne Hatfield Ellsworth, 1986 (1986.267.192)

This painting exemplifies Xu Beihong’s fusion of East and West. While employing the conventional Chinese medium of brush and ink, Xu’s drawing technique is purely Western. Rather than defining the horse with calligraphically energized outlines, Xu sketches the horse impressionistically with light and dark washes and uninked areas of white paper integrated to suggest the modeling effects of light and shadow. Reflecting studies from life, the horse’s complex pose—foreshortened body, twisting neck, and naturalistically placed legs—is deftly rendered in a few well-practiced brushstrokes, while the layered tones of the animal’s tail give the impression of movement.

Recalling a long tradition of the horse as an emblem of state, Xu Beihong’s spirited animals appeal to national pride. He painted so many of them that they have become synonymous with his name. This early example, still fresh in his mind and in execution, was done for Qi Baishi’s son on the occasion of a visit by Xu to Qi’s house. Qi explains in his inscription that Xu failed to bring his seals, which is why the painting lacks an impression.

image1

Read more ...


在使用浏览器控件的程序中判断HTTP错误

在自动化浏览器控件提交表单之后,浏览器控件可能会在浏览超时时重定向到一个错误页面。有时需要用代码控制页面返回之后重新提交表单。

IE6.0之前的版本浏览器控件没有获得HTTP状态的接口。一个很依赖于网站设置的方法是,捕获TitleChange事件,在页面标题包含”找不到页面”或者”Page Not Found”之类的字符串时,认为浏览失败。另一个方法是处理BeforeNavigate2事件,用winhttp api单独和服务器连接,使用HttpQueryInfo来查询,相应参数是HTTP_QUERY_STATUS_CODE。在这之前,你可能要在打开URL时用INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS标志来防止服务器的重定向。

Read more ...


Summary Assignment

Given the graphs from “Population, Poverty and the Local Environment”, I conclude that the decreasing percentage of American women’s share of paid employment is a contribution of increasing unpaid working in home, when the number of children increases. For one, in the second graph, the unpaid house work-load increases gradually until the number of children exceed 7, which showed expressed a sharp increase for 7 or more children. Generally speaking, an American woman who has more children would have more house work. For another, according to the third graph, the percentage of American women’s share of paid employment steadily decreases when the number of children increases. That is to say, the percentage of American women’s share of paid employment steadily decreases when unpaid house working gradually increases.

Read more ...


early working vs studying

early exhausted life.  I agree her point of view, because I think studying has a higher priority than working in early life, since studying is more easier when the students are young, and the salary will be higher if they succeed in their education.

Read more ...


Notes

Should GM(Genetic Modified) food production be controlled by Government?

Q(Drug) Why fostering drug plants is baned and fertilizing GM food is not?

A:Drugs can benefit only some patients and will not benefit others’s health. Some more effective replacements can also be composed in chemical labs.

GM food can prevent starvation and its side effect is not known clearly. No more effective replacement found.

Q(Clone) Why another genetic technology, Cloning, is baned and producing GM food is not?

A: Cloning human is baned mainly for moral concern, and this concern does not occur for GM food.

Q: The government should deal with public affairs, and GM food production is one.
A: The government should deal some but not all public affairs, and restricting GM food production may delay or stop investigation for its side effect and genetic technology advance.

Q: The government should label GM food on sale.
A: It is not our topic. Our topic is wether the government should control GM crop production or not.The Comsumer can refuse the unlabelled products.Almost all GM products are labelled.
Q: GM food hurt the env
A: I am not sure about this. In fact, it is reported in China that GM corton reduced the use of insectcide and prevented the farmers from diseases caused by insectcide. It have a great advantage of prevention of starvation. And, can u tell me something “harmless”?

??Anyway, global warming appears to be a bigger threaten to global ecosystem, since its effects are already discovered.

Q: It is good, but it is developing and the gov should supervise the production for safety
A: That cost huge budget and make the gov large.

?? Why not use the fund to support GM research to ensure its security?


Why the gov should interven the application of a health developing technology?
Is the production of traditional crops harmless to people?
Don’t you think the consumer should have the right to choose their diet, smoke or drink?The production of tobacco is not controled by gov.

Read more ...


Notes from March 2005

Nature of Tech and attitude tword of tech of US

Read more ...


Trade war over genetically modified food

Trade war over genetically modified food From Wikipedia, the free encyclopedia.

The European Union and the United States have strong disagreements over the EU’s regulation of genetically modified food. The US claims these regulations violate free trade agreements, the EU counter-position is that free trade is not truly free without informed consent.

In Europe, a series of unrelated food crises during the 1990s have created consumer apprehension about food safety in general, eroded public trust in government oversight of the food industry, and left some consumers unwilling to consider “science” to be a guarantee of quality.

This has further fueled widespread ([1] (http://terresacree.org/sondage.htm)) public concern about genetically modified organisms (GMO), in terms of potential environmental protection (in particular biodiversity), health and safety of consumers. Critics of GM foods contend that there is strong evidence that the cultivation of a genetically modified plant may lead to environmental changes. However, whether a genetically modified plant can itself harm the environment is a matter of controversy among scientists.

Although some claim genetically modified foods may even be safer than conventional products, many European consumers are nevertheless demanding the right to make an informed choice. Some polls indicate that Americans would also like labelling but it has not yet become a major issue. New EU regulations should require strict labelling and traceability of all food and animal feed containing more than 0.5 percent GM ingredients. Directives, such as directive 2001/18/EC, were designed to require authorisation for the placing on the market of GMO, in accordance with the precautionary principle. (see also Tax, tariff and trade).

Despite the fact that no scientific study has yet shown genetically modified food to be harmful to humans, a 2003 survey by the Pew Research Center found that a majority of people in all countries surveyed felt that GM foods were “bad”. The lowest scores were in the US and Canada, where 55% and 63% (respectively) were against, while the highest were in Germany and France with 81% and 89% disapproving. The survey also showed a strong tendency for women to be more opposed to GM foods than men. [2] (http://people-press.org/commentary/display.php3?AnalysisID=66)

In 2002, Oregon Ballot measure 27 gave voters in that state one of the first opportunities in the United States to directly address the question. The measure, which would have required labeling of genetically engineered foods, failed to pass by a ratio of 7 to 3.

Friedrich-Wilhelm Graefe zu Baringdorf, member of the German Green Party and vice president of the Landwirtschaftsausschuss (committee of agriculture) of the European Commission said on the 1 July 2003: “In America 55% of the consumers are against GM food and 90% in favor of a clear labelling. The Bush government is ignoring the demand of his own people.”

[edit]

European ban on genetically modified crops In 1999, a 4 year ban was pronounced on new genetically modified crops. At the end of 2002, European Union environment ministers agreed new controls on GMOs that could eventually lead the then 15-members bloc to reopen its markets to GM foods. European Union ministers agreed to new labelling controls for genetically modified goods which will have to carry a special harmless DNA sequence (a DNA code bar) identifying the origin of the crops, making it easier for regulators to spot contaminated crops, feed, or food, and enabling products to be withdrawn from the food chain should problems arise. A series of additional sequences of DNA with encrypted information about the company or what was done to the product could also be added to provide more data. (see Mandatory labelling).

[edit]

Agricultural trade market between USA and Europe The European Union and United States are in strong disagreement over the EU’s ban on most genetically modified foods.

The value of agricultural trade between the US and the European is estimated at $57 billion at the beginning of the 21st Century, and some in the U.S., especially farmers and food manufacturers, are concerned that the new proposal by the European Union could be a barrier to much of that trade.

In 1998, the United States exported $63 million worth of corn to the EU, but the exports decreased down to $12.5 million in 2002.

The drop-off might also be due to falling commodities prices, less demand due to the recession, U.S. corn being priced out of foreign markets by a strong dollar, and importing countries reaction to the planned invasion in Iraq. But farm industry advocates blame the EU’s ban.

[edit]

European proposal over genetically modified food The European Parliament’s Committee on the Environment, Public Health and Food Safety[3] (http://www.europarl.eu.int/comparl/envi/default_en.htm) proposal, adopted in the summer of 2002 and expected to be implemented in 2003 has deep cultural roots, which are difficult to understand for the US agricultural community. It requires that all food/feed containing or derived from genetically modified organisms be labelled and any GM ingredients in food be traced. It would also require documentation tracing biotechnological products through each step of the grain handling and food production processes.

The new European tax, tariff and trade proposal would particularly affect US maize gluten and soybean exports, as a high percentage of these crops are genetically modified in the USA (about 25 percent of US maize and 65 percent of soybeans are genetically modified in 2002).

The ultimate resolution of this case is widely thought to rest on labelling rather than food aid. Many European consumers are asking for food regulation (demanding labels that identify which food has been genetically modified), while the American agricultural industry is arguing for free trade (and is strongly opposed to labelling, saying it gives the food a negative connotation).

Lori Wallach, director of Public Citizen’s Global Watch indicates that American agricultural industry is “using trade agreements to determine domestic health, safety and environmental rules” because they fear that “by starting to distinguish which food is genetically modified, then they will have to distinguish energy standards, toxic standards that are different than those the European promotes”.

The American Agricultural Department officials answer that since the United States do not require labelling, Europe should not require labelling either. They claim mandatory labelling could imply there is something wrong with genetically modified food, which would be also a trade barrier. Current U.S. laws do not require GM crops to be labelled or traced because U.S. regulators do not believe that GM crops pose any unique risks over conventional food. Europe answers that the labelling and traceability requirements are not only limited to GM food, but will apply to any agricultural goods.

The American agricultural industry also complain about the costs implied by the labelling.

[edit]

Official US complaint with the WTO The ban over agricultural biotechnology commodities is said by some Americans to breach World Trade Organisation rules. Robert B. Zoellick, the United States trade representative, indicated the European position toward GMO was thought of as “immoral” since it could lead to starvation in the developing world, as seen in some famine-threatened African countries (eg, Zambia, Zimbabwe, and Mozambique) refusing to accept US aid because it contains GM food.

Zoellick’s critics argue that US concern over Third World starvation is merely a cover for other issues. Some money for development aid is used by the American government via the World Food Program (WFP) to help their farmers by buying up overproduction and giving it to the UN organisation. GM-scepticism interferes with this program. American farmers lost marketshare in certain countries after changing to genetically modified food because of sceptical consumers.

Another European response to the claims of immorality is that the EU gives 7 times more in development aid than the US.

In May 2003, after initial delay due to the war against Iraq, the Bush administration officially accused the European Union of violating international trade agreements, in blocking imports of U.S. farm products through its long-standing ban on genetically modified food. Robert Zoellick announced the filing of a formal complaint with the WTO challenging the moratorium after months of negotiations trying to get it lifted voluntarily. The complaint was also filed by Argentina, Canada, Egypt, Australia, New Zealand, Mexico, Chile, Colombia, El Salvador, Honduras, Peru and Uruguay. The formal WTO case challenging the EU’s regulatory system was in particular lobbied by U.S. biotechnology giants like Monsanto and Aventis and big agricultural groups such as the National Corn Growers Association.

EU officials questioned the action, saying it will further damage trade relations already strained by the U.S. decision to launch a war against Iraq despite opposition from members of the U.N. Security Council. The US move was also interpretated as a sanction against EU for requesting the end of illegal tax breaks for exporters or face up to $4 billion in trade sanctions in retaliation for Washington’s failure to change the tax law, which the WTO ruled illegal four years ago.

[edit]

Ratification of the Biosafety Protocol by the EU parliament In June 2003, the European Parliament ratified a three-year-old U.N. biosafety protocol regulating international trade in genetically modified food, expected to come into force in fall 2003 since the necessary number of ratification was reached in May 2003. The protocol lets countries ban imports of a genetically modified product if they feel there is not enough scientific evidence the product is safe and requires exporters to label shipments containing genetically altered commodities such as corn or cotton. It makes clear that products from new technologies must be based on the precautionary principle and allow developing nations to balance public health against economic benefits.

Jonas Sjoestedt, a Swedish Left member of the EU assembly, said that “this legislation should help the EU to counter recent accusations by the U.S administration that the EU is to blame for the African rejection of GM food aid last year”.

The United States did not sign the protocol, saying it was opposed to labeling and fought import bans.

[edit]

Lifting of the ban On July 2, 2003, the European parliament approved two laws that will allow the EU to lift its controversial ban on GM food. The first law will require labelling for GMO-containing food above 0.9%. It will be applied for human food and animal feed as well. However, animals fed with transgenic cereals will not be included in the labelling. The second law will make mandatory labeling of any food contaminated by non-authorized GMO (in the Union) over 0.5%. This amount will be set for 3 years. After 3 years, all non-authorized GMO contaminated food will be banned. Traceability of GMO products will be mandatory, from sowing to final product. At that time, it was expected the ban would be lifted in the fall of 2003.

However, on the 8 December 2003, the European Commission rejected approval of a controversial genetically modified sweet corn.

Six countries were in favour (33 votes - Spain, UK, Netherlands, Finland, Sweden, Ireland) three abstained (25 votes - Germany, Belgium, Italy), while six countries voted against (29 votes - Denmark, Greece, Luxembourg, Austria, Portugal, France).

That new GM sweet corn, BT-11, produced by Syngenta was modified to produce its own insecticide and is also resistant to a herbicide. It was rejected for the following reasons :

The new labelling and traceability regulations are still not in place The proposal did not include post-approval monitoring of health effects. Some safety questions have not been fully addressed.

Geert Ritsema of Friends of the Earth Europe said: “There is clearly no scientific consensus over the safety of this modified sweet corn. The decision not to approve it is a victory for public safety and common sense. The European Commission now has the opportunity to re-think its position. The public doesn’t want to eat GM foods and question marks remain over its safety. The Commission must put the well-being of European citizens and their environment before the business interests of the US Government and the biotech industry.”

The approval of that gmo corn would have been de facto considered as a lift of the moratorium on new GMO foods. Decision to lift the moratorium might occur in spring 2004.

[edit]

Effect of cultural differences between US and Europe The U.S. population has, historically, placed a considerable degree of trust in the regulatory oversight provided by the U.S. Department of Agriculture and its agencies. There is little tradition of people having a close relationship with their food, with the overwhelming majority of people having bought their food in supermarkets for years. But the 2003 survey by the Pew Research Centrer showed that even in the U.S. 55% see GM food as “bad” food.

In Europe, and particularly in the U.K., there is less trust of regulatory oversight of the food chain. In many parts of Europe, a larger measure of food is produced by small, local growers using traditional (non-intensive & organic) methods (see local food).

See also: Trade war

[edit]

External links

Talk:Trade war over genetically modified food

From Wikipedia, the free encyclopedia.

Is Canada not involved in this mess? Rmhermen 22:36 30 Jun 2003 (UTC)

hum ? Which mess ? Rmhermen, since you are involved here…I wrote most of this article. Please, feel free to copy edit it strongly if you think it is necessary for fluidity of expression ; Thanks User:anthere I wonder if the article as written doesn’t underplay the importance of agricultural protectionism. One of the advantages of forcing GM food labeling, I would think, is that it would give an advantage to small “organic” farmers. This seems quite convenient, given that the EU countries consider preserving the “quaintness” of their countrysides a cultural priority, while the death of the family farm seems to be more generally accepted in North America. Europe certainly wouldn’t be alone in feigning concern over the supposed safety of foreign food in order to protect their own industries (look at what Japan is doing right now re: mad cow disease). – stewacide 23:21 30 Jun 2003 (UTC)

Sorry, but you hit with your “feigning” all the people that are worried. I am worried. So you directly hit me. You are right, agricultural protectionism is involved. But please take care when you just insult hundred of millions of people. (I could also use words on the same level of yours: In Europe we have still the culture to disagree on certain points and not to follow our leaders blindly… do you feel better now? ;-) Fantasy 05:39 1 Jul 2003 (UTC) the usage of “feigning” is totally out of line :-) We don’t feign. I would like to state that I wrote most of the initial article, and as such, it is only my perspective, and not enough to cover the topic by far. I tried to be far on both sides, but I am biased :-) In particular, it would be nice to have more on other countries positions on the matter. This is a planetary war, not to be reduced to US EU only. Yes, it would deserve much more on protectionism. Because this also very important. However, do not give too much importance in the topic to the advantage meant for the organic farmers. At least in my country (which is the first producer in the EU, so is of major importance in this trade war, since being the primary benefactor of protectionism), protectionism is meant to protect traditional agriculture, MUCH more than organic farming. We are first using traditional intensive technics, and the goal in requiring labels is to protect consumers, not organic farmers or organic consumers. Labels are envision for all food. There might be a different trend in other european countries, though I think generally not. ant What I meant was that the governments in European countries may be overplaying the risks of GM foods as a cover for protectionism. I have no doubt that many citizens are personally fearful.

well, if you can find relevant references of people supporting this view, that is just fine. Anthere Also, I agree that this shouldn’t be characterized as just a US vs. EU thing. In fact, the US and EU are traditional allies on issues of agricultural trade in that they’re both strong protectionists. The alliance between the US and the pro-free-trade “Cairns Group” countries (Canada, Australia, and the developing world) is quite unusual. There are probably other countries (Japan?) that side with the EU for one reason or another.

Also, I wonder about strains within EU, such as between food exporters like France and food importers (Italy? Spain?).

Well, you can wonder of course :-) But this has nothing to do with this current discussion :-) It should belong to another article. Since there is a moratorium in Europe, exporting countries such as France do not export gmo toward food importers. Anthere p.s. If that “follow our leaders blindly” thing was a jab at the US, no dice, I’m Canadian (Happy Canada Day to ya’ :)

Also, Europeans accusing North Americans of having a mob mentality is pretty ironic IMHO. When was the last time we had a war or genocide in North America? Europeans and your silly ethnic nationalism; when will you learn!?! ;) – stewacide 07:00 1 Jul 2003 (UTC)

Stewacide, you did not get the point. I just tried to explain you (probably with the wrong example, but it seems that you got insulted, so the effect was right) that YOU ARE HURTING PEOPLE. If you want to discuss something, would it not be better to concentrate on the facts istead insulting people with a different opinion than yours with “feigning”. Fantasy 11:57 1 Jul 2003 (UTC) I think, it is better to restart the discussion:

[edit]

agricultural protectionism versus food safety

  • stewacide thinks, that the EU is using worries about food safety to achieve agricultural protectionism.

  • Fantasy and Ant agree that this is involved. But the main goal in requiring labels is to protect consumers, not organic farmers or organic consumers. Let the consumer decide, if they want to buy modified food.


Perhaps “Genetic Engineering” should be added to the list of Demons and devils that someone is compiling, it certainly sounds very dangerous. Ping 07:11 1 Jul 2003 (UTC)

Despite the fact that no scientific study has yet shown genetically modified food to be unacceptably harmful to people

Has any study found GM foods to be acceptably harmful to people? Evercat 17:56 2 Jul 2003 (UTC)

That’s what I thought when I read it. I’m going to remove the “unacceptably” untill someone can show a study that indicated otherwise. – stewacide there were some “unacceptable” problems reported with severe cases of allergy. But the gmo have been removed. I am not aware of current relevant studies precisely on “acceptable” ones :-). However, I know of current environmental pbs which are considered acceptable. Fun :-) Despite the fact that no scientific study has yet shown genetically modified food to be harmful or harmless to humans

How can any study or any number of studies ever prove something to be entirely “harmless”? – stewacide

IT CANT - it is impossible to prove a lone hypothesis, one can only accumulate evidence that is consistent (or not) with a system of hypotheses that constitute a philosophy. There will always be room for your hypothesis to turn out false, because other assumptions may be violated. Add to this that (the departing agriculture minister indicated) British field trials and other government funded research has intentionally neglected any ‘indirect’ routes by which GMOs may cause harm to humans, such as damage to the ecosystem. So I am worried too (it’s not like you can take GM out of the ecosystem if you got it wrong, and it’s not as if Genetic Engineering is equivalent to the current system of genetic design).

I was pointing out why the addition of the word “harmless” was meaningless and lacking in NPOV. It gives the reader the impression that insuffecient research has been carried out, when in fact no ammount of research could ever be suffeceient to make such a claim (I’m sure there’s a fancy latin name for this type of rhetorical falacy). Would anyone object to me changing it back to “Despite the fact that no scientific study has yet shown genetically modified food to be harmful to humans…” ? – stewacide 07:19 4 Jul 2003 (UTC) I don’t think your proposed wording is true - IIRC some researchers added genes for manufacturing toxins to some previously edible food organism, then demonstrated that it did indeed become toxic… So we need to restrict the statement to stuff actually intended for human consumption (and to avoid giving a misleading impression, to indicate the extent to which people have looked - of course they wont have found a mechanism if they haven’t looked at all - the amount of information in the statement is proportional to the amount of research done.). I wonder if Trade in genetically modified food wouldn’t be a better title? Calling it a “trade war” may have NPOV problems. – stewacide 18:56 2 Jul 2003 (UTC)

But If you say “trade war” every one knows what we are talking about. Wikipedia uses many times the “used” words, not necessarely the “correct” word. Bush is going to court against EU, and if he does not win, I don’t want to know what is next. (By the way: was the “cold war” a war?)Fantasy 21:10 2 Jul 2003 (UTC) it might be different another day. But currently, the trade is a war. An economical war. And that is what the article is talking about. Just talking about trade of a specific product would not perhaps justify an article. In all honestly, I think it would be prudery (politically correct) to rename an article without the “war” word, just to talk about “trade war” in it. And yes, it would be misleading on the topic indeed :-) ant (the cold war was a war imho) of course, you are all welcome to move that to the best host article  :-) But…if we start saying GMO plants have not been scientifically been proved to be dangerous, it is just fair that information is *really* added on the topic, yes ? User:anthere

I think that most of this information on Roundup should be moved to its page, not here. Rmhermen 19:27 3 Jul 2003 (UTC)

I see no pb with that. But, I mostly wrote this because it was added there were no credible scientific proofs GMO could be bad for the environment :-) I think I even forgot to look for RoundUp article. The only thing important imho is

a high number of currently cultivated gmo are those resistant to glyphosate Round up sales have skyrocketted since GMO surfaces increased, and farmers cultivating gmos tend to use much more than before. Round up herbicide active ingredient is glyphosate Glyphosate (also cancerogenous- should I also add it ?) and other Round up ingredients have been proved (relevant scientific studies) dangerous at high quantities, safety issue for farmers, toxic for fauna, less degradable than claimed by Monsanto (even if it is *far* less toxic than plenty other herbicides) Consequently -> use of GMO -> use of round up -> more glyphosate -> pb for humans, fauna, water quality…

Add cases of allergies, increase resistance, bt issues, studies showing diffusion of genes from one species to another (I have some virus diffusion at hand), I think that ultimately, the sentence “no credible studies have shown that some gmo have proven dangerous for the environment” should…just perhaps…be rephrased a bit ?

When done, we could perhaps explain why Gmos are good for a change ?

Anthere |

141, though I agree we should avoid to repeat unduly similar linkages in articles, I also think your way to hunt any double link is not a very good practice sometimes. When an article is - at two different places - referring to two different aspects of another article, it makes sens to orient the reader to this article again, not to let him search several paragraphs above the reference of this article he has maybe not focused on. This is very common practice in numerous articles.User:anthere


Polls done in 2000, (Libération), 73% of French people worried by presence of GMO in food (77% for women)

polls done end of 2002 show (libération)

  • French people totally opposed 48%, opposed 24 %

polls in april 2002 (eurobarometre)

  • Only 31% of europeans would encourage GMO in food.

  • Spain, favorable 35%

  • Germany 52% strongly opposed

  • England, 25% favorable


Basically, 3 persons among 4 opposed and worried, that does not mean “some” but “widespread”. Imho. User:Anthere

Yknow, I coulda sworn waaay more countries than the US were fighting the EU in the WTO over this. – Penta.

It seems to me that this article has a lot of irrelevant references to the Iraq war. Jtrainor 18:06, 6 Dec 2004 (UTC)

Read more ...


genetic discrimination

Discrimination of gender, race in labor market has been a chronic problem in industrialized periods in United States. The advance of genetic technology produces a new kind of discrimination, genetic discrimination. In the article “Gene mapping may foster discrimination”, Paul Racer pointed out that a survey revealed “7 companies are using genetic testing for job applications or employees”, according to the journal Science. However, I think it may cause public fear for genetic tests and researches and can be exploited to discriminate candidates.

For one, since the public already have a skeptical attitude toward genetic engineering, the risk of future exploitation of personal genome, may cause some people to refuse taking genetic tests, and may drop off from genetic research programs, and then delay the progress of science. For another, although it is a great step to discover the relationship between gene and disease, the relationship itself is still a “possibility” of certain illness, and everybody would has some genes vulnerable to this or that diseases, and the decision of denying a qualified candidate by a kind of disease can be exploited to discriminate candidates.

Read more ...


The Schiavo case

The Schiavo case

On Feb. 11, 2000, Pinellas Circuit Court Judge George Greer claimed that there was ‘’clear and convincing evidence’’ that Terri Schiavo would want to disconnect her feeding tube. Theresa (or Terri) Marie Schindler Schiavo, a woman in persistent vegetative state (PVS) for 15 years who suffered a severer brain damage on Feb. 25, 1990 and is suffering the third removal of live support, thus could pass away at any moment now because nutrition and hydration supplies was cut since March 18, 2005 3:00 p.m. EST. This removal is request by Michael Schiavo, the husband and legal guardian of the 41-years-old woman against the wish of her parents. The parents of Terri keep appealing to restore her feeding tube and, despite of the rejection of the court, should regain the guardianship and the right of choose the future of their daughter because of the revealing of new evidences about her medical status, her willing and, as a result, the legacy of the request.

For one, her medical status is still in debate; hence the current condition should be clarified before any decision about life termination. While Washington Times reported ”Nineteen Florida judges and six court appointed physicians have concluded Schiavo is in a persistent vegetative state, allowing the removal to proceed Friday after seven years of court wrangling.”(Washington Times, March 23, 2005).However, CNN reported that “in the affidavit filed on behalf of the state, Dr. William Cheshire, a board-certified neurologist at the Mayo Clinic, stated that his review of Schiavo raises serious doubt about the current diagnosis. He said she displayed context-specific reactions to stimuli, such as upbeat music, colorful objects or the arrival of people into the room.” (CNN, March 24, 2005).

For another, no documentation will of Terri existed to support her husband’s word, which indicates that she does not want to live artificially. “She didn’t leave any written instructions.” He admitted (AOL Journals, March 15, 2005).In another show named “Larry King Live”, he gave another claim: “We didn’t know what Terri wanted, but this is what we want.  ”(CNN, March 18, 2005). Although this statement is not made in front of a court, the contradiction put the “clear and convincing” evidence finding into doubt., which made by Judge Greer to withdraw the feeding tube from Terri.

Furthermore, Although Michael Schiavo rejected offers to when Michael Schiavo, a husband who has been living with another girlfriend for 10 years and has two children by her, might have disqualified himself for a legal guardian by failing to implement the guardianship plans and requesting the death of his wife. In fact, there have been 3 guardians ad litem appointed for Terri in last 15 years, namely John H. Pecarek, Richard Pearse, Esq. and Dr. Jay Wolfson. As a result, decision made by such a doubtable guardian should have less importance than her parents wish to keep their daughter alive.

After these analyses, the feeding tube should be reconnected before the contradictions, namely physical condition and will of Terri Schiavo, are solved. It would be too late if it is not reestablished immediately. Since her husband is not a qualified guardian, her parents should receive her guardianship and then decide her fate.

Reference:

l         AOL Journals  (March 15, 2005).Transcript: Michael Schiavo on  ‘Nightline’ ..http://journals.aol.com/justice1949/JUSTICEFORTERRISCHIAVO/entries/630  (March 24, 2005)

l         CNN (March 24, 2005) Florida judge rejects state custody bid in Schiavo case< http://www.cnn.com/2005/ALLPOLITICS/03/23/schiavo.jeb.bush/?section=cnn_allpolitics> (March 24, 2005)

l         CNN (March 18, 2005) Transcript: Larry King Live<

http://transcripts.cnn.com/TRANSCRIPTS/0503/18/lkl.01.html >(March 24, 2005)

l         Washington Times. (March 23, 2005) House GOP files Supreme Court brief on Schiavo<http://washingtontimes.com/upi-breaking/20050323-051313-8081r.htm> (March 24, 2005)

Read more ...


示例:在MFC程序中集成.Net中的控件

从.Net Framework 1.1开始,.Net控件可以以ActiveX的方式被集成到非托管宿主中——但是官方的支持只对于使用托管C++的MFC程序。Chris Sells在2003年3月份的MSDN杂志中描述了这样一个示例(https://web.archive.org/web/20030304083154/http://msdn.microsoft.com/msdnmag/issues/03/03/WindowsForms/default.aspx)。这个示例使用的代码稍微繁琐,而且没有描述如何处理控件的事件。MFC 8.0增加了一系列这方面的支持来把这个集成过程简单化(参考http://msdn2.microsoft.com/en-us/library/ahdd1h97.aspx)。这使得在MFC程序中使用.Net中的一些比较好用的类,例如System::Windows::Forms::PropertyGrid比以前容易多了。

举例来说,要在MFC的基于对话框的程序中使用System::Windows::Forms::PropertyGrid控件,首先创建一个基于对话框的程序,添加必要的引用:

Read more ...


《转换指南: 将程序从托管扩展C++迁移到C++/CLI》译后

终于把Stan Lippman先生的这篇文章译完了。从去年4月在全球MVP峰会上拿到这篇文章的手稿到现在,差不多一年过去了。虽然当时的Visual Studio 2005还不支持一些语法,但是我和董颖涛对新的C++/CLI语言都很感兴趣,在当时就讨论过翻译的问题。之后我就开始翻译这篇文章,但是进度一直很慢——主要是杂务太多、语言上的困难(尽量避免误解和词不达意的情况,以及斟酌用词的选择)。在1月份完成了全文之后,看到了Sunhui的一篇文章(http://community.csdn.net/expert/Topicview1.asp?id=3834281),觉得附录里面讲到的一些内容或许一些人也有兴趣,所以继续翻译附录的工作,幸好现在是春假,比较有时间,终于在今天完成了。译文目前在http://blog.csdn.net/jiangsheng/archive/2004/10/18/140450.aspx可以访问,希望读者指正。

在翻译过程中得到了曾毅的帮助,得以联系到Stan Lippman先生,在此一并感谢。

Read more ...


Telephone Tips

Answering the phone:
・ Hello? (informal)
・ Thank you for calling Boyz Autobody. Jody speaking. How can I help you?
・ Doctor’s office.
Introducing yourself:
・ Hey George. It’s Lisa calling. (informal)
・ Hello, this is Julie Madison calling.
・ Hi, it’s Gerry from the dentist’s office here.
・ This is she.*
・ Speaking.*
*The person answering says this if the caller does not recognize their voice
Asking to speak with someone:
・ Is Fred in? (informal)
・ Is Jackson there, please? (informal)
・ Can I talk to your sister? (informal)
・ May I speak with Mr. Green, please?
Would the doctor be in/available?
Connecting someone:
・ Just a sec. I’ll get him. (informal)
・ Hang on (hold on) one second. (informal)
・ Please hold and I’ll put you through to his office.
・ One moment please.
All of our operators are busy at this time. Please hold for the next available person.
Making special requests:
・ Could you please repeat that?
・ Would you mind spelling that for me?
・ Could you speak up a little please?
・ Can you speak a little slower please. My English isn’t very strong.
・ Can you call me back? I think we have a bad connection.
Can you please hold for a minute? I have another call.
Taking a message for someone:
・ Sammy’s not in. Who’s this? (informal)
・ I’m sorry, Lisa’s not here at the moment. Can I ask who’s calling?
・ I’m afraid he’s stepped out. Would you like to leave a message?
・ He’s on lunch right now.Who’s calling please?
・ He’s busy right now. Can you call again later?
・ I’ll let him know you called.
I’ll make sure she gets the message.
Leaving a message with someone:
・ Yes, can you tell him his wife called, please.
・ No, that’s okay, I’ll call back later.
・ Yes, it’s James from CompInc. here. When do you expect her back in the office?
・ Thanks, could you ask him to call Brian when he gets in?
・ Do you have a pen handy. I don’t think he has my number.
Thanks. My number is 222-3456, extension 12.
Confirming information:
・ Okay, I’ve got it all down.
・ Let me repeat that just to make sure.
・ Did you say 555 Charles St.?
・ You said your name was John, right?
I’ll make sure he gets the message.
Listening to an answering machine:
・ Hello. You’ve reached 222-6789. Please leave a detailed message after the beep. Thank you.
・ Hi, this is Elizabeth. I’m sorry I’m not available to take your call at this time. Leave me a message and I’ll get back to you as soon as I can.
Thank you for calling Dr. Mindin’s office. Our hours are 9am-5pm, Monday-Friday. Please call back during these hours, or leave a message after the tone. If this is an emergency please call the hospital at 333-7896.
Leaving a message on an answering machine:
・ Hey Mikako. It’s Yuka. Call me! (informal)
・ Hello, this is Ricardo calling for Luke. Could you please return my call as soon as possible. My number is 334-5689. Thank you.
Hello Maxwell. This is Marina from the doctor’s office calling. I just wanted to let you know that you’re due for a check-up this month. Please give us a ring/buzz whenever it’s convenient.
Finishing a conversation:
・ Well, I guess I better get going. Talk to you soon.
・ Thanks for calling. Bye for now.
・ I have to let you go now.
・ I have another call coming through. I better run.
・ I’m afraid that’s my other line.
I’ll talk to you again soon. Bye.
Telephone Tips
1. Speak slowly and clearly
Listening to someone speaking in a second language over the telephone can be very challenging because you cannot see the person you are trying to hear. However, it may be even more difficult for the person you are talking with to understand you. You may not realize that your pronunciation isn’t clear because your teacher and fellow students know and understand you. Pay special attention to your weak areas (such as “r’s” and “l’s” or “b’s” and “v’s”) when you are on the phone. If you are nervous about using the phone in English, you may notice yourself speaking very quickly. Practise or write down what you are going to say and take a few deep breaths before you make a phone call.
2. Make sure you understand the other speaker
Don’t pretend to understand everything you hear over the telephone. Even native speakers ask each other to repeat and confirm information from time to time. This is especially important if you are taking a message for someone else. Learn the appropriate expressions that English speakers use when they don’t hear something properly. Don’t be afraid to remind the person to slow down more than once. Keep your telephone in an area that is away from other noise distractions such as a radio or television.
3. Practise with a friend
Ask another student to practise talking on the phone with you. You might choose one night a week and take turns phoning each other at a certain time. Try to talk for at least fifteen minutes. You can talk socially, or role play different scenarios in a business environment. If you don’t have access to a telephone, you can practise by setting two chairs up back to back. The most important thing about practising telephone English is that you aren’t able to see each other’s mouths. It is amazing how much people lip-read without realizing.
4. Use businesses and recordings
There are many ways to get free telephone English practice. After business hours, you can call and listen to recorded messages. Write down what you hear the first time, and then call back and check if your notes are accurate. Use the phone in your everyday life. Call for a pizza delivery instead of going out to eat. Call a salon to book a hair appointment. You can even phone the movie theatre to ask for the listings instead of using the newspaper. Some large cities have free recordings you can call for information such as your daily horoscope or the weather. (Make sure that you aren’t going to get charged for these numbers first.) Some products have free phone numbers on the packaging that you can call for information. Think of a question you might want to ask and call the free number! For example, call the number on the back of the cereal box and ask for coupons. You will have to give your name and address. Make sure you have a pen handy so that you can repeat the information and check your comprehension.
5. Learn telephone etiquette (manners)
The way that you speak to your best friend on the phone is very different to the way you should speak to someone in a business setting. Many ESL speakers make the mistake of being too direct on the telephone. It is possible that the person on the other line will think that you are being rude on purpose if you don’t use formal language in certain situations. Sometimes just one word such as “could” or “may” is necessary in order to sound polite. You should use the same modals you would use in a formal “face-to-face” situation. Take the time to learn how to answer the phone and say goodbye in a polite manner, as well as all the various ways one can start and end a conversation casually.
Practise dates and numbers
It only takes a short time to memorize English Phonetic Spelling, but it is something that you will be able to use in any country. You should also practise saying dates and numbers aloud. You and a friend can write out a list of dates and numbers and take turns reading them over the phone to each other. Record what you hear. Swap papers the next day and check your answers.

Read more ...


Immigration Past and Present

Immigration Past and Present

Reasons: Economic/Political/Natural Disasters

Economic


Political
Political Persecution
Natural Disasters:
Draughts/Famines

2 Kind of people

Not want to leave,Great press

Adventure , like to move

View themelves and nation

Briton consider self settlers ,not think move,but settling land for mother country

Dutch,Frech,German and scotch-ireish
Black for slaves
1776in US, 40% non-British, Maj spoke English
(Colonial period)

Greate Immigration(1730-1930) 3 major stage

1

1830-1860
before  small group, 10k /year
1830 600K arrived
1840 1M700K arrived
1850 2M600K arrived
Maj from Ger, Great Britein and Ireland

2 1860-1890(10M arrived)

Maj from Ger, Irelandand  Great Britein, as well as Denmark, Norway and Sweden

3 1980-1930(22M arrived)
Greece,Ita,Port,Spain,as well as Poland,Russia

why European leave?

1 population of EU doubled during 1750-1850
 industral cause wide unemployment
farm land scarcity.
US attration
farm land. US 1836 offer public land free to citizens
plentiful Jobs
Freedom of reg and Political Persecution
Natural Disasters
Failure of the potato crop in ireland 1845/1849 starvation

Improved ocean transport

After great Immigration
decline reason
1 law to limit Immigration Chinese Exclu Act 1882
2 Eco and Geopolitical 1929
3 WW2

exceptions quicies refugees
EU 22% Largest is  quite Diffreent areas
Phi,Korea,China Indea,West Indies and Mex
Land is not plantiful
not need unskilld worker
gov restrict Skillful people to be success
political and eco Immigration will resume

Read more ...


Chinese diet

Chinese is famous for its food. In the history, Chinese have tradition to eat a wild range of foods and does not have a good eating habit, but it is changed in recent years. Chinese not only changed some food sources, but they also changed the ways they eat.

First, some foods are not important in Chinese diet as before. For one, Rice used to take a great part of Chinese diet, but rice is less ate now before because people are getting rich and have more choice on food, such as meat or fast food. As a side effect, diet foods consumption is increasing. For another, people stopped eating some wild animals because they are frightened by the spread of SARS. A characteristic of Chinese diet culture is that people eat almost all animals, such as monkey, bear, crow, toad, snake, mouse, spider, roach and scolopendra, but after the burst of SARS, people don’t eat them anymore.

Second, people changed their eating habits a lot. Not only modern lifestyle prevent people from waiting hours for a complex cooking, but also a lesson taught by the spread of SARS rejects some unhealthy traditional habits. In modern life, people prefer fast food because they have only little time for them. Long time cooking, as a contrast, is unlikely happen in modern lifestyle. One off dishware is more often used because of health consideration.

Although China has a long history about food, the Chinese changed a lot in food area. This is caused by globalization and preventing some diseases.

Read more ...


Working Tourism

Sustainable Tourism in Mozambique, Part III

Working Tourism

Not only does Mozambique have many natural and culture tourism resources, but she also has great potential of working tourism opportunities. Working tourism in Mozambique is still in the beginning for historical and economical reasons. World Bank reported that “The resource base is seriously threatened by population growth, extreme poverty, poor management and utilization and lack of financial resources.” (Mozambique - Transfrontier Conservation Areas and Tourism Development Project, 2004). These potential working tourism positions distribute in many areas, such as education, infrastructure development and natural and culture conservation development.

First, education positions are needed since local communities have little recognitions of tourism benefits and opportunities. Mr. Albino Celestino Mahumane, the Ministry of Tourism of Republic of Mozambique, reported that Mozambique had a very low level of schooling and “link between these resources and communities is crucial for development in the medium and long term.” (Mahumane, A. C., 2001). Possible positions could be English and Health, because there are many useful academic resources in these fields.

Second, positions in infrastructure development, such as roads, airports, telecommunications, water and electricity, health services, should open to attract tourists. To develop tourism in inland area, more transportations and accommodations need to be built while most of these are near the coast currently. (Mahumane, A. C., 2001). Health service is another problem that needs assisting. Again, existing technologies and human resources from foreign tourists can be used to help efforts in these improvements.

Last, increasing working positions for tourists in these areas not only help ecotourism projects with financial benefits but also with their skills and experiences. For one, “tourism in Mozambique is based on its natural resources” (Mahumane, A. C., 2001). For another, “Development of ecotourism projects does require cash and a good investment climate and some participants in the seminar felt that there were often considerable difficulties in securing finances for ecotourism projects.”(Seminar on Planning, 2001).

After these analyses, where nature-based and culture-based tourisms are unlikely to have sufficient funds for themselves, working tourism can be a supplement of them. It not only provides assistance for them, but also creates its own attraction in education and infrastructure developing.

Reference:

World Tourism Organization, Seminar on Planning, Development and Management of Ecotourism in Africa (March 5-6, 2001). <http://www.world-tourism.org/sustainable/IYE/Regional_Activites/Mozambique/Mozambique-table-intro-sum.htm > , Maputo, Mozambique (March 6, 2005)

Mahumane A. C. (March 5-6, 2001).ECOTOURISM IN MOZAMBIQUE (March 5-6, 2001). <http://www.world-tourism.org/sustainable/IYE/Regional_Activites/Mozambique/PresAMahumane-Moz.htm> , Maputo, Mozambique (March 6, 2005)

World Bank, Mozambique - Transfrontier Conservation Areas and Tourism Development Project.(Nov 16,2004). http://www-wds.worldbank.org/servlet/WDS_IBank_Servlet?pcont=details&eid=000104615_20041118094642 >

Read more ...


Diet Change

Diet Change

There are many changes in my lifestyle since I moved to USA. My diet is not an exception. The main reasons of this diet change are that some food is hard to find in U.S., or they become too expensive.

It is natural that some food is hard to find in another country, or even can not be found. For instance, the red vegetable bolt, one of my favorite vegetables, is a special local product of Wuhan, and I never find it in U.S. Many other foods, such as Re Gan Mian, or Hot Dry Noodle, and Doupi, or Dried Sheet of Mung Bean, are not cooked in American restaurants because their cooking skills are not well known. Missing food certainly disappeared from my diet.

Even some kinds of food are exported to U.S., many of them they become too expensive for me. An example of this is spinage, which is less then 8 cents per pound in Wuhan, cost me more than 1.5 dollar per pound. I have to replace them with some affordable foods, such as chicken or potato.

Move to another city always change one’s lifestyle, including diet change. Previous local foods fade out, replaced by new local food. As many of my diet change, this one is not made by doctor’s advice, but by objective and financial choices.

Read more ...


Population in US

Population in US
249M people. 8M more 1980
1 China
2 India
3 USA
4 Indonasia
5 Brazil
6 Russia

Race org, Where, Age&Sex

80% white, 12%Black,3% asian 1% native 4% other
Hispanic 9%white, Black,native
Increasing AfricaA 2% Hispanic 3% in last 10 years
5 M polulas
CA 31M NY 18M TX 17.7M FL13.5M PV12M
55.6% SW(Larger area) East more densive
3/4 live in natrualpolitan 20% rural
1990 women 60M more than man
high death rate for man when they get older
live fe 79 years/ma 72 years
AVG age 30(1980),33.1 (1990) death rate- birth rate+

Read more ...


draft

       Wuhan, the capital of Hubei Province in central China, is the one of the largest city in China. It is a major inland transition center because it is the joint of Han River and Yangtze River, and a rallying point of Major railway. Its Hanzheng Street market is one of the largest markets in China. Thus, although tourism can be improved, but this is not effective, because the scabrous environment problems and poor infrastructures.

Tourism in Wuhan, as one of the old, large cities, has developed already. According to the official website of Wuhan government, Wuhan was named Excellent Tourism City in China by National Tourism Administration. The city is hard to become more famous, build more conservation zone, have more transportation, or reveal more scenes. Although the number of tourists increased a little after several efforts were made in recent decades, such as that many railways, gas stations, highways, electrical billboard was disseminated, many hotels were built. However, the improvement is mainly for business purpose and their contributions to tourism are not very notable.

Read more ...


Win32 & .Net Q&A

问《VC++技术内幕》第四版p217,关于线程和MFC书上说,不允许在线程之间共享MFC对象(此原则不适用于直接从CObject派生的对象或者是简单的类),那么我想在一个线程中打开一个txt文件并向里面写数据可否这样做:

其中CString g_strSavepath;是一个全局变量。

Read more ...


Primates

A few primates live on the ground, but most primates spend their time in trees because they have good eyes, grasping hands and feet, and their bodies are well suited to life in the trees. First, primates have large eyes to look straight forward; in addition, higher primates can focus both eyes on the same object and some primates also see colors. Second, besides many other mammals have claws, primates have flat nails on the end of their fingers and toes to help support enlarged pads, which is sensitive to touch and have nonskid ridges. Last, according to Gordon M. Shepherd (2004), “Comparisons of the decreasing size of the olfactory system relative to expansion of the visual, auditory, and somatosensory systems usually focus on the olfactory bulb and lateral olfactory tract, which are relatively small. “ That is to say, although primates among the most intelligent of mammals for most of them have large brains, but the part related to the sense of smell of their brain is relatively small, because they do not depend much on their smell(Humans Smell with Bigger and Better Brains) .

Primates have fewer young than most mammals because a mother bears only one or two young at a time, but the young primates stay with their mothers for a longer time, which allows them to learn more from their mothers and the group they live in.

Read more ...


Working Holidays in Mozambique

Doctor (General Practitioner), Angoche Rural Hospital, Angoche, Nampula Province, Mozambique (M7)

The Skillshare International health program in Mozambique aims at improving access to health care services for rural communities by helping to build the capacity of health care institutions through skills development, and supporting the delivery of primary health care programmes. Angoche Rural Hospital is the only hospital providing primary health care services to Angoche district and surrounds in a improve the skills of staff. You must be willing to live and work in difficult weather (warm/hot) and under-resourced conditions, in an area catchment area inhabited by over 250,000 people. Your day to day activities include heath care management of emergencies/urgent care, in-patients and out-patients. You will also participate in training programs to falling within the malaria belot. You must be willing to learn Portuguese, the working language. This is two year placement with opportunities for renewal.

Read more ...


Editor’s note

First, I am most delighted that the city government continues supporting Urban Park Project (UPJ). I am also pleased with that the government had assured that the urban park will continue to preserve nature instead of to change it to a tourist site.

However, I am sorry to hear that the UPJ can not support Urban Park in all forms because it has limited resources. Since maintaining this project need more funds than expected, I suggest that limited, sustainable tourism such as ecotourism and working holidays should be arranged to help the UPJ experts continue to do their best.

Read more ...


Primates

Primates nurse their young with milk. The primate family, namely monkeys and apes, is one of the major groups of mammals. The word “Primate” comes from the Latin word “primus”, which means “first”. Most primates live in tropical places; however, men, classified by Scientists as primates, live in almost all regions and climates of the world.

A few primates live on the ground, but most primates spend their time in trees because they have good eyes, grasping hands and feet, and their bodies are well suited to life in the trees. First, primates have large eyes to look straight forward; in addition, higher primates can focus both eyes on the same object and some primates also see colors. Second, besides many other mammals have claws, primates have flat nails on the end of their fingers and toes to help support enlarged pads, which is sensitive to touch and have nonskid ridges. Last, although primates among the most intelligent of mammals for most of them have large brains, but the part related to the sense of smell of their brain is relatively small, because they do not depend much on their smell.

Read more ...


Survey Assignment

Knowledge of Foreign Countries of UT Austin students

Many Americans pay little attention to foreign countries. Particularly, American students in UT Austin are lack of knowledge of international affairs and history. According to the data collected for the survey about China, one of the most important nations in the world, most UT Austin students could not tell the name of the leader of China or anything about Chinese History. It is dangerous for these students if the situation keeps unchanged, but there are some ways can help them.

Read more ...


Generation Gap Prevention

Jason

Generation Gap Prevention

I am only 7 years elder than my niece, and I thought there were no generation gap between she and me. I’m not so sure about this after I moved to the city where she lived. Although I could have a conversation about internet, computer and study with her like a teacher, I could hardly use another topic since culture evolved, fashion refreshed, famous names faded out, common words altered, politicians went in and out of position, and economic is reformed. Therefore, embarrassing silence frequently occurred. This scenario may remain true when I have a child, but now there is something I will do to narrow this gap, such as self-restraint, polite words and respect child.

Read more ...


Summary Assignment

This article is for DeBenedette, V. (1990). Are your patients exercising too much? The Physician and sportsmedicine, 18-8

Are Your Patients Exercising Too Much?

Read more ...


virtual friends

Most teenagers are good on internet. They spend hours in chartrooms. Some people think keep making virtual friends is dangerous that because people are finding in the chat rooms what they can’t find in their real life. However, virtual friends are a good begging of making real friends.

Virtual friends, or cyber friends, are friends that were contacted by internet. Usually, we recognize new virtual friend in chat rooms, newsgroups, online forum, and blogs. Each of them has a topic you interested in, so usually you can friend with a same interest-that is a good beginning of friendship. You can contact a virtual friend online much easier than in real world. You can communicate massively to know one quickly. Therefore, making virtual friends is easier than making real friends.

Read more ...


NoteWorth 011

2 year junior college admission easier, cheaper,live at home,2 year programs ->Ass. degree

Intention:no Degree? Transfer for degree?

Read more ...


Summary Assignment

In the article, “A Global Trade Agreement Must Address Invasive Species”, published in National Wild Life on  the volumn Nov/Oct 2004, Larry J. Schweiger reported that hitchhikers are now moving about freely on a global scale as unintended cargo of trade and travel.Aquatic species transported by ship and arethreatening native shellfish and finfish,  exotic plants from grain shipments are crowding out native species and overrunning wildlife habitat , exotic bee mites on imported fruit have killed 90 percent of the nation’s honeybees, introduced diseases and insects  are devastating native trees, seriously threatening future forest productivity. Trade policy  must address the globalization of species. Misplaced species can threaten our children’s future. At the last of the article, the author said:”We must act now in the face of clear and present danger

Read more ...


interview summary report

The survey is based on 3 male upper division students, 2 U.S. students and a International student from Vietnam. Questionnaires were asked several questions to express their view about university life. One student named himself Justin Loured; other two prefer to be not named.

Majority of the interviewed students have a lot of homework-3 to 5 hours per day. A student with double majors (no named #2) has 5-hours homework per day, Justin Loured has 3-4 hours per day, while he is taking 5 classes only. The major difference between how they imagined and how they fell about the university is the difficulty of the courses, and they think the professors are good and fair in grading students.

Read more ...


Stress Control

You can’t get rid of stress, but you can manage it

Stress is not all bad. Stress is not only death of important friend or get fired, but also holidays,  new job and awards. Some of stress can energize the  body and help our ummune systems. Since stresses are inevitable, control the negitave effect of stress is the only thing you can do with stress.Stress management, is a very common task of U.S. family doctors. two-thirds of visits are about stress problems, says the American Academic of Family Physicans. The gole of the task is to reduce anxiety about stress.This body reaction to stress is useful to physical stress such as a fire, or a fight, but is not good for body for an emotional stress. Doctors use are a lot of skills to prevent illness cause by the anxiety of stress, such as focus and control. Sometimes the situation get out of our control, trying to control it is a huge stressor.

Read more ...


Find and evaluate sources on WWW

English Writing Practice

Jason

Read more ...


Stress Control Questions

1.         Q: Why is stress not all bad?
A: No. it can help immune systems.
2.         Q: What is stress management?
A: Prevent or release the negative affect of stress
3.         Q: Why aren’t health professionals not worried about losing their jobs?
A: There are too many people have stress related problems.
4.         Q: What is the goal of stress management?
A: Let life go on.
5.         Q: How to our bodies react to stress, in general, and why?
A: Excited, to prepare for escape from danger.
6.         Q: What does “all of which” refer to? When are the physical reactions to stress useful, and when are they not useful?
A: Signals of body’s reaction to stress. Physical, but not emotional.
7.         Q: Why does emotional stress hurt us?
A: Physical preparation for emotional stress hurts the walls of blood vessels.
8.         Q: Paraphrase Dave Evans.
A: An employee assistance counselor.
9.         Q: What does Evans recommend, in general?
A: Focus and control.
10.     Q: What does “control what we can without sweating the rest” mean?
A: Work it out actually.
11.     Q: Why did Evans quote Hans Selye?
A: To show the connection between emotional and illness.
12.     Q: Paraphrase Hans Selye.
A: Founder of modern stress management
13.     Q: Does Dennis O’Grady agree with Selye?
A: No.
14.     Q: What does O’Grady think about how much control we have?
A: We don’t have control.
15.     Q: How do we cause ourselves more stress, according to Evans?
A: Chasing unrealizable objects.
16.     Q: According to Bruce Stapleton, what is another thing that causes us stress?
A: Too difficult to achieve goal..
17.     Q: How can we avoid the kind of stress Stapleton is talking about?
A: By defining very clear and definitive focus
18.     Q: What is the main ides of the article?
A: How to improve Stress Management.

Read more ...


Self-Efficacy

Introduction

“Attitude decides everything”, former Chinese men’ soccer team coach Bora Milutinović kept telling to his squad during the qualification for World Cup 2002 Finals. Although the first experience in WC Finals was not enterprising, the qualification itself was considered as a great achievement. Why they could not occur in WC Finals earlier when they used to have better players and a better team? I think the main reason of it is that they did not realize their ability well. Well self-judgments of personal capabilities to initiate and successfully perform specified tasks at designated levels, expend greater effort, and persevere in the face of adversity, holds significant power for predicting and explaining academic performance in various domains.

Read more ...


First Children and Education (version 2)

Introduction

The first children of families were used to success their families, as a result, they usually have been educated more carefully, and then they are more educated than their younger siblings. But when time passes by, things are changing. Succession is not exclusive, and children have equal right to be educated now. Do the former successors have equally opportunities to get higher degrees now? No, younger children are more successful to get higher education; not only because the parents are more experienced since the birth of the first children, but also because younger children can benefit from their older siblings.

Read more ...


Introduction/Conclusion

Introduction

The first children of families were used to success their families, as a result, they usually have been educated more carefully, and then they are more educated than their younger siblings. But when time passes by, things are changing. Succession is not exclusive, and children have equal right to be educated now. Do the former successors have equally opportunities to get higher degrees now? No, younger children are more successful to get higher education; not only because the parents are more experienced since the birth of the first children, but also because younger children can benefit from their older siblings.

Conclusion:

Again, in general, more skilled parents and sometimes a role model sibling in are two major differences between a first child and her/his younger siblings. They lead to better education quality and usually higher education degree for younger siblings.

Read more ...


Public Education Notes

Public Edu philosophy and funding

Compulsory. 16 / 9 grade

Read more ...


Notes

Public Edu phylosephy and funding

Compulsory. 16 / 9 grade

Control: No nation wide curriculum set by fed. fed. control by Funds to special programs. handicap and bilingual programs not as other countries.
 Education control
  Locally 3 level
 State Depart of Edu 2 basic  fun
curriculum requirement for all school in the state
   numbers of credits to graduate
 School district
  number decided by size of population and size of state
  run by school board
  determine content of courses
   decide available elective courses
  operation of the school
   hiring
 School
  Teacher decide to to teach content and preparing and giving exam
 local control by fund
Money from, Tuition go
Fond :8% from Fed. 40% from state texes, 52% from local tax from local community.(by voters)
Tuitions
 Equality of opportunity
  public school: funded by gov poor area , less money, less likely children have higher edu.
  Private/Religious school not funded by gov(usual by religious org) . Questions about private school student parents have to pay private school tuition and public edu tax
  Increase secular nature quially
  press on use tax to private school. arguments
   lower taxes?public school offer the best change of equally.should not be less funded.private school devisive. own concern.
   parent decide, unfair tax as well as tuition
  solution no to satisfy every

  use of the tuitions foutures, each child to receive scholarship with educational value, schools compete the scholarship
   each child to receive scholarship with edueducationalal value,school can add tuition

  in trouble.
film “Stand and Deliver” poor students

Read more ...


First Children and Education

The first children of families were used to success their families, as a result, they usually have been educated more carefully, and then they are more educated than their younger sisters or brothers. But things are changing. Succession is not exclusive, and children have equal right to be educated. Have they equally opportunities to get higher degrees now? No, younger children are more successful to get higher education; not only because the parents are more experienced after the first children, but also because younger children can benefit from their older brother or sister.

Self-efficacy, one’s self-judgments of personal capabilities to initiate and successfully perform specified tasks at designated levels, expend greater effort, and persevere in the face of adversity (Bandura, 1977; 1986), is a relatively new construct in academic research (Multon, Brown, & Lent, 1991; Schunk, 1991a, 1994). Although self-efficacy is examined with much greater depth in therapeutic contexts, recent studies show that self-efficacy holds significant power for predicting and explaining academic performance in various domains (Lent, Brown & Larkin, 1986; Marsh, Walker, & Debus, 1991; Schunk, 1989a; Schunk, 1994; Zimmerman, Bandura, & Martinez-Pons, 1992).

Read more ...


Scholarship Application

Financial Aid Office,

Brooklyn Law School , 467 Atlantic Ave. Suit 632

Read more ...


Expectation differences between male and female in Chinese culture (Revised)

There are many sexism cultures; and Chinese culture is not an exception. Although legends told that humans are created by a female god, Chinese women are not only considered less important in their family, but also deactivated in the education, business and political areas until modern decades.

First, women are expected to have lower position in a family. For one thing, they are not expected to succeed a family. Only male members have their name registered in genealogies. Girls are considered less important than their brothers because they will move out from the family after marriage. For another, traditional people usually expect a husband should be richer, smarter, older or even taller than a wife, even in the equalitarian communist decades. As a result, either in the family of their parents or in their husband’s, women are not considered as important as their brothers or husbands.

Read more ...


How to fail in a class

It is not good topic to talk with, but do some investigations on it will help you aware of its risk and you can device to do something to prevent you from failing.

The first thing to know is the standard of different grading. Usually you can find some relative information in the syllabus of a course. If you did not find it there, you can ask the teacher about it. Generally, the two most common causes why students fail in a class are: a) too many absences, b) failure to do their class assignments. Few teachers pay less care about attendances or assignments and more attention on exams.

Read more ...


Role Modal Notes

No directive entry for “container” in module “docutils.parsers.rst.languages.zh_cn”. Using English fallback for directive “container”.

Good morning everyone. Today I would like to talk about my role modal, Bill Gates, the founder of Microsoft Cooperation, and the wealthiest people in the world. I will describe two of his personal characteristics, his courage and his kindness, and how these characteristics inspired me.

Read more ...


Expectation differences between male and female in Chinese culture

There are many differences between male and female in Chinese culture.

First, women are expected to have lower position in a family.

Read more ...


Sentence Combining

Exercise 5. Sentence Combining

A coin is a piece of metal that has a certain weight. It has the mark of the people who issued it. The Lydians were a powerful people in Asia who needed a convenient method of receiving payment for products they produced, so they made the first coins in the seventh century B.C. These primitively made coins were composed of “electrum”, a natural composition of gold and silver. Later, the Greeks saw these coins and appreciated their usefulness, and they began to make coins, too. About 100 years later, not only many cities in Greece had coins, but cities all over the mainland of Asia Minor also had them. On one hand, gold coins were the most valuable; on the other hand, silver and copper were also used. The Romans later adopted the idea, carrying it on for 500 years, when the art of coinage declined. In the fifteenth century, the art of coinage was revived not only because there was more metal available, but also because there were many skilled artists to engrave to coins in this period of history. The first coins made in America, in 1752, where not regular in shape. As a result, they were not the same weight. Our society, with its vast numbers of coin-operated machines, could not function without this ancient invention.

Read more ...


虚析构函数

编译器总是根据类型来调用类成员函数。但是一个派生类的指针可以安全地转化为一个基类的指针。这样删除一个基类的指针的时候,C++不管这个指针指向一个基类对象还是一个派生类的对象,调用的都是基类的析构函数而不是派生类的。如果你依赖于派生类的析构函数的代码来释放资源,而没有重载析构函数,那么此时会有资源泄漏。

所以建议的方式是将析构函数声明为虚函数。如果你使用MFC,并且以CObject或其派生类为基类,那么MFC已经为你做了这件事情;CObject的析构函数是虚函数。一个函数一旦声明为虚函数,那么不管你是否加上virtual修饰符,它在所有派生类中都成为虚函数。但是为了理解明确起见,建议的方式还是加上virtual 修饰符。

Read more ...


在Visual C++中编译工程时自动增加版本号

微软知识库中的文章How To Increment Version Information After Each Build in Visual C++(https://web.archive.org/web/20070211114127/http://support.microsoft.com/kb/237870/)提供了在VC6中自动增加版本号的方法。在VS.Net中,需要对这个宏进行少许的更改:https://web.archive.org/web/20040616201737/http://www.thecodeproject.com/macro/IncBuildNrMacro.asp

也可以使用VS.NET插件来实现该功能,一个示例在下面的网址可以找到:

Read more ...


何时一个类的指针可以强制转化为另外一个类的指针,即使它们之间没有派生关系?

问:我看到CListView的成员函数GetListCtrl直接把CListView本身的指针转换为CListCtrl指针。我想知道在什么情况下可以安全地把一个类的指针转化为另一个类的指针?

答:只要你访问的数据的内存表示是完全相同的,那么这种转化就是安全的。

Read more ...


IStream接口和CString之间的转换

问:如何传递CString中包含的字符串到具有IStream类型参数的函数?

问:如何根据获得的IStream接口指针获得字符串?

Read more ...


编程控制Modem/PPPoE拨号连接

在Windows中拨号上网(包括MODEM和PPPoe),一般都是用Windows平台提供的的Remote Access Service(RAS,远程访问服务):https://learn.microsoft.com/en-us/windows/win32/rras/about-remote-access-service 。其中的连接操作函数(https://learn.microsoft.com/en-us/windows/win32/rras/ras-connection-operations)可以用于对拨号连接进行操作。比较常用的几个函数是RasDial、RasHangUp、RasEnumConnection和RasGetConnectStatus,以及自定义的通知处理函数(https://learn.microsoft.com/en-us/windows/win32/rras/notification-handlers)。

Windows XP/2003内建了对PPPoe拨号连接的支持,参考 https://learn.microsoft.com/en-us/windows/win32/rras/point-to-point-protocol-over-ethernet-connections

Read more ...


编程实现远程唤醒PC

为了唤醒网络上的计算机,必须发出一种特殊的数据包,该数据包的格式与普通数据包不同,而且还必须使用相应的专用软件才能产生。当前普遍采用的是AMD公司制作的Magic Packedt这套软件以生成网络唤醒所需要的特殊数据包,俗称魔术包(Magic Packet)。该数据包包含有连续6个字节的“FF”和连续重复16次的MAC地址。 Magic Packet格式虽然只是AMD公司开发推广的技术,并非世界公认的标准,但是仍然受到很多网卡制造商的支持,因此 许多具有网络唤醒功能的网卡都能与之兼容。

需要更多关于Magic Packet的信息的话,可以参考 https://web.archive.org/web/20020805085929/http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2481,00.html

Read more ...


限制应用程序的实例数目

某些应用程序处理紧缺资源,例如可擦写光驱、串口或者大量内存,通常不希望这种应用程序的多个实例同时运行。

实际上你没有办法限制用户只能启动一次。你可以做到的是在应用程序启动之后查找是否用户启动了另一个实例。如果没有找到现存的实例,应用程序以正常方式启动。否则,通常的处理是退出。

Read more ...


编程控制活动桌面,用ActiveX控件来增强桌面的功能

活动桌面处理和一个例子 (https://web.archive.org/web/20010503055645/http://www.vckbase.com/vckbase/vckbase10/vc/nonctrls/atlcomocx_02/1002001.htm)讲述了使用IActiveDesktop接口可以做到的事情。

活动桌面允许在桌面上显示HTML网页,这也意味着我们可以在桌面上的项目中以在网页中使用ActiveX控件来对网页进行扩展的方式来提供丰富的内容。但是不建议在桌面上使用不安全的控件,例如Windows Media Player 6.0。

Read more ...


Self Introduction

This is JIANG, Sheng writing. You can call me Jason also. I am a Chinese, normal height and weight. I am staying in Austin, Texas now.

After graduated from Jilin University, I worked in a software company as software developer in Beijing for several years. I developed several education applications during my years in Beijing. After that, I moved to Texas and now studying.

Read more ...


A Successful Moment

I am so proud that I was awarded Microsoft MVP (Most Valuable Professional) last year. I was so excited I was sleepless for days. I got an invitation of Global MVP Summit, where I recognized several MVPs and experts in Microsoft and have myself recognized by them. It was the highest horner I had ever been awarded.

I was so inspired that I contributed more in the last year. I am re-awarded this year.

Read more ...