Posts by Sheng Jiang

Common mistakes in Unciv Modding

Unciv is an open source clone of Civilization V. I have been playing it for a while and decided to try modding it. The modding process is quite straightforward. The modding is done by creating json files. You can find the built-in ruleset at yairm210/Unciv and start from there. Once you have a mod, you can download it in the mod section in game by providing the downloading address. The game also has a mod list that is based on github repos. On a Windows machine, you can find mods in the mods subfolder of the game and inspect the folder structure of mods and how they are json files work. You can add new nations, beliefs, units or buildings by copying the existing by copying the existing ones and rename them. But from what I see, a lot of modders make mistakes due to misunderstanding of the unique system and their code didn’t work.

The most common mistake is to assume building exist but they don’t in a different ruleset. For example, some mods has this:

Read more ...


Unable to get running user’s MyDocuments folder due to security interference

I was trying to retrieve the running user’s MyDocuments folder in a WinForms application via

To my surprise, it returned an empty string.

Read more ...


Counting and Deleting Emails by Sender In Outlook

You can download the code and binary at jiangsheng/OutlookSenderStatistics .

My Google Drive is getting full. While I am cleaning up large attachments in Gmail, I notice the storage usage did not decrease but actually increased. I am getting more emails everyday. So I decided to write a program to see who’s sending me the most email and delete some old mails.

Read more ...


Windows 11: install failed, windows 10: Windows could not prepare the computer to boot into the next phase of installation

When I was trying to install Windows 11 on my spare computer that used to run out-of-support Windows 10. After backing up data and deleting all partitions on the disk in Windows RE, I encountered an error message that read “Windows 11 install failed.” It doesn’t give much information about what went wrong.

I then tried again with another install media created by Rufus to check if the issue was with the installation media. However, the problem persisted.

Read more ...


Unwanted Horizontal scrollbar from Javascript DataTable

I am using the Javascript DataTable component to provide a sortable HTML table experience in Front Mission and 4th Super Robot Wars gaming guides. However there was a long standing issue that the table shows horizontal scrollbar even when the content is not too wide.

I have tried a few solutions I found online, including setting scrollX to false, adding table-layout:fixed; width: 98% !important to the dataTables_no_scroll_x css class and apply it to the table, and adding overflow-x:hidden !important; overflow-y:auto !important;to the dataTables_scrollBody css class, to no avail.

Read more ...


Do and Do Not in C Programming

This post is originally written in 2012. It was lost when moving my web site from Office Live to Windows Live Spaces. I found a dead link to my web site and found an archive from archive.org. So here it is the old article.

Don’t

Read more ...


Misleading Error Message from ablog.post, Aggressive Looking Ahead

Today I am getting some strange error when I am trying to convert my blogs to the ablog extension of Sphinx. The error log has the following lines

Extension error (ablog.post)!

Read more ...


Sphinx project always rebuild after installing the ablog extension

After checking the source code of the PyData theme, it is apparent that the theme’s __init__.py force the setting to be on. If not on, then it sets the config and forces a full rebuild.

The solution is setting

Read more ...


Merge wordpress.com site with GitHub Pages

As I am a tech person familiar with HTML/CSS/Javascript, the WordPress.Com free plan’s limitations has been an obstacle to my creatively (e.g. add sortable tables). I have a Github Pages web site running for a few years now and I think now is the time to migrate to github pages.

