显示标签为“demand management”的博文。显示所有博文
显示标签为“demand management”的博文。显示所有博文

2013/03/25

Full-width and half-width of the difference between input method

A What is the full-width and half-width?
(1) angle - a character occupies two standard character position.
Kanji characters and provides for the full-width English characters and the national standard GB2312-80 graphic symbols and special characters are full-width characters. The general command of the system do not have the full-width characters, just word processing will use the full-width characters.

(2) half-width - refers to the position occupied by a character of a standard character.
Usually letters of the alphabet, numeric keys, symbol keys are half-width, within a half-width of the display code is a byte. Within the system, these three characters are handled as a basic code, so the user input commands and parameters generally use half-width.

B full-width and half-width of each in what circumstances?
The full-width accounted for two-byte, half-width of one byte.
The half-width full-width punctuation, full-width punctuation accounted for two-byte, half-width of one byte, regardless of the half-width or full-width, Chinese characters, or to account for the two bytes.
Only in the source code of the programmed use of the half-width punctuation (excluding internal data string)
(In fact, this case simply does not exist the concept of full-width of the half-width on a computer that does not support Chinese characters and other languages ​​can only use half punctuate)

For most fonts, full angle looks larger than the half-width, of course this is not the essential difference.

C full-width and half-width of the difference between
The full-width is the width of letters and numbers, such as Chinese characters accounted position word. Half-width ASCII character way to do with the time from the Chinese character input method input alphanumeric characters are half-width.

Appear in the Chinese character input method, input alphanumeric default to half-width, but the punctuation is the default for the whole angle corresponding toolbar button mouse click input method.

D "full" and "half-width":
The whole angle: means in GB2312-80 (information exchange · basic set of Chinese ideograms coded character set ") in a variety of symbols.
Half-width: refers to the various symbols of the ASCII code of the English document.



2013/03/24

Instead of cumbersome inefficient use of PHP5's __autoload the external file containing the way

Generally written PHP code comrades, may file contains commands include, include_once, require, require_once familiar. Although these commands has played an important role for us to re-use the same code, but as the file be included, as well as the interaction between the include file contains the entire PHP application contains relations intricate. And there is a very inefficient, we write a PHP page may have to go hand-written code contains external public documents to be used eleven, and once the project becomes huge, modify the include file references will become a headache, because we must first know where references an external file, we can modify. Fortunately, with the release of PHP5 to a new function __ autoload entrance parameter is the name of the class is not defined. If we declare this function in your own code, it will be called automatically when you attempt to use the class has not yet been defined. By calling this function the scripting engine in PHP error class load required given a last chance before the failure. Here we should be able to think of, we can take advantage of this new feature, coupled with the use of object-oriented programming, we need to refer to external public code are encapsulated into a class inside the storage to the same as the class name file to the automatic loading function is triggered, we can directly contain PHP file with the name of the class, you can achieve the dynamic loading of external files. So we write code, you do not need to advance include external files, but also to achieve the object-oriented programming model, a page to the introduction of new classes only need to directly instantiate the class can, PHP accordance with __autoload the definition automatically go call the external file. Modifications and extensions is easy, as long as we have the class definition and maintenance on it. And even called among multiple classes and instances, without first contains the introduction, as long as the main code __autoload function declaration and the class definition file storage is handled in strict accordance with the rules, then calling each other between classes. and instantiation will auto-complete, which we will be able to rid itself of the original kind of cumbersome and inefficient external file contains way. Now I give you a simple piece of sample code, as long as the definition of a good external class file naming and storage rules, can facilitate the use of this fully automated external file contains. say ();  ?>      / / Inc / demo.php class definition example