I first looked migration tutorials on the internet. For me the Exporter Plugin (https://blog.netnerds.net/2020/08/migrating-my-wordpress-sites-to-github-pages/) is not an option, as one of the WordPress.Com free plan’s limitations is plugin support. Exporting the content looks like the only way to go, but how to import the exported WordPress XML to formats supported by Github Pages is another problem.

Read more ...


ExtensionError: Could not import extension sphinx.builders.latex

Today I got this error when building my blog based on Sphinx after upgrading Sphinx to the latest version.

when I do a pip list, the 4.1 version of roman_numerals is indeed installed. Just the build script cannot find it. It probably has something to do with the fact that roman-numerals-py (deprecated) is also installed. Older version of sphinx that requires roman-numerals-py instead of roman_numerals.

Read more ...


ABlog Exception Missing title from Invisible Character

Today I got this error when building my blog based on Sphinx/ABlog extension.

When I remove the ABlog post directive, Sphinx indeed gives a warning about the file’s title:

Read more ...


Another Aggressive Looking Ahead and Misleading Error Message from ablog.post

Today I am getting some strange error when I am trying to convert my blogs to the ablog extension of Sphinx. The error log has the following lines

Extension error (ablog.post)!

Read more ...


Misleading Error Message WARNING: All children of a ‘grid-row’ should be ‘grid-item’ [design.grid]

Today I am hit by a message “WARNING: All children of a ‘grid-row’ should be ‘grid-item’ [design.grid] “ from the sphinx-design extension when building a Sphinx documentation. The error line points to a grid that works perfect fine in another file.

After some digging, it appears that when the next paragraph is indented as quoted text, no matter how many blanks are in between the grid still think it as its children.

Read more ...


Misleading Error Message WARNING: All children of a ‘grid-row’ should be ‘grid-item’ [design.grid]

Today I am hit by a message “WARNING: All children of a ‘grid-row’ should be ‘grid-item’” from the sphinx-design extension when building a Sphinx documentation. The error line points to a grid whose only members are grid items.

After some digging, it appears that when a space is missing between .. grid-item-card:: and the card name, then the card won’t be recognized as a card, and generates this message.

Read more ...


Today’s phishing email RE: Your App឵Ie lD Has Been DisabIed Pending Further Verification

My mom received this email and asked me verification. It is obvious fake, but the red flags are worth noting.

The only help from the email provider is marking the email as sent by mail.txu.com. Which is still spoofed, but nevertheless makes the email suspicious, as the email pretends to be from Apple. There is also a clue in the email itself, the terms of service URL in the email somehow points to Netflix, probably to filter out people too smart to attack.

Read more ...


Troubleshooting SGEN : error : An attempt was made to load an assembly with an incorrect format

I have a POCO entity project that must generate XML Serializers due to a memory leak bug. Xml serializer generated dynamic assemblies are not ever collected.

Turning on verbose mode in MSBuild options tells the problem.

Read more ...


Querying Wikipedia data using SPARQL

Recently I have been working on a trainer for a football manager game. The game has a player database, when a player retires, another with the same last name would respawn in some other club. When you play the game for many seasons, the player database becomes gradually out of date. Fan patches are created but due to the amount of work involved (check the team roster for every minor team in every league, for starters) only a few patches are ever created. My goal is to get some actual real players to replace the respawned ones and refresh as time elapses.

I first tried to extract data from a recent football manager game. However, it has some issues that made me rule out of using a database from another game. First, different games have different way to rate players.  Some attributes in another game can be mapped to the game I am working on, but for other attributes, I need to come up with values for thousands of players, most of them I have never heard of. Yikes. Second, the game would only list current playing players. Thus I might miss players retired early,

Read more ...


Today’s phishing email (Subject Re: Contract Lease Agreement)

The email body is as the following

<your email id>  has recieved a file to your onedrive “2023 Contract Agreement .xlsx

Read more ...


Extend a webbrowser control using ICustomQueryInterface

This article is written with the help of ChatGPT. I want to see how far ChatGPT can go solve this and if any correction needs to be made. ChatGPT went pretty far but still made some mistakes.

To extend a WebBrowser control using ICustomQueryInterface, you can create a new class that implements the ICustomQueryInterface interface and then use the SetSite method of the WebBrowser control to set the new class as the site for the control. Here are the steps you can follow:

Read more ...


Bypassing Factory Reset Protection Microsoft Lumia 640

The problem:

Recently I had to factory reset my Lumia 640 with Windows 10 Build 15063. However the factory reset protection cannot be turned off in settings. It will ask for password then the slider would stay on.

Read more ...


New web server hijacker HttpResetModule.dll

Today a friend’s server was hacked. The web site displays normally if visited directly. The content is highjacked when visit from a Baidu Search result, similar to what user 41nbow experienced at https://www.freebuf.com/articles/web/222060.html.

A file system wide search for recent changed files shows that %windir%\system32\inetsrv\config\applicationHost.config file was recently updated. New entries were added to the end of the <globalModules> section. Despite their location being C:\Windows\Microsoft.NET\Framework\v2.0.50727 and C:\Windows\Microsoft.NET\Framework64\v2.0.50727, they bear no Microsoft signature nor any other version information. Also, the file name HttpResetModule is suspicious, why a web server want do reset a connection?

Read more ...


Better Late Than Never

This post originally appeared on Joycode on Sept 17 2004.

在文件选择对话框和浏览器中都可以显示文件夹视图,但是有时需要对显示的方式进行控制,例如在文件选择对话框初始化时设置显示方式为详细资料视图或者缩略图视图,有的时候需要用程序来选择一些项目,例如在文件选择对话框中添加全选按钮,或者打开文件所在文件夹并且选中指定文件。

Read more ...


Converting generic OopFactory.X12 structures to typed counterparts

OopFactory.X12 can parse EDI messages into segments and loops. However despite typed segments and loops exist, the parser does not generate them in the object model. The unit test only use them when generating EDI messages.

The typed segments and loops are aggregative objects that do not contain their own data members besides the contained untyped objects. Which means if I replace the contained object with the generic one from the parser via .Net reflection, then I can access the object model in a typed way. So I created this in a static class

Read more ...


How To Determine When a Page Is Done Printing in WebBrowser Control

Note this post is originally written in 2012. It was lost when moving my web site from Windows Live Spaces to WordPress. I found a dead link to my web site on Stackoverflow and found an archive from archive.org. So here it is the old article, with dead link updated of course.

The printing from a WebBrowser control can be customized by using custom headers and footers (https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/267240, archived from http://support.microsoft.com/kb/267240) or replacing the default print template. However, using such techniques conflicts with the PRINT_WAITFORCOMPLETION flag, which is used for synchronous printing.

Read more ...


Troubleshooting a memory leak

Got called into a memory leak troubleshooting.

The application was leaking memory at 1mb per second. In memory profiler, most of the growing memory are used by byte[] and RuntimeMethodHandle (growing at around a million per minute). Initially I thought it is a disposing problem, but the memory occupied by disposable objects does not increase over time.

Read more ...


Icepocalypse 2021 冰狱 2021

this is my dairy about the winter storm occurred in Feb 2021.

这是我2021年二月冬季风暴的日记

Read more ...


微软拼音卡顿的问题

微软拼音最近每次激活的时候都要卡上个几分钟。而且不是一个程序只卡一次,中英文切换之后还会继续卡。

用了Process Monitor跟踪了一下,发现每次切换中英文的时候,微软拼音都会在%appdata%MicrosoftInputMethodChs下面创建一个名字为UDPXXXX(这里XXXX是16进制数字).tmp的文件,我这个目录下有六万五千多个这样的文件。从命名风格来看,很明显是在调用GetTempFileName,而这个函数有65535个文件的限制,不删除文件的话,第65536次调用会失败,应该是微软拼音没有处理好调用这个函数失败的情况,也没有删除临时文件的代码,就卡住了。

Read more ...


Today’s fake email of the day

Today’s fake email of the day

So you care about an article titled “Trap CtrlAltDel; Hide Application in Task List on Win2000/XP” in 2020 and downloaded its source code, but still don’t know my name?

Read more ...


Finding the right ruby version

I am installing eHMP on Centos 7. Centos 7 has ruby 2.0 out of box, thus the install

fails with

Read more ...


Fix sphinxcontrib-googleanalytics on Sphinx 1.8

The Google Analytics extension from

does not work on Sphinx 1.8. When I run it, I get the following error

Read more ...


Blinking wifi icon and black screen on Surface 2

This is the second time I run into this problem after a Windows Update. First time was halfway through last year’s Microsoft MVP Summit and I had to Remote Desktop to my home machine with a spare android tablet and Bluetooth keyboard/mouse to get access to Windows apps.

Good that the summit wifi was amazing but a Surface 2 with touch cover was way easier to carry around than the combination of tablet/keyboard/mouse. I got around the problem by manually uninstalling  KB3033055 with dism remove package in recovery console command prompt and hide the update afterwards. But recently I got the black screen with blinking wifi icon, again after installing a bunch of Windows Updates.

Read more ...


如何在64位win10的VS2017环境下搭建汇编环境

用户AcmeContracted安装masm32失败,所以想知道是否能集成masm64到Visual Studio 2017中

VS里面masm不是单独的,是C++工具集的一部分,而在VS2017里C++工具集不是默认安装的,所以要先安装C++工具集。

Read more ...


Can we run 32 bit and 64 bit code in the same process?

User redstone001 wants to know if it is possible to run 32 bit and 64 bit code in the same process – maybe in a different thread?

As Betteridge’s law of headlines say, any news ending with a question mark can be answered with the word no. But this isn’t news, so … the answer is … yeah? Kind of.

Read more ...


Farewell, dsoframer

I know, it is long overdue. Microsoft discontinued it a decade ago. And Office is not meant to be embedded. I even advised people to not use it in new development almost a decade ago. Then why I keep using it for so long?

Because customers don’t want changes. I work in the medical field, where some of the clients still use telnet to interface with their medical software that are probably older than I am. Once you get people hooked to a UI it is hard to change that. The fact that Microsoft discontinues dsoframer means nothing to them – once I use it, I own it. It is like Microsoft having to release an Office update for the old equation editor made by MathType 16 years ago. So I have been doing patchwork as much as I can to keep dsoframer alive.

Read more ...


Getting around “Strong name signature not valid for assembly” for a ClickOnce application

When building a ClickOnce application, I need to redistribute a third party dll. But it failed the strong name validation under sn-vf thus ClickOnce launcher failed with the same error.

Microsoft (R) .Net Framework Strong Name Utility Version 4.0.30319.0 Copyright (c) Microsoft Corporation. All rights reserved.

Read more ...


What part of Windows is written in .Net/WPF/Silverlight?

user 曹一聪 on zhihu is curious how widely .Net is used within Windows components. Obviously an operating system component cannot depend on something that isn’t in the operating system, so nothing uses Silverlight in the desktop version of Windows. And because XP editions mostly did not ship with any .Net Framework version, practically nothing from the XP days can use .Net. Only components newer than XP or rewrote after XP can use .Net, except those Windows Media Center and Tablet PC components that have .Net dependencies.

The first time .Net is available in almost all editions is Windows Vista/2008 (the server core editions make .Net optional). ecause a Vista Capable sticker does not guarantee a machine with user-acceptable speed, not much in Windows Vista is using .Net. OR Windows 7 on that matter if you skip Windows Powershell. The usage of .Net is more in the consumer software (e.g. Windows Live Essentials), developer tools (e.g. Visual Studio) and business tools (e.g. SQL Server). In short, .Net is for writing apps, not really for the OS itself. After Windows 8, Microsoft’s focus moved to Windows RT, now UWP, not much effort is done to improve the desktop, so practically nothing in the desktop got rewritten in .Net Framework.  Windows Help 2.0 is a notable exception however. Because more and more desktop components are moving to UWP (control panel, calculator, games etc), Windows 8 might be the peak of .Net Framework usage in Windows.

Read more ...


Flash Player: Loading from memory

user cucao wants to know how to play a flash file from application resource. The user wants to use a dongle to protect unauthorized viewing of the flash file so can’t just put the swf file in plain sight.

Adobe’s Flash Player, being an ActiveX with supports for many OLE containers such as Internet Explorer and Microsoft Word, implements many standard OLE interfaces (for details open the ActiveX in oleview). One of them is IPersistStreamInit, a standard interface for ActiveX controls who want to distinguish new page load vs refresh, but can be used for the user to load the swf file from memory.

Read more ...


What’s new in Visual Studio Tools for Windows 10 Preview

Looks like Windows 10 SDK gets renamed.

This post focuses on the Win32 wide of changes. Changes in the [STRIKEOUT:WinRT] Universal App Platform (UAP) side can be found at https://dev.windows.com/en-us/whats-new-windows-10-dev-preview. Some UAP APIs are available to all desktop apps, for exam DirectX 12 and notification center (should not come as surprise, older version of these APIs are already callable from Win32 apps ). Project Centennial also supports enabling UAP APIs to desktop apps, provided they meet certain requirements and deploy using the new appx model.

Read more ...


Book review: Mastering Windows 8 C++ App Development

Disclaimer: I am a Microsoft MVP in Visual C++, so is Pavel Yosifovich, the author of the book.

Mastering Windows 8 C++ App Development by Pavel Yosifovich is a new addition to the Windows Store development books. It took me a while to read (304 pages) but is well worth the time from the perspective of a C++ developer. The book obviously went through great lengths to be comprehensive, not only introduced the typical Windows Runtime (WinRT) APIs in a crisp manner but also added a refreshment of C++ 11, the Model View ViewModel (MVVM) pattern, and the Windows Runtime C++ Template Library (WRL). In addition, being a book for C++ developers, the author’s emphasis on performance can be found in several tips and discussions, which is a nice focus for C++ developers. There are also several weaknesses in the book. Introducing WRL before C++/CX may be a poor choice as it is difficult to inspire the reader with laborious code. Also the book could use a few more details on DirectX and some WinRT APIs such as GeoPosition. Nevertheless, the book is an excellent text for the subject and I recommend the book to C++ programmers who want to start developing Windows Store apps and can do research outside of the book.

Read more ...


Another breaking change related to 64 bit compatibility, this time in TAPISRV w/Windows 8

The ADO team had to make a breaking change the ADO APIs due to compatibility problem with Microsoft Office. Now it seems to be Tapi’s turn.

In the 64 bit editions of Windows 8 and Windows Server 2012, some TAPI providers would stop getting incoming calls due to implementation changes in the TAPI service (TAPISRV) that had to be done for 64 bit compatibility.

Read more ...


Howto: Ignoring web browser certificate errors in a webbrowser host

Download Example Code: jiangsheng/Samples.

Many applications host webbrowser controls to display web pages inside. Before production the web page is often in an internal server that do not have a valid certificate. This article let you skip the certificate error and continue testing your application

Read more ...


When you get a System.BadImageFormatException. maybe you indeed have a bad system image.

I am getting a StackOverflowException with two functions repeating on the call stack, one is the constructor of System.BadImageFormatException, another is System.Environment.GetResourceStringLocal.

Since the call that throws the stack overflow is to a web service proxy defined in the same project as the application, there isn’t a 32bit/64bit mismatch here (32bit machine with every project targeting x86), unlike almost all other discussions on the internet about this exception.

Read more ...


How to restart Windows Explorer programmatically using Restart manager

You can download source code of this post at jiangsheng/Samples

For shell extension programmers, restart Windows Explorer is one of steps in their setup programs. A programmer may also want to force some shell setting changes that would only be read by Explorer on start up. For example, this posts is inspired by a programmer who want to toggle task bar layout automatically depending on the screen resolution, and is used to demonstrate the new Windows Vista restart manager API like RmStartSession, RmRegisterResources, RmGetList, RmShutdown, RmRestart and RmEndSession.

Read more ...


How to: Migrating a CLR console Visual C++ project to Windows Forms

Note: Windows Forms programming in new development is discouraged by Microsoft at this point as Microsoft wants to make full use of hardware accelerated drawing instead of using the CPU-intensive GDI. But maintaining old Windows Forms code in Visual C++ 2012 is still supported, GDI isn’t going anywhere anytime soon.

Visual C++ 2012 removed the Windows Forms project template and I see people scramble to find ways to create a Windows Forms project.  There is a walkaround that’s been around for years, that is, to convert a CLR console application to a Windows one, then add forms related code to the project.

Read more ...


Add the correct interface first in Adding an MFC Class from an ActiveX Control wizard.

In good old times aka VC6, if you want to use an ActiveX in MFC, the Components and Controls Gallery would generate all the properties and methods of an ActiveX and pull dependent types and create wrapper classes for them as well. And it was good. It magically knows the main class of the Windows Media Player ActiveX is CWMPPlayer4 and that GetCurrentMedia method returns CWMPMedia.

Welcome to the modern Visual C++. Now comes a new wizard that gives you options to choose interfaces to import from. At the same time you got to decide if you really need that many types from an ActiveX. If you went the unfortunate path of Adding a Member Variable wizard in the dialog editor and somehow got a COCX1 class back, you don’t have the luxury to choose, and you end up with an CWnd wrapper class that does not really wrap up the properties and methods of the ActiveX. It is still good for early binding (like querying IWMPPlayer4 from the result of CWnd::GetControlUnknown) but if you plan to use late binding and MFC’s OLE support (hello COleException!),  you probably want to delete the COCX1 files and start over with the Adding a Class from an ActiveX Control wizard.

Read more ...


Howto: reset IE security zone settings programmatically

Internet Explorer 7 introduced the IInternetZoneManagerEx2 interface, which has a FixUnsecureSettings method to reset all security zone settings. Like all other IInternetZoneManager* interfaces, you can query this interface from the internet zone manager object:

There’s another CoInternetCreateZoneManager function to get the zone manager object’s IInternetZoneManager interface.

Read more ...


What’s new in MFC/ATL 11 Beta

Note this post is on Visual Studio 11 Beta, you can download it from http://www.microsoft.com/visualstudio/11/en-us/downloads Since Sinofsky posted about no desktop apps on Windows on ARM (WOA), it looks like MFC and ATL are going to support metro-style apps, although most ATL classes are not going to be compatible with metro style apps.

DAO support for ARM is missing, just like the lack of DAO support for 64 bit apps. Jet was deprecated a while ago, no surprise here.

Read more ...


What is the Windows API for

There are the questions programmers ask frequently. This faq does not contain sample code, readers should use keywords (showing in bold, such as function names, CLSIDs or interface names) to find complete solutions elsewhere.

Q: What is the Windows API for the Start Menu?

Read more ...


Choosing formats when putting data on clipboard

The topic is from a forum discussion at https://web.archive.org/web/20131020094354/http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/94bb2db4-3ca2-4cd8-9f7c-6dd9aab6fd18/need-help-to-complete-gdi-program-to-loadsave-to-clipboard?forum=windowssdk

Generally an application should provide data in as many formats as possible so more applications can recognize the data. For example, IE stores text data in CF_UNICODETEXT, CF_TEXT and CF_HTML formats.

Read more ...


What’s new in Windows 8 Developer Preview SDK headers

This is by no means a complete list but just some observation on files that caught my eye. Some are just regular header file updates for Windows 7 and does not necessary require Windows 8. Some other APIs moved to header files with more readable names.

Improvements are focused, of course, in natural input, efficiency, gaming experience and IE. You can hear the silence scream of “Tablet!Tablet!Tablet!” here. Note Windows 8 is still a developer preview and there is no guarantee any new feature will survive the final cut or there won’t be new API for existing features add in Beta/RC/Gold.

Read more ...


Where is the forum for Internet Explorer?

People get confused by various Microsoft IE forum sites so here is the steps to find the forum closer to IE related questions Basically, the mentality of different Microsoft forum brand is: MSDN: How can my software do something on my customers’ machines. Technet: How can I manage things on machines in my network. Answers: How can I do something on my own machine. So for the case involving IE:

using IE http://answers.microsoft.com/en-us/ie/forum

Read more ...


Windows Update KB2538242 or KB2538243 offered repeatedly

Recently (this post was originally published in 2011) there is an outburst of posts related to the KB2538242 update being offered repeatedly on MSDN’s Visual C++ forums, TechNet’s various Windows security forums and the Windows Update forum on Microsoft Answers forums. Questions about KB2538243 appear as well, but to a less degree.

To save your time going to the forums or calling Microsoft’s free security hotline, this is my answer:

Read more ...


Bug in Security Update for Visual C++ Redistributable Package: April 12, 2011 causes program error on Windows 2000

Update:Microsoft’s Visual C++ team has released workarounds on the problem. AVG has released an utility that can revert the KB2467175 update, downloadable at http://twitter.blog.avg.com/2011/04/avg-feedback-update-26411.html

Avira is reporting that its AntiVir software throws “The procedure entry point FindActCtxSectionStringW could not be located in the dynamic link library KERNEL32.dll.” error after installing the update released earlier this week.

Read more ...


How to solve LNK2001 errors related to Windows SDK CLSIDs

User IMFCoder wants to know how to solve a LNK2001 error related to CLSID_CMpeg4sDecMediaObject. The user has no problem linking a lib file in the project but couldn’t find which lib the CLSID is in.

The Windows SDK is strangely cryptic on which lib file the CLSID is exported from. Luckily you can find out the library file you need to link with, if you execute the following command line in the SDK command prompt.

Read more ...


More ADO issues with KB983246/Windows 7 SP1: a reference count leaking when event is used

Update: Microsoft fixed the issue in Windows 8.

User Angus Robertson is reporting that in an application that references ADO 2.1 type library and getting records using the adAsyncExecute method, each execute call  leaks three handles and about 20K of memory.

Read more ...


Breaking change in ADO update KB983246 (included in Windows 7 Service Pack 1)

Update2: Microsoft fixed the issue in Windows 8 in a way that old programs would work without change. Those who recompiled with the KB983246 version either need to roll out KB983246 to customer computers or switch back to the old type libraries. New programs are encouraged to use the KB983246 version of type library when they no longer need to support computers without KB983246.

Update: please refer to the knowledge base article kb2517589 An ADO application that is re-compiled on a Windows 7 Service Pack 1-based computer does not run on down-level operating systems for walkarounds

Read more ...


Microsoft MVP again

Image by EJeffson via Flickr

The award email is almost identical to last year’s, so I assume Microsoft would go greener and more renewable with the Microsoft MVP award program each year, maybe that’s the reason I got a frosted glass lug instead of a trophy like previous years.

Read more ...


What is the difference between int and System::Int32

Some may say identical, at least that’s what the Visual C++ compiler tells you at the first glance  when you turn on /oldsyntax

Okay, so if I add & to the parameter types I should get the same error right?

Read more ...


Application crash when forcing IE8 rendering mode in webbrowser host

User stephench is reporting that when setting webbrowser rendering mode to IE8 via FEATURE_BROWSER_EMULATION, the app would crash.  The web site crashes IE8 too, but IE8 is able to recover and automatically switch to IE7 mode, while a webbrowser host crash in WinInet when switching to the compatibility mode (Note the ReloadInCompatView function on the call stack). My guess is that reloading requires a WinInet helper process which a webbrowser host app does not have. The call stack is the following urlmon.dll!UUIDToWSTR() + 0x1f bytes urlmon.dll!GUIDToWSTR()  + 0x1a bytes urlmon.dll!GUIDToWSTRCch()  + 0x16 bytes urlmon.dll!CInPrivateBrowserModeFilter::_EnsureCLSID()  + 0x20 bytes urlmon.dll!CSessionBrowserModeFilter::_GetDataStream()  + 0x27 bytes urlmon.dll!CBrowserModeFilter::_EnsureBrowserModeFilter()  + 0x1d84 bytes urlmon.dll!CBrowserModeFilter::IsIE7Mode()  + 0x2e bytes mshtml.dll!CMarkup::ReloadInCompatView()  + 0xd0 bytes mshtml.dll!CCssPageLayout::CalcSizeVirtual()  + 0x120416 bytes mshtml.dll!CLayout::CalcSize()  + 0x164 bytes mshtml.dll!CLayout::DoLayout()  + 0x113 bytes mshtml.dll!CView::ExecuteLayoutTasks()  - 0x1e376 bytes mshtml.dll!CView::EnsureView()  + 0x567 bytes mshtml.dll!CView::EnsureViewCallback()  + 0x66 bytes mshtml.dll!GlobalWndOnMethodCall()  + 0xcc bytes mshtml.dll!GlobalWndProc()  + 0xae bytes user32.dll!_InternalCallWinProc@20()  + 0x28 bytes user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes user32.dll!_CallWindowProcAorW@24()  + 0x51 bytes user32.dll!_CallWindowProcA@20()  + 0x1b bytes mfc100.dll!_AfxActivationWndProc(HWND__ * hWnd=0x00150a28, unsigned int nMsg=32770, unsigned int wParam=0, long lParam=0)  Line 471 + 0x11 bytes    C++ user32.dll!_InternalCallWinProc@20()  + 0x28 bytes user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes user32.dll!_DispatchMessageA@4()  + 0xf bytes > mfc100.dll!AfxInternalPumpMessage()  Line 183    C++ mfc100.dll!CWinThread::Run()  Line 629 + 0x7 bytes    C++ mfc100.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00152348, int nCmdShow=1)  Line 47 + 0x7 bytes    C++

Read more ...


Coding Horror

In this post, there are several things programmer complain their predecessor

hundreds of forms named form1,form2, etc

Read more ...


How to force popup window to navigate in the same window in a webbrowser control

When clicking on an link that targets a new window,  the default behavior of a webbrowser control host application is to open a new window in Internet Explorer. User ben_lai wants to know how to handle the click and navigate to the same window.

There are three events that notifies a new window, NewWindow (The current documentation of this event is wong, check http://support.microsoft.com/kb/185538/EN-US/ for the parameters of the event), NewWindow2 and NewWindow3, each one has a cancel parameter to stop the new window being created, though for NewWindow2, it requires cooperation of BeforeNavigate2 to get the url of the new window. After getting the url, the navigation can be carried out in the original window by calling Navigate2. The obsolete NewWindow Event has the url right in the parameter so you can cancel the navigation and call the navigation methods of the webbrowser control with the new url.

Read more ...


Getting local FTP home directory from IIS programmatically

User xiaoc1026 wants to know how to access IIS to get the home directory of the FTP web site in Visual C++.

Before IIS6 you need to access the metadata in IIS configuration via IMSAdminBase::GetData. The hard part to find the path of the IIS setting. Before IIS 6, the metadata isn’t saved in XML. However you can search the path of a property though the admin script. You can find the path property from the IIS metadata propertiy reference documentation.

Read more ...


Visual Studio 2010: Class Wizard重返Visual C++… Control Shift X.

image

在消失4个版本之后,类向导终于重返Visual C++。新的功能:搜索现在可以部分匹配而不是从字符串开始匹配。

测试版还是存在一些问题,向导不是总能找到现存的函数,以致删除函数功能不是总有效。在打开很多文档的时候尝试打开Class Wizard会出现“value does not fall in expected range” 错误。再就是性能问题,打开的文档越多,类向导启动所需的时间就越长。

Read more ...


Intercept the download dialog in webbrowser control

User rsd102 looks already find the solution to his question when he posted the question to CSDN, except for one missing piece. The sample he found is for overriding the global download manager, and what he need is a process wide override.

It looks like rsd102 is loving research. He found more than he can understand initially. After being suggested twice with the vague IE SDK documentation he decided to post the sample code he was working on. And when the final answer was given he had problem adopting it.

Read more ...


Make the webbrowser control styled the same way as the hosting application

User wtx_sonery wants to know whether it is possible to style the webbrowser control with the rest of the application.

The answer is yes, you can implement IDocHostUIHandler’s GetHostInfo method and return DOCHOSTUIFLAG_THEME in the host flags.

Read more ...


How to change the user agent and download control flags in a webbrowser control host

User vnetvvv wants to know how to change the user agent string in a VB6 webbrowser control.

The knowledge base article PRB: WebBrowser Control Clients Share Global Settings provides the necessary code for changing the user agent of the webbrowser control when the webbrowser ask for it. But how to have the webbrowser control ask for the user agent?

Read more ...


How to disable navigation sound in webbrowser control

User kill211 does not like the click sound when he calls WebBrowser.Navigate. He wonders if there is a way to disable it without modifying HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating, which has effect on other applications.

Unfortunately, the API for disabling sound is introduced in IE7. The FEATURE_DISABLE_NAVIGATION_SOUNDS feature can be toggled using registry or the CoInternetSetFeatureEnabled API.

Read more ...


the Windows Server 2008 SP2 and Windows Vista SP2 Beta program has concluded.

Nice run uninstalling pre-release SP and installing the RTM version…

Read more ...


Talking about Windows XP APIs

Photobucket has deactivated the accounts of all free users and I have no idea what was in there now. Therefore I cannot find what this post was talking about. Probably the API for various parts of Windows.

image1 http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss` <http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss>`__` <http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss>`__image2image3

Read more ...


Walkaround for Error : An add-on for this website failed to run. When opening Visual C++’s Add Variable Wizard after IE 8 is installed

Update: it looks like a lot of people are hitting this page by mistake. If you don’t write software for a living then this page is not for you.

The program is lost, but what it does is basically copying the entries from the restricted zone to the 1000 zone (custom zone of VC++ Wizards engine). In addition it has a REG_DWORD value set to 0 for name “1207”. IE security zone settings are stored in the registry path HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones

Read more ...


415 Unsupported Media Type when WSE is NOT configured

I have a web service that runs fine on my Windows XP. However, when I deploy to the production server, the web service returns 415 Unsupported Media Type when calling.

I have seen this error when WSE is not enabled on the client. The problem is, the web service is NOT using WSE. so I did the usual, uninstall ASP.Net, reinstalling, adding asmx extension to IIS, same error.

Now I need to fire a debugger to see what’s going on. Surprisingly, Microsoft.Web.Services3.dll is loaded even when there is no trace of it in my projects. Now I probably know what’s going on. There is another web service in a different virtual directory that uses WSE.

OK, I will isolate my web service to a new application pool. Well, that does not help. In the end I have to add WSE configuration to both my web service and my Windows client.

Read more ...


Links

Today’s link spam:

New warning message in MFC9:Warning: Creating dialog from within a COleControlModule application is not a supported scenario. Comments: when people takes the time to add a warning, there must be a reason.

Read more ...


Microsoft MVP, MSDN Forum Influencer

今年微软最有价值专家的奖品好重,是一个很大的水晶奖杯

20090129234731

后面那个红红的忘记是去年的最有价值专家还是最有影响力开发者的奖杯了,前后脚到的。微软中国也比较浪费,不同项目的奖品也不一起邮寄。

刚刚又收到英文MSDN论坛的通知说我是MSDN Forum Influencer,奖励一个背包,我的2004年MVP奖的那个背包要挂了,正好能用上。

Read more ...


Visual C++ 10 和 MFC 10的新特性

Boris Jabes 和Damien Watkins将会在PDC上演示Visual C++10中的新功能。IDE的新功能包括基于SQL Compact的智能提示支持自定义插件的新的项目和编译系统、面向大型应用的优化和改善的调试体验。MFC库增加了对Windows 7 中新增的多点触摸检测功能高DPI支持,以及Windows Vista中集成的功能,例如高彩图标Windows 搜索重启管理器。Visual C++程序员们才习惯不用MFC来直接调API。

MFC是很老了,不容易学,也不优雅,但是很稳定,也有很多第三方扩展和示例支持。其他的用户界面库还有很多,但是单单用户界面并不能完成一个程序。在调用操作系统的底层功能的时候,有一个面向对象的接口还是很方便的。

Read more ...


Type ‘System.Web.UI.WebControls.Parameter’ does not have a public property named ‘DbType’

In Visual C# 2005 SP1, I added an object data source to a web page that uses my business class as the select method. The method has one parameter of type Guid. The data source wizard generates code like this

<asp:Parameter DbType=”Guid” Name=”rowId” />

Read more ...


When Microsoft Office Live Meets Google Chrome

To use Microsoft Office Live, your computer must meet one of the following requirements:

Microsoft Internet Explorer 6 or 7, running on Microsoft Windows XP, Windows Server 2003 or Windows Vista. You can download Internet Explorer from the Windows Internet Explorer page.
Mozilla Firefox running on Windows XP, Windows Server 2003, Windows Vista, or Mac OS X 10.2.x and later. You can download Firefox from the Firefox download page.

Read more ...


Feedback from Microsoft

image1Looks like the Microsoft Award for Customer Excellence award I got a few years ago…

Read more ...


MFC Feature Pack发布

Visual C++项目组今天发布了Visual C++ 2008 Feature Pack。这个Feature Pack包含了一些以前需要付费给BCG Soft才可以使用的控件,例如BCG著名的窗口布局和风格自定义功能,不过也有一些有用的控件,例如文件夹列表文件夹树属性窗格等等。

这个Feature Pack也包含从Dinkumware获得授权的一些对STL的扩展,实现了TR1草案。这包含新的随机算法、集合类和正则表达式支持。关于TR1的更多信息,可以参考Dinkumware的网站

Read more ...


Detect if a MSI component is installed

A C# program for those who don’t know MSI SDK or C++. C++ programmers can find the API inside the msi.h  file in Windows SDK.

Read more ...


Hard Drive Broke

The first 3 Dell support technicians tried to persuade me to clean the temp files, to remove unnecessary startup programs and to reinstall Windows. It does not help if the computer complains an error during self test. I keep saying a self test error can not be solved by twisting the OS, but they won’t listen. After educating the representatives for a week I finally got one that has better experience (and better English) to examine my computer. A full system test shows bad sectors on the hard drive, and totally toasted the hard drive. Luckily I just bought the computer for 6 months so I asked for a replacement. Dell sent me one in 2 days and I sent back the broken one.

Now my back up hard drive started to fail … Time to call Seagate.

Read more ...


Smart Hard drive error

In case anyone is googling this message

Hard Drive SELF MONITOR SYSTEM has reported that a parameter has exceed its normal operating range

Read more ...


MFC更新Beta版

一个面向Visual C++ 2008的MFC更新测试版已经发布,同时也提供了文档的下载。这个版本包含新的界面的特性,例如Office Ribbon、2003和XP风格,Visual Studio风格和MDI标签。另外,这个版本也包含部分TR1的实现,例如正则表达式、更加丰富的集合和智能指针。 另外,在下载页面居然说这个版本还不支持Visual Studio 2008 Service Pack 1的Beta版,正式版才出来几天SP1的测试版就出来了?

Read more ...


科学,我的信仰?

Read more ...


AutoComplete with DataSource

Download Sample code: jiangsheng/Samples

.Net 2.0 introduced autocompletion in TextBox and ComboBox. It is obvious that autocomplete is not very useful when the number of options is small. However, when the number of option becomes too many, pre-filling of all options to an AutoCompleteStringCollection becomes impractical, especially when the data is coming from a remote computer. An alternative is to replace the AutoCompleteCustomSource in a TextChanged event, however, users are getting random AccessViolationException when trying to replace it. In this article I will demonstrate another alternative, using a BindingSource as the data source of options, bypassing the .Net Framework and call the underline Windows API directly.

Read more ...


Visual C++ 2008 Beta2 里面的Class Designer

image

Visual Studio 2008 Beta2中的Class Designer终于支持C++了,上面是一个MFC程序的类图,可以看到已经支持扩展MFC的宏了,可惜只能看不能重构代码。尽管Class Designer这功能相当不错,但是设计师们可能还是更习惯IBM 的Rational Rose Developer for Visual Studio和UML。我用Class Designer的C#支持的时候也就是加加注释而已,重构我更习惯用DevExpress提供的工具Refactor来做,类则用XSD.exe生成,因为Class Designer生成的属性只会扔NotImplementedException异常。

Visual C++项目组在做下一个版本的市场调查,有兴趣的可以去提提要求。

Read more ...


Handle NewWindow3 and ShowModalDialog in CHtmlView

CHTMLView does not support NewWindow3 as of MFC 9.0. It is relatively easy to add this support, given the event sink code in atlmfcsrcviewhtml.cpp

Add the following into the declaration of the derived CHtmlView class (named CHtmlViewTestView in this example)

Read more ...


Skew detection and correction resources

http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm a nice introduction of the Hough Transform

http://www.leptonica.com/papers/docskew.pdf A paper discussing different skew detection methods

Read more ...


STL/CLR, Compiler and Marshaling

MSDN第9频道又采访了Visual C++类库组的项目经理Nikola DudarSarita Bafna,以及质量控制组的Marina Polishchuk尽管Visual C++项目组已经转移了工作重点,但是很少人注意到这一点。或许这些采访可以帮助你了解Visual C++项目组的工作。 为什么C++仍旧重要?

  • 非托管的应用程序有很大的代码积累,而这些程序的升级工作仍旧在进行

  • 性能是选择C++的重要因素。举例来说,游戏和杀毒程序更适合用非托管代码来编写。

  • 多平台支持。虽然.Net号称是跨平台的,但是如果要编写真正的跨平台程序,开发的时候遵循C++标准还是很有必要的。

为什么C++程序员仍旧重要?

  • C++程序员理解整个机器的运作,他们知道怎么写垃圾收集机制,甚至可以写机器代码

  • C++程序员可以很容易的学会其他语言——C++已经是最难学的语言之一了

  • C++程序员并不只使用一种语言。如果有必要的话,他们会选择汇编、C#或者Perl这样更适合特定任务的语言。

为什么Visual C++项目组转移了工作重点?

  • C++程序员对于转到C#没有抵触心理,所以Visual C++项目组不认为有必要尽快实现Visual C#支持的所有特性,比如LINQ和WPF设计器

  • C++程序员对于让他们的非托管程序调用其他语言的托管代码比用C++来写托管代码更有兴趣

  • 核心模块,例如IE和Windows外壳会更加频繁地更新,而会有更多的非托管代码需要调用这些新的特性,为了这些特性,有必要在MFC中引入新的封装类来节省C++程序员的时间

Orcas中Visual C++的新特性:

  • 托管代码互操作库。可扩展的托管数据类型和非托管数据类型的转换支持

  • STL/CLR。使得托管代码可以利用旧的STL编写的算法

  • Vista支持。对Vista中新的通用控件和文件对话框等界面元素的MFC封装。

  • DevExpess重构引擎——将包含DevExpess的Refactor!™ for C++

Orcas之后的考虑

  • 更新界面。有些Visual C++的代码是针对20年之前的硬件环境设计的,已经不适合现在的需要。新的Phoenix编译引擎使得重写前台变得更加容易。

  • 太多现有的代码需要重构。新的Phoenix编译引擎使得代码分析变得更加容易。

  • C++标准。新的C++标准TR1可能会在Orcas下一版本开发时成为正式标准。

  • 多核支持。需要编写可以充分利用多CPU的代码。第一个尝试是LINQ。

结论

  • MFC和非托管代码回来了

  • 性能和多平台支持的重要性越来越低,托管代码仍旧具有很大的市场。

Visual C++项目组的其他动作

  • ATL Server发布到了源代码共享站点CodePlex。这包含CAtlRegExp,在.Net和第三方类库(boost,TR1)的竞争下已经不再有必要维护一个单独的条件表达式标准了

Read more ...


McDonald’s, Yum! Alleged To Break Chinese Wage Laws

Source

McDonald’s and Yum! Brands, the owner of KFC and Pizza Hut were the targets of an undercover investigation made by New Express Daily reporters.

Read more ...


Memory Leak in the Internet Explorer WebBrowser Control

For automated applications such as parsers, the WebBrowser control may not be appropriate. Under IE4 there were several memory leak problems manifested when the control was repeatedly instantiated and destroyed and also, on occasions, when the control was merely navigated from page to page. Almost all of these problems were fixed and incorporated in the IE5 release. However new memory leaks were introduced in the script engine, the URL navigation history, and the security system. There is no word at this time on when these problems will be fixed. Unfortunately, some leaks ( the travel log that enable you to go back, for example) have been declared to be “by design” by the development team. For those applications where this is not possible it may be necessary for the customer to use a WebBrowser control from a non-Microsoft vendor that is designed for the type of long term continuous real-time activity that your are developing for.

If you need a similar interface, try the Mozilla ActiveX Control (I know little about it, so I am not sure it leaks memory or not) at https://web.archive.org/web/20010920144243/http://www.iol.ie/~locka/mozilla/control.htm. Apparently, you need to have Mozilla installed to use this Activex control. A hosting sample can be found at https://web.archive.org/web/20030422065641/www.codeproject.com/useritems/iemozilla.asp .

Read more ...


MIcrosoft MVP again

祝贺您!我们非常高兴向您授予 2007 Microsoft® MVP 大奖!

您为世界各地的社区做出了巨大贡献,我们通过 Microsoft MVP 大奖对您表示感谢、敬意和鼓励。作为 Microsoft“最有价值专家”(Most Valuable Professional) 奖的得主,您成为全球技术社区领导者精英群体中的一员,该群体与用户和 Microsoft 积极分享实际工作的专业技能,促进了知识的自由、客观交流。Microsoft 向所有不断努力促进社区发展、提升人们生活质量和促进行业成功的 MVP 们表示崇高的敬意。要了解有关 MVP 计划的更多信息,请访问:www.microsoft.com/mvp。 非常感谢您在过去一年中为 Visual Developer - Visual C++ 技术社区所做的杰出贡献。

Read more ...


Visual Studio 2005 Untrusted by IE7

Today I upgraded one of my development machine to IE7. Everything looks fine, except I have to change the FileDownload event handler to make my code compile.

However, suddenly I found Visual Studio 2005 is complaining:

image1

Conclusion:

  • Visual Studio is based on WebBrowser control (Is this news story?)

  • Upgrade to IE7 may break some applications (Again, is this a news story?)

Everything else works fine so far…

Read more ...


Error: Unable to cast COM object of type ‘mshtml.HTMLDocumentClass’ to interface type ‘ICustomDoc’

This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{3050F3F0-98B5-11CF-BB82-00AA00BDCE0B}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

My first reaction was:”What the hell? HTMLDocumentClass is the managed wrapper of MSHTML, and MSHTML is supposed to support the ICustomDoc interface!” Now I started wondering why the interfaces don’t work I created a sandbox project and tried to cast interface there, but it works smoothly. I played with strong name and found no luck. Finally, I found out that it is the frame document that does not support this interface.

Read more ...


CSDN statistics

基本信息:

UserID:7298

Read more ...


‘The Microsoft Code’ by Adam Barr

===

The man smirked. “My work here is done. Thanks to your little reboot stunt, your account has already been terminated. Within 15 minutes your cardkey will cease to work. You’ll be paying full price for Office for the rest of your life!”

=== :) full story:

Read more ...


The death of Virgo Shaka under the twin Salas

Gold Saint Virgo Shaka, after a suicidal battle against three fallen Gold Saints, Capricornus Shura, Aquarius Camus and Gemini Saga when defending Athena.

花が咲き そして散る 花开,然后花落

Flowers open out and then they fade

星が輝き やがていつかは消える

星光闪耀,不知何时熄灭

Stars shine and later or sooner they go off

この地球も 太陽も 銀河系 大いなる宇宙も いつか死するときがくる

这个地球,太阳,银河系,甚至整个宇宙也总会有消失的时候

Both this Earth, the Sun, the Milky Way, and even for the big Universe which is growing,

later or sooner the time to die will come

人間の一生などそれらに比べれば瞬きほどの僅かなものであろう

And compared to these things, human life is insignificant.

人的生命和那些相比只不过是一瞬间吧

その僅かなひとときに 人は生まれ

在那一瞬间中,人诞生

In that little moment, a man is born

笑い 涙し 戦い 傷つき 喜び 悲しみ 誰かを憎み 誰かを愛し

微笑,哭泣,战斗,伤害,喜悦,悲伤,憎恨谁,喜欢谁

Laughs, cries, fights, is injured, feels joy and feels sadness, loves someone, hates someone

全ては刹那の邂逅

所有的一切都是刹那间的邂逅

Rverything is random and in a instant

そして誰しもが死という永遠の眠りに包まれる

谁都不能逃脱死亡的长眠

And, in the end, covered by an eternal sleep called Death.

Read more ...


Baidu Baike, the Chinese repalcement of Wikipedia

Wikipedia has been blocked in mainland China for more than six months. Unlike former blocks, this one seems to be permanent. Like the blocking of Google in 2002, it produced a vacuum that local businesses are eager to fill, especially Baidu.

Immediate after the blocking of Wikipedia, Wiki China launched with government support and claimed itself as the biggest Chinese wiki encyclopedia. The coincidence, together with the GFDL violation of Wiki China by copying content systematically without credit Wikipedia, provoked many Chinese Wikipedians to blankout the pages they created. Ten days after the birth of Wiki China, hackers forced its shutting down by deleting its database.

Six months later, Baidu, the Chinese search engine benefited from the 2002 blocking of Google, launched Baidu Baike (sometimes translated Baidupedia), a collaborative online encyclopedia. Again, it is praised by Chinese media for education references, but is accused of the GFDL violation. Under the lure of Baidu Credit, a large amount of online articles, including many Wikipedia articles and even nonsense articles from Uncyclopedia are copied into Baidu Baike without crediting their sources. Worse, Baidu claimed the copyright in one help page, and credited the posters in another.

Although the growth of entries is impressive (10,000 a day), due to its self censorship, politically reactionary topics such as the Tiananmen Square protests of 1989, human rights, democracy and Falun Gong are missing. Confronting the Great Firewall of China, efforts to creating these entries or even search for them resulted denial of services, like searches in other web sites.

Read more ...


PRB: ::SetUIHandler Causes Changes in Save As Dialog

For the description of this problem, see http://support.microsoft.com/kb/330441.

A workaround is delegating DHTML commands to the origional webbrowser object through its IOleCommandTarget interface. A sample can be found at http://www.codeproject.com/atl/popupblocker.asp:

Read more ...


Microsoft Award Certificates

Microsoft Most Valuable Professional Certificate

Microsoft Most Valuable Professional Certificate January 2006 Microsoft Most Valuable Professional Certificate October 2005 Microsoft Most Valuable Professional Certificate January 2005 Microsoft Most Valuable Professional Certificate January 2004

Read more ...


Jiangsheng’s CSDN Digest (200604)

I have been summarizing my CSDN posts since 2004. The last article of this kind is “Jiangsheng’s CSDN Digest(April 3, 2006)” (https://web.archive.org/web/20060701050541/http://blog.csdn.net/jiangsheng/archive/2006/04/03/648980.aspx), including following discussions:

web autocomplete using AJAX

Read more ...


From In God We Trust to In Freedom We Spam

In God We Trust is widely considered a religious phrase. Although the definition of God can be widened to other monotheistic religions, and an overwhelming majority of Americans are Christians, many still believe it violated the establish clause of the constitution, preferring monotheism over polytheism and atheism.

On a far less base, some groups are spamming Chinese in the name of human rights. Since 2000, some congressional funded groups such as VOA and Radio Free Asia  and followers of Chinese dissent movements such as Falun Gong keep sending their daily China civil right news to my email boxes. No, don’t tell me I need to set up a filter. I have been using email since 1997 and all of my email service providers have anti-spam filters, and many of those are served inside the Great Firewall. I had even set up some filters myself to filter spams with sibling recipients on the same domain. Since I had never given them my email addresses, it is only natural to assume that they obtained them from web pages or guessed them out from using common Chinese names and domains.

Read more ...


Microsoft MVP re-awarded again

亲爱的 Sheng Jiang, 热烈祝贺并欢迎您参与 Microsoft® MVP Program! 作为本年度“最有价值专家”(Most Valuable Professional) 奖的获奖者,您成为了我们精英群体中的一员,在全球网上和网下技术社区中与他人积极分享 Microsoft 的产品和技术。Microsoft 向所有用技术帮助他人发挥潜力,从而促进社区发展的 MVP 们表示崇高的敬意。要了解有关 MVP Program 的更多信息,请访问:www.microsoft.com/mvp。 非常感激您在过去的一年中在指导Visual Developer - Visual C++技术社区中的同伴方面所做的杰出贡献。

Another email:

Read more ...


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 ...


How To Detect If an Application Has Stopped Responding

简介:本文描述了如何使用C++、VB、Windows API和.Net类库判断一个进程是否停止了响应。

没有一个明确的“停止响应”的定义,例如对于Internet Explorer或者Word 2000这样的多顶层窗口应用程序,可能存在部分顶层窗口失去响应的情况,这时很难定义应用程序是否停止了响应。但是一般来说,很多应用程序只有一个标志性窗口(或者叫主窗口)。如果主窗口在一段时间内不响应用户操作的时候,对于用户来说应用程序是停止响应的(例如在Internet Explorer等待远程FTP服务器返回登录结果时)。尽管这经常属于其他应用程序应该妥善考虑的范畴,但是如果自己的应用程序依赖于这样的程序而没有源代码级控制权,那么应该提供一个机会允许用户中断对外部应用程序的等待或者干脆终止外部应用程序。

Read more ...


Good Bye MFC?

原文地址在https://web.archive.org/web/20041204071945/https://channel9.msdn.com/ShowPost.aspx?PostID=31152

起源是VC开发组的一个人的言论“MFC仅仅用于支持旧的代码,新的代码不应该用MFC编写,而是应该用C#或者Managed C++”

Read more ...


偶的CSDN收藏夹(大部分都是古董……)

无界面的HTML分析器·分析网页中的表格/ http://community.csdn.net/Expert/topicview.asp?id=351580

如何载入非标准大小的图标并显示/ http://community.csdn.net/Expert/topicview.asp?id=638695

Read more ...


98年出的VC6看来也是和Win98一样日落西山了

​ 段落小题引用了《大话西游》中的若干段落,在此声明。

谁说我斗鸡眼?我只是把视线集中在一点以改变我以往对事物的看法

Read more ...


动态屏蔽Control+Alt+Delete(Update)

我曾经编写过一篇关于动态屏蔽Control+Alt+Delete的文章。数月之后我把文章的英文修订版发在了CodeProject(https://web.archive.org/web/20081015201511/http://www.codeproject.com/system/preventclose.asp)。但是当时我并未发现代码在调试环境下崩溃的原因。在很长时间之后,我看到Antonio Feijao在他最近发表的一篇文章之中用C重写了这个代码,并且添加了一些注释说明了编译器设置可能出现的问题。我认为这篇文章对我的文章的读者也是很有用的,所以准备在我的文章中添加他的文章的链接。

文章介绍:

Read more ...


如何: 通过HTML文档对象模型访问文档中的ActiveX控件的属性

111222的CSDN文档中心文章 用 MSHTML 的一点经验(https://web.archive.org/web/20051126180205/http://dev.csdn.net/develop/article/10/10456.shtm) 说明了如何访问在HTML文档对象模型中的网页的元素、内容。但是,有时候开发者实际上需要访问的是网页中ActiveX控件的属性、方法和事件。例如,你在网页载入之后需要修改/获取MediaPlayer的媒体源,以及控制MediaPlayer的播放。

为获得ActiveX控件的接口,我们需要访问文档对象模型。获得文档接口的方法多种多样,比如CHtmlView::GetHtmlDocument,IWebBrowser2::get_Document,IHTMLWindow2::get_document等等,参见111222的文档。这里我直接用一个函数GetDHtmlDocument表示获得这个接口的函数。你可以自己实现这个函数。

Read more ...


VC/MFC Q&A 200407

问:自编浏览器进入一个网页后,点一个链接后系统自动调用用IE打开网页而不是用自身浏览器打开网页。如何让窗口用我自己的浏览器打开?

答:参考控制新的窗口。默认情况下,浏览器收到创建新窗口请求时,会在IE中打开新的窗口。你可以处理NewWindow2事件来在自己指定的窗口中打开请求的页面。

Read more ...


DLL/OCX中的MFC对话框不能处理Tab和回车键的问题

带子窗口的ActiveX控件问题,如何获取回车键?

问题:

Read more ...


别了,北京 Time To Say Goodbye

docs/blogs/2004/enable_autocomplete_forms_webbrowser_control.rst 今天把MSN昵称改成“别了,北京 Time To Say Goodbye”之后,询问的信息纷至沓来,这肯定是我的聊天工具最忙的一天,同时有人开始组织欢送计划——当然是计划掏我的腰包……。

“该走的总是要走的,一路顺风”。

Read more ...


在应用程序中集成浏览器控件(Update)(Subjet to change without notice)

浏览器控件是一个提供浏览器绝大部分功能的ActiveX控件,随Microsoft? Internet Explorer 4.0(IE)或者更高版本发行。实际上,IE可以认为是一个集成浏览器控件的程序。

怎么给用户提供丰富的内容一直是程序员们努力的目标。尽管各种各样的界面库可能使你眼花缭乱,但是这些也是美工和程序员的恶梦——要自定义界面上的每个元素的外观并不是一件容易的事情,而且有时候需要比较复杂的技术,例如自定义程序中出现的滚动条的颜色。

Read more ...


7月1日 微软新技术展望大会

很多学生、开发者和媒体出席

现在在由微软全球副总裁、前亚洲研究院院长张亚勤在主讲移动计算

Read more ...


饮鸩止渴

CSDN的社区是免费的,做点广告本来是无可厚非;但是做到一个帖子上面两个大Flash加左边一大堆图片广告,开了五个帖子就把我的K7 700HZ 512M RAM搞死机就有点过头了……要是不禁用Flash很少人能上CSDN的话,广告还有什么效果?不是每个人都有P4的(顺便说一下,开了五个页面之后浏览器进程在偶刚买的P4本本上CPU占用率也没下过95%……开一个帖子在偶的K7上面也一样……)

在这里抱怨一下,希望尽快把那两个广告换成GIF什么的,不然偶不得不写个CSDN浏览器出来在浏览的时候砍掉所有图片和控件……

Read more ...


CSDN对BLOG用户可能期待过高了

在没有普及网络礼节的情况下期待用户都会遵守礼貌是不现实的。

尽管CSDN的BLOG目前并无规则,但是不出意外,我还是看见有人发了这样一个BLOG

Read more ...


在应用程序中添加宏支持的注意事项 (Update)

用笔记本用多了,PC键盘用起来不是很习惯了。

在我的一篇文章脚本化浏览器中描述了如何在应用程序中添加宏支持。在添加支持的时候需要注意的是,宏的运行环境——VBS脚本引擎——目前只支持变体数据类型。这造成的一个结果就是当你的应用程序触发一个事件的时候,如果其参数并不都是变体数据类型,那么你编写的宏不是总会被调用。解决的方法是总是声明你的事件参数为变体数据类型。

Read more ...


跨进程访问共享内存的权限问题

问:

我在服务器上用 CreateFileMapping 创建了一段共享内存。让这个exe始终在服务器上跑。同时,别的用户在客户端用IE访问服务器,将要查询的数据通过C#制作的网页提交上来,服务器得到网页参数后,建立一个COM对象访问上一个exe的共享内存,然后将在共享内存中的查询结果返回给客户。问题是现在这个COM无法用openmapping访问exe的共享内存,提示 访问拒绝 。而我在服务器上随便建议一个工程编译成exe,文件就可访问这段共享内存!!为何在网页中就不成?COM难道要有什么权限设置.两个进程之间的权限整合方法是什么?怎么用DACL?

Read more ...


重新启动服务

最近常去的论坛挂了,看起来是IIS进程系统资源占用太多了;服务器管理员又度周末去了,不能重启IIS,郁闷。CSDN服务器的IIS可能重启过于频繁了,分论坛页面经常来不及更新,自己发的帖子出现在列表里面的时候已经沉了,还是郁闷。

微软知识库文章Q194916 Restarting Web Services and Scheduled Tasks with a Batch File(https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/194916)中描述了定时用命令行重新启动IIS的方法,有想偷懒的网管可以试试。平台SDK中包含工具的SC.exe可以对服务进行更加详细的配置。

Read more ...


对话框数据交换 (Update)

通常,简单的对话框不使用结构来存储成员数据。但是大量的简单类型的成员交换会使得代码繁琐。这时候可以使用结构来封装简单类型的数据,声明一个赋值操作符和修改DDX调用来简化数据交换代码。

例如在文档或者视图的命令处理函数中

Read more ...


对话框数据交换

Read more ...


WinForm

今天一口气看完了WinForm Quick Start(http://samples.gotdotnet.com/quickstart/winforms/)

发现.Net使一切变得简单,以前需要大量代码的docking现在只需要一句话

Read more ...


VC6 with .NET CLR & Managed C++

如何让你的VC6也可以写出mc++的程序是一个有挑战性的工作,不过看来MS对于解决这个问题似乎是手到擒来.通过下载一个名叫Microsoft Visual C++ Toolkit 2003 的软件,就可以实现这样的愿望。

访问这个了解更多:http://msdn.microsoft.com/visualc/vctoolkit2003/

Read more ...


编程删除IE历史

明天出发去西雅图参加微软全球最有价值专家年会了,暂停更新一段时间。

在你调用IUrlHistoryStg:DeleteUrl 之后, 这个URL项目仍旧会出现在IE历史纪录目录中。

Read more ...


Visual Studio 6.0 Service Pack 6

FIX: “Cannot Save File” Error Message in the Visual C++ IDE

https://web.archive.org/web/20040417095303/http://support.microsoft.com/default.aspx?kbid=822856

Read more ...


数据绑定 TreeView 的演示应用程序

一个基于WinForms的自绘示例。

https://web.archive.org/web/20020808201431/http://msdn.microsoft.com/library/en-us/dnwinforms/html/custcntrlsamp4.asp

Read more ...


关于BLOG客户端的想法

鉴于内容中使用自定义标签的RSS越来越多(比如这里的方括号和博客堂的HTML代码),BLOG内容提供者似乎应该提供一个XSL用来格式化<description>成为HTML内容,以便于BLOG客户端查看。

Read more ...


限制应用程序的实例数目

这里使用了窗口标题进行查找匹配。可以使用内核同步对象来进行准确的匹配和防止同时启动。

Read more ...


基于非模态对话框的MFC工程

Read more ...


VC编程经验总结第一版完成

该活动由bluebohe发起,CSDN网友积极参与,sgnaw (李逍遥)整理。发布之后反响强烈,但是很多人并未全部看完帖子就留下自己的邮件索取文件……其实下载地址就在第三个回复里面。

文件可以从这里下载 https://web.archive.org/web/20040405025034/http://bluebohe.go.nease.net/vc2004.chm

Read more ...


在浏览器中粘贴时替换剪贴板数据

在某些时候,可能需要覆盖剪贴板的数据,例如过滤聊天时在输入窗口粘贴非文字格式的信息。对于浏览器控件的编辑模式,浏览器提供了IDocHostUIHandler接口来支持粘贴时提供一个替代的数据源来覆盖剪贴板的数据。下面的代码描述了如何过滤除了CF_TEXT之外的剪贴板格式

Read more ...


结合ADO、ADOX和MFC的文档/视图/框架架构创建和打开Access数据库

本文描述了如何在MFC的文档/视图/框架架构中使用ADO和ADOX来创建和打开数据库。

在阅读本文之前,建议先对COM,数据库和MFC的文档/视图/框架有一个基本的了解。推荐阅读下列文章

Read more ...


列表视图自动KillTimer的问题

来自http://expert.csdn.net/expert/Topicview2.asp?id=2751134的讨论。

可以参考Knowledge Base article Q200054: PRB: OnTimer() Is Not Called Repeatedly for a List Control。基本上ListView的默认消息处理是会调用KillTimer的,所以在处理你自己的Timer消息的时候不要调用默认的处理程序。

Read more ...


GUID数组的初始化

因为GUID也是结构,所以不能用简单类型的初始化

而要用

Read more ...


Ask Mr JS

[url=http://community.csdn.net/expert/Topicview2.asp?id=2732377]xml 支持 模糊 查询吗?[/url]

可以用XPath来进行节点的选择

Read more ...


ADO和ADOX

error C2011: ‘’LockTypeEnum’’ : ‘’enum’’ type redefinition

Read more ...


自定义在RichEdit中插入对象的图标

方法基本同Knowledge Base文章Q220844 HOWTO: Insert a Bitmap Into an RTF Document Using the RichEdit Control (https://jeffpar.github.io/kbarchive/kb/220/Q220844/)

只是在最后插入之前调用一下IOleCache::SetData,用一个HGLOBAL作为参数,HGLOBAL里面的数据是一个METAFILEPICT结构,包含自己提供的图片

Read more ...


DAO拥有ADO/ADOx/JRO所没有的东西(也许从不会有!

转自 http://www.trigeminal.com/usenet/usenet025.asp?2052

微软很清楚地把ADO定位为DAO的替换……许多微软的代理认为DAO 就是DOA(Dead On Arrival(到达即死),在美国,这是一个术语,用来描写那些希望获救的人在救护车刚到达,要抢救他们时,他们就死了)。然而,在DAO中,许多核心函数功能时被支持的,而ADO/ADOx/JRO 却不被支持,而且甚至可能从未被支持,因为微软似乎正把用户推向其他方向。而Jet本身不会“死”,很清楚,它不再是一个策略平台,所以,在Jet中,似乎不只是要有足够的兴趣使工作做得更有效了。 对于全记录,这里是一个DAO有而ADO没有的所有能力表:

Read more ...


使用IE5内建的进度对话框

本来想自己写一个的,但是发现codeproject上面已经有了(https://web.archive.org/web/20000604080517/http://www.codeproject.com/miscctrl/iprogressdialog.asp)

下面是微软知识库里面的一个示例

Read more ...


CDHtmlDialog&NewWindow2

Class ID Default Interface Default Event Interface —————– —————– ———————– CLSID_WebBrowser IWebBrowser2 DWebBrowserEvents2 CLSID_WebBrowser_V1 IWebBrowser DWebBrowserEvets

CDHtmlDialog捕获了DWebBrowserEvets事件,并将其转发到虚函数,而没有捕获DWebBrowserEvents2;所以在按Ctrl+N触发DWebBrowserEvents2事件的时候,执行默认操作——打开新的IE窗口。这可能不是你预料之中的行为。

Read more ...


让msxml4导出的文本xml缩进和换行

[url=http://expert.csdn.net/expert/Topicview2.asp?id=2637982]讨论链接[/url] 问起过好多次的问题了,手头正好在做XML的生成,就写了一下 其实,缩进和换行就是文本,在需要的位置创建文本节点就可以了。另外一个方法就是用SAX来写

可以这么写出来

Read more ...


Serialziing IPicture by Memory Stream

尽管很久没有用Serialize了,但是接手的工程的数据接口就是CArchive,……所以不得不写了一个IPicture数据到CArchive的接口

一个下午增加了一个功能……

Read more ...


Ask Mr JS

Q

我想在控件上绘图,现在已能取得该控件的长与宽,但取不了它在对话杠中的位置(X,Y),请问该如何取?谢谢。

Read more ...


在浏览器控件中启用自动完成功能

自动完成功能在浏览器控件中默认是禁用的(但是没有任何文档提到这一点……),但是可以通过实现IDocHostUIHandler,在GetHostInfo方法中在填充DOCHOSTUIINFO结构的dwFlags成员时设置DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE标识位来启用。

关于如何实现IDocHostUIHandler,可以参考 https://web.archive.org/web/20030218020128/http://msdn.microsoft.com/workshop/browser/hosting/wbcustomization.asp ,示例工程在https://github.com/jiangsheng/Samples/tree/master/IEAutomation

Read more ...


分析MFC中的映射

MFC中大量使用了BEGIN_XXX_MAP这样的宏,以及映射进行查找优化,例如消息映射,OLE命令映射,以及接口等等。每个映射包含一个指向基类的映射的指针。这样,当一个类需要根据一定的条件查找一个对象时,它会查找本类对象,如果没有找到,那么会查找基类,直到根基类。这类查找包含Windows消息,命令,事件和OLE命令的分发,和对象实现的接口的查询等等。

下面是函数BOOL CWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)的部分代码,演示了如何根据消息的ID查找处理函数。

Read more ...


Ask Mr JS

[url=http://expert.csdn.net/expert/Topicview2.asp?id=2562836] 如何访问 WebBrowser 控件中的XML源码[/url]

总结:注意使用IHtmlDocument::get_Script(唯一的一个方法@_@bb)就可以获得脚本的顶层对象,然后就可以用GetIdsOfNames开始遍历文档结构了

Read more ...


Ask Mr JS

[url=http://community.csdn.net/expert/Topicview2.asp?id=2542812]怎样修改theApp.m_pszAppName[/url]

总结:可以参考微软知识库Q154744

Read more ...


Ask Mr JS

[url=http://community.csdn.net/expert/Topicview2.asp?id=2535830]关于DAO和多线程的问题 [/url]

总结:放弃希望吧,你们这些使用过时技术的人

Read more ...


Ask Mr JS

今天心血来潮,整理了一下上个月在CSDN得分的问题我参与的帖子太多,整理起来有难度,所以只整理结了的贴子

希望把这个习惯保留下去

Read more ...


在Windows2000中动态禁用/启用Ctrl-Alt-Delete

来自CSDN论坛VC/MFC版的讨论 在NT/2000中怎么禁用Ctrl+Alt+Delete?(不能用gina,键盘驱动)(此帖已归档,可以在http://search.csdn.net 搜索此帖)

本文的更新信息位于http://blog.joycode.com/jiangsheng/archive/2004/07/20/27909.aspx

Read more ...


问题:Internet Explorer中的控件在可见之前没有被创建

Q195188 PRB: ActiveX Control Window Is Not Created Until Visible in Internet Explorer 使用知识库里面的方法

在Windows XP中,可以在任务栏上看到控件的窗口,很是不雅观

Read more ...


浏览器程序中添加宏支持

这个教程提供在浏览器程序中添加宏支持的方法,你会看到如何给MFC的程序添加宏支持。这篇文章也讨论了如何扩展VC6中的CHtmlView的功能,如何实现MDI结构的浏览器,以及如何分析DHTML的文档结构。

单击 jiangsheng/Samples 下载本文的代码

Read more ...


写篇文章真累

最近一篇文章(浏览器集成教学–在浏览器程序中添加宏支持)长长短短,写了两个礼拜吧。

写这篇文章的主要原因是想把网页分析做得更加灵活。这篇文章的基础是我以前为一个EBS游戏写的外挂,可以自动修改网页内容(主要是表单)和定时submit表单(有的网站的submit有时间限制)。

Read more ...


使用虚列表和自画实现文件夹的缩略图显示

本示例演示了列表控件的虚列表和自画功能,也演示了一些系统外壳的函数和接口的使用方法。

单击 jiangsheng/Samples 下载本文的代码。如果在编译示例程序的时候出现问题,你需要去http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ 升级你的头文件和库文件

Read more ...


ActiveX控件访问所在网页的DHTML文档对象模型(MFC)

Read more ...


ASF学习笔记 Part 2

使用回调方法

一些Windows Media Format SDK的接口的方法是异步执行的,很多这样的方法使用回调方法和应用程序通讯。

Read more ...


ASF学习笔记 Part 1

一个设置是一个ASF的配置(configuration)的描述数据集合。一个设置必须至少包含一个流的配置设置。

设置中的流信息包含流的比特率(bit rate),缓冲窗口和媒体属性的设置。视频和音频的流信息准确描述了文件中的媒体配置,包括压缩数据使用的编码和解码器(如果有的话)。

Read more ...


使用IPicture的OLE实现读取和显示BMP,GIF,JPG,ICO,EMF,WMF图像

作者的话:GDI+看起来是更好的解决方案,但是IPicture的OLE实现更简单。

很久以来,我都被一个问题困扰。关于程序中显示图像的问题,我在网络上搜索了很长时间,找到了无数的解决方案,比如分析文件格式,直接读取文件的;用控件的(柯达的ImgEdit控件);以及不知道内部实现方法的库(ImageLoad)。而我找到的方法大都不容易使用,特别是那些直接按位读取图像的。很多时候我不得不为每种文件格式写一段代码。

Read more ...


摆脱在每个命令消息处理函数中的TRY和CATCH

每个命令处理都可能导致异常,抛出异常通常导致终止当前命令处理。在每个命令处理过程中编写异常处理代码是一个十分繁琐的工作,由于命令是CCmdTarget::OnCmdMsg中处理的,所以可以这个函数中处理所有命令处理过程产生的异常而不用分别编写异常处理函数。

CCccXCommandHandler是一个基于CCmdTarget的类(参考使用单独的命令处理类来处理命令消息)。此示例可推广到所有CCmdTarget的派生类。

Read more ...


在对话框中使用网页输入数据

此对话框使用了IE5附带的DHTMLEdit控件。

Read more ...


使用目录内容建立菜单

目的:根据目录内容,建立一个菜单。菜单项为目录中的文件和子目录(以弹出方式显示)。

解决方案:遍历子目录,建立一个文件路径数组。菜单项的ID是数组的索引。当用户单击某个菜单项时,从数组中读取文件路径并执行相应的操作。

Read more ...


使用单独的命令处理类来处理命令消息

适用于有很多命令处理函数的对象,以及共享命令处理函数。

应用程序的主窗口通常要处理许多命令消息。这会使文件变得很大,不容易查找。为明确起见,可以将对象对命令消息的处理抽象出来,做成一个(这里是一个,但是可以按用途分成多个)类。

Read more ...