Sunday, March 13, 2011

QTP Sync wait problem



In automated testing, synchronization wait 涔熸槸 a very important issue, especially Ajax, there is, make the problems more complicated. Did the Du Zi Donghua Ceshi clear, Yao right premise of the test object is Duixiang Caozuo even have Cunzai It can be seen Otherwise, it may be wrong, even the script does not run down. This is the automated test script execution error in one of the more common. are summed up under the QTP to wait several synchronization methods.

1> object's default wait time. Run QTP script process to carry out operations on an object, QTP object repository based on the properties of objects or object attributes described in search of this object, if not for some time The corresponding object is found that these objects do not exist. and this time is the object's default wait time. can File -> Settings -> Run -> Object synchronization is set, the default time is 20 seconds.

2> Object Exist property. Exist attributes of each object will have to determine the existence of these objects, which can set a parameter that is the waiting time targets at this time to search. Use Note 1: This is a method of object properties rather than object , its will have a return value, of course, is a Boolean value. it can not be "Browser (" Baidu about, you know "). Page (" Baidu about, you know "). WebEdit (" ; wd "). Exist (5)" as a statement, must accept its return value, or be prompted to lead the object does not support this method. Use Note 2: The parameter is the second rather than the QTP tutorial on the tips of milliseconds, do not was Huyou the.

3> object waitProperty ("property", "expectVaue", timeout) method. Almost every object has this method, this method is the timeout time to wait in an attribute value of this object expectations. If occur within the expected timeout property, immediately to the next step or wait for the timeout. Note that this is the way QTP set synchronization points: the recording mode, select Insert -> Synchronization Point, select the object you want to synchronize, set an attribute to be synchronized A synchronization point can be set up.

4> Synce method. This is the WEB in specific, mainly for the page loaded. To use a smaller range, but simple and practical.

5> wait method, the image is also dubbed the "death and other Dafa." That is, when the Executive to suspend the script step, and then wait for a period of time, the time expires to continue to the next step. Wati (timeout), this method The only parameter is the waiting time of course, it is formed by the second with millisecond.

In broad terms there are five kinds of synchronization waiting QTP method, practical application of which depends on the circumstances, my proposal is in accordance with the above order ...











Failure from shutdown trouble



Describe the C # call an external process



Storage Inventory And Barcoding



Mft Corruption And Partition Loss Due To Extensive



MOV to FLV



FLV to MOV



TS Converter



SAP China's new president, Xiaojie Yun: first priority is to stabilize the team



VBScript ReDim Statement



First job out of the ivory tower beginning how the election



brief Mathematics Education



Simple Site Administration



College Student Hidden Hard To Guarantee The Right To Life And Health Worries



Friday, October 22, 2010

"Hellgate: London" Fencer full translation skills



Translated under the DEMO version, the official version will make adjustments.

Type of energy level of the skills described the demand effect

Restoring tidal

Surge of restoration

Tidal force attack

Fencing

Level 1 characters

Sword

Just kill each fencer will revitalize the spirit. The more the wave excitation force, the faster return of blood. For 12 seconds, the initial power surge 81-10: 17 points per minute to restore HP

Secondary Power Chao: 35 points per minute to restore HP

Three tidal power: 52 points per minute to restore HP

Anger power surge

Surge of wrath

Tidal force attack

Fencing

Characters level 10

Sword

Wave 2 resilience

Kill the enemy more, Fencer attack more lethal force. Stimulate the increase in the number of tidal power will enhance the chance of blow. 12 sec. The initial power surge 91-10: 2% up Hit Chance

Secondary Power Chao: 4% chance of upgrading blow

Three tidal power: 6% chance of upgrading blow

Speed power surge

Surge of speed

Tidal force attack

Fencing

Level 15 characters

Sword

Anger power surge 3

Divine energy through the fencer's body, enhance the speed of action. Sprint and the effect of adrenaline with this skill can not be superimposed.

12 sec.

101-10 initial power surge: 20% upgrade rate

Secondary Power surge: 30% upgrade rate

Three tidal power: 40% and the rate

Power surge Specialization

Surge of mastery

Tidal forces attack Level 25 characters

3 speed power surge

By focusing on the spirit of justice, fencer to the sacred energy through their blades more durable. 1-7 Power Surge 15% to extend the time

Days of the election call

Call of chosen

Characters level 10 to select a target for ridicule, his voice full of divine response to be selected other than the enemy fled.

Distance of 12 meters to display their skills, frequency of 3 seconds.

201-10 goals deter radius: 6 meters

Shock and awe time: 7 seconds

Imperial Mandate

Angelic

orator

People call the election 20 days level of the selected targets were all in the holy shock, damage decreased. 1-10 2% lower enemy damage

17% attack power to enhance deterrence and sarcasm

Days arc

Heaven's arc

Sword Level 5 figures

Sword

Jump into the air directly attack the devil take the sky.

Can attack flying enemies.

101-10100% Enhanced Damage

Puncture

Crosscutter

Characters level 10 sword

Sword

Weapons to throw the enemy into a powerful long-range attacks.

Throw the main hand weapon.

Displaying a distance of 20 meters, the frequency of 6 seconds.

251-1050% Enhanced Damage

Sword Specialization

Sword master

Characters level 20 sword

Puncture 1

Training Fencer master art of throwing the sword. 1-1015% Enhanced damage throwing the sword

Hurricane Blade

Sword typhoon

Sword Level 30 characters

Sword

Sword Specialization 1

Will soak into a sharp blade the spirit of the primitive debris, setting off a powerful whirlpool. Each fragment has a 100% independent of the original weapons base damage.

Displaying frequency of 20 seconds.

401-7 throwing 12 pieces

Sword of premeditated

Sword of reckoning

Figure level 1 sword

Sword

Devil leaping high in the head servant, to bring powerful single enemy a final blow. 161-10100% Enhanced Damage

Awesome sword

Sword of authority

Sword Level 15 characters

Sword

Sword of five planned

With endless devotion and dedication, Fencer prudent to single enemy launched violent attacks. Displaying frequency of 10 seconds. 351-10500% Enhanced Damage

Contain

Hamper

Characters level 25 sword

Sword

Sword of a majestic

Weaken the target, slowing its speed and attack frequency. Lasts 4 seconds. Reduce the enemy 221-1025% speed action

20% lower enemy armor

Charge

Charge

Sword Level 5 figures

Sword

Precision Sword 2

To arouse the courage of their ancestors, Fencer indomitable manner into the battlefield.

Displaying frequency of 15 seconds.

301-1020% Enhanced Damage

Bang

Onslaught

Characters level 20

Emergency 3

Inspired revelation through the anger, fencer's body and blade are full of divine energy, to strengthen the Charge ability. 1-1040% Enhanced charge of the broken shield damage

Justice of the Road

Path of righteousness

Sword Level 30 characters

Sword

Punch 3

Inspired by the power of God, fencer to the front dash, against every enemy encountered on the road. Displaying frequency of 10 seconds. 351-10

Sword of the trial

Sword of justice

Figure level 1 sword

Sword

Agility trials raise holy moving rapidly to launch the Trinity attack. 201-1071% lower damage per swing arms

Sweep

Sweeping strike

Group attack

Fencing

Characters level 10

Trial Sword 2

Will just turn into a whirlwind of revenge attacks against melee every enemy within. Displaying frequency of 10 seconds. 251-1050% Enhanced Damage

Whirlwind

Whirlwind

Groups of people level 30 attack

Sweep 5

The release of revelation of justice rage, full of curse into an whirlwind.

4 seconds, 20 seconds to display their frequency.

401-1070% Increased speed of action

Double support

Matched blades

People grades 5 through special training so that teachers can also equip two swords melee weapons. 1-8 will power decreased by 24

Thorns

Thorns

Characters level 20 Fencer dare touch the demon servant to pay for their rude painful price. 1-10 thorns hurt 2

Energy Aura

Arua of power

People at risk level 5 ring, the sword the faith up teachers, ignite and restore the sacred energy.

Covering eight enemy.

1-10 every enemy within the ring will enhance the energy recovery point every 54 minutes

Element ring

Aura of elements

Halo characters level 15 when more enemies surrounding, the call to attack the energy between heaven and earth.

Covering eight enemy.

1-10 every enemy within the ring will enhance 5:00 dizziness, burning, shock, numbness and toxin attacks

Halo fever

Aura of zeal

Ring close to the enemy character level of 25 more, becoming increasingly enthusiastic fencer. Increase the chance of displaying blow. 1-103% in Hit Chance

Every enemy within the ring will increase 2% Hit Chance

Dodge ring

Aura of reflection

Level 15 character halo call God's will through prayer, into the ring to avoid the long-range attacks. 1-420% chance to destroy from flying objects

Vengeance Halo

Aura of vengeance

Call of Halo characters level 25 through the divine power, reflected into the aura of the long-range attacks, so the dark power of self-mutilation. 1-412% chance of reflection from flying objects









Recommended links:



Intel claims AMD is due to be executive pay



Acer suggest possible purchase PACKARD Bell is actively brewing



Flash Builder RIA can win the battle for the Adobe



comments Basic Or VB OR VB DotNet



Facebook users will soon break through 150 million



MP4 to 3G2



TOD CONVERTER



What the recent DVD-ROM to buy a good brand?



Storage Games And Entertainment



The basics of Intrusion detection rules



Younger's Quickstep



Review Clocks And Alarms



DB2 basics



quot driveletteraccess quot tfswshx.dll error



QuickTime To MPG



Hot Multimedia Creation Tools



Wednesday, October 20, 2010

How professional orientation?


Character actor is doing the highest principles of professional orientation

Professional orientation and social positioning of self-positioning of both unity.

Self-positioning is to determine who I am, what am I personality types of people? I am naturally good at? What is not good at?

Social Orientation is my role in society. I should be at the social division of labor in what position? What is the role? That is, should I engage in what profession?

Vocational orientation in the social division of labor is determined on the big stage to play the role of my own: I found this, do not always wear a mask to meet the needs of work, even Zhangyang own personality, and up to use my way of thinking habits behavioral pattern. It simply means - do character actor.

As we have often played a role of certain actors very successful as it is the role of an actor's personality traits and is similar to a character actor, like the secret of career success is to do character actor.

Character actor to do handy, easy success; very hard to do non-character actor, not easier.

Character actor is doing the highest principles of professional orientation.

Therefore, the need for accurate job positioning, must be both an accurate picture of a person's character and talent, but also fully understand the different career.

You can to position themselves?

Overall, their professional orientation to themselves are often not allowed. First of all, it is difficult to determine their personality type and talent. Although aware of their own character performance, features, first of all it is their perspective. Because a person's life experience is limited, the lack of objective horizontal comparison, can not determine their character at any position in the crowd: introverted or extroverted? Sensory or intuitive? Type of thinking or feeling type? Perceptual or judging? Many of the successful white-collar career guidance counseling center, in the character before the test that they are export-oriented character, the test result was within. (In accordance with the personality typology of the export-oriented character of the definition, the U.S. authority on the American character typology sample statistical analysis concluded that about 75% of Americans are export-oriented character; and vocational guidance centers, according to the successful observation and statistics, Most Chinese people are introverted personality.) Some people think he is very emotional, but she did not know how people really sentimental like and do not know my character traits such as personality typology of character in what type of category. However, some personality type indicator test system is a direct correspondence with the specific job, that is a kind of personality types are suitable for specific occupations, such as is now the largest in the United States use the MBTI personality type indicator.

Have a successful career guidance center to consult the girl's description of a very classic, her words are like this: "In fact he is still a better understanding of their own, but often bystander; in fact the best understanding of their own or their own, but they still see themselves often separated by a layer of fog. "I said:" The role of professional planners is to help you penetrate this layer of fog. "

Furthermore, a person is difficult to fully understand the different career. Now a total of more than 20,000 kinds of different occupations. A person can not try on each job one by one, the possession of information on various occupations and few.

Professional planners on what basis can give people space?

Professional planners and talent through personality testing, face to face communication or telephone communication, to seize a person's core - the character and talent.

The character of a successful career guidance center testing system is using the U.S. MBTI personality type indicator, by the Chinese people constantly testing, modifying, improving, China has completely realized, and its reliability in the use of our vocational orientation process has been sufficiently validated. Vocational Guidance Center successfully finalize the consultant's personality type, not only based on the results of personality tests, career planners should combine professional experience, successful career guidance center's success rate can reach 96%. (So far, any personality test tools, if the test alone were the answer to the test questions to judge the accuracy rate to 60% is relatively high. This is why many people use online or in books, newspapers and magazines in the character testing tool tests, found that the reason the results are not allowed.) same time, professional planners have both experienced a number of occupations, access to direct experiences of these vocational and feelings, but also more indirect employment experience - a lot to acquire all responsibilities of different professional tasks, work content, competencies, personality and other information required, and effectively understand.






Recommended links:



MKV to PSP



Articles About Remote Computing



3DS MAX of magical Engraving



RM To AVI



Design With C Windows Application Template 4



Soft Expo in June highlights the opening nine is expected to attract 80,000 visitors



AVI to FLV



Log multiple Gmail accounts at the same time - Firefox extension



CMM assessment in China Suggestions



Using De exterminate rabbits annoying ads RMVB Movies



e-cology in the Pan Micro Series 15



The BRIDE marrying the wrong Lang - Department of points I and affinity



Good Basic Or VB Or VB DotNet



Evaluation Audio Speech



News About Converters And Optimizers



Tuesday, October 5, 2010

How out of the cold 3G



The issuance of 3G licenses to 2009 as the first year of China's 3G. After the reorganization of the three carriers were reclaimed from the Ministry of Industry and representatives of three different standard of 3G licenses. But even if operators are prepared to invest several hundred billion dollars of funds 3G construction, and the advertisements plastered the streets, the harvest is still far below the expected market reaction. Does this have the largest global market for mobile phone users have long been immune to the 3G?

"3G is that?" This is probably the most common questions consumers in 2009, let operators the most embarrassing questions. For most consumers, if the 3G is the phone faster Internet speeds than 2G so "a little", they almost could not find any switch to promote its new network to the "necessary" and "urgency . " In HC gateway to D & B survey data, 92% of mobile phone users that 2G or 2.5G network has basically meet their needs. As the market is still in the early construction of the imperfections of the network, terminal equipment is not complete, also forced consumers to endure intermittent call, the phone models and operating complex rare inconvenience.

Early in the current market, who will be willing to endure all the inconvenience that, and would be happy for those who are far from "necessary" and cool the price is expensive the "first 3G users?" In 2035, the terminal equipment trends mature and declining prices, when, who really need 3G?

For operators, 3G will come from the most likely buyers are less price sensitive to high-end users. Therefore, both the selection and Hewlett-Packard, Lenovo, Dell and other first-line branding launch 3G Internet card portfolio on the + China Mobile, or the introduction of 3G version i iPhone, Apple tried to countless ready-made fans directly into their 3G users China Unicom, 3G began in earnest in the high-end market has become one of their basic assumptions.

But as early as age 2G, 3G portal will be found according to traffic monitoring, China Mobile's GPRS services in a large part of the initial flow is positioned from the "low end" of the M-Zone customers, rather than high-end GSM customers. In other words, early use of mobile Internet users mainly by university students, just the employment of young people. In 3G era, they are likely to be the first to embrace 3G users.

In addition, telecommunications experts, Li Gang also mentioned another potential 3G users some unexpected groups: migrant workers away from home are. For those away from home and people without a computer, 3G mobile Internet service provided and the video call feature more attractive.

For those on 3G most "may wish" for the consumer group, 3G is the most precisely not "available" for. A survey has shown, 3G mobile phones in the 1000-2000 focus on the biggest demand for dollars in the low-end market, while the second and third tier cities, the young consumers of affordable cell phone tariff ceiling, usually not more than 100 yuan. Rates and terminal equipment replacement costs are high is restricting the number of users to upgrade to 3G, the biggest obstacle.

The generous investment has been made for operators to cost-down in a short period to an acceptable level of these low-level consumers is clearly "unacceptable" the. This group of seemingly irreconcilable contradictions, so that 3G's prospects in the Chinese market has become unpredictable.

"3G is that?" Operator for this problem is still owed consumers an exciting answer. Launch 3G services is considered a successful example of the Japanese telecommunications operator NTT DoCoMo had a punch line: The phone is "cigarettes, the twenty-first century", people will pull out when bored. This means operators makers of not technology to solve real problems, but how to provide Quan Xin Wei users of the service experience, and thus the establishment of Xin's business Moshi.

In addition to video calls, wireless Internet access, streaming media, online games have been well known consumer services, value-added service operators in the plan until then. China Mobile jointly developed with the Fang Zhengfei read text electronic reader rooms, Unicom launched the market for children such as GPS positioning function of 3G mobile value-added services, value-added items such horizon successful, they will represent the future of domestic 3G business innovation powerhouse, currently less than asserted, but the traditional telecommunications industry than the industry chain structure, carriers are moving towards a more open environment for industrial innovation. The next step is, through alliances and pooling of mobile value-added services, mobile content providers and other industry chain "small role", to establish a mechanism for closer coordination and more equitable benefit-sharing mechanism for the greater degree of value-added services to stimulate the field of innovation.







Recommended links:



vlc unicows.dll error get help now



Ten types of field bus architecture



VOB to FLASH



Hot Games Board



Articles About Graphic



Operation of supermarkets to dealers SUGGESTIONS



21st Century Business Herald: REVERSAL eBay



Picked Anti-Spam And Anti-Spy Tools



Jinan Stone 400 points for the hot phone promotions



AVI To MPEG4



Zack Rusin interviewed the beauty and magic of KDE



Comments Adventure And Roleplay



Police identified Results: FOXCONN high fall dead before his death, Department staff



MPG to Flash



3DS Max 7.0 PF Source particles all captures (6): real explosions



Saturday, September 25, 2010

jsp, servlet talk about Chinese issues



In the jsp, the Chinese people to be terribly upset often garbled.

Common measures for Chinese processing, can often be seen in the main line is the following 2:

Or:

Virtual Small Dragon Pavilion is also mainly the above two kinds of methods were modified to become a 1.1 version.

A simple summary of the sample occurred in the Chinese and the following places:

1 with the Chinese in the url parameter can be directly read.

For example:

2 sql database relevant to the operation

Here the use of Access without problems.

3 to read HTML form submitted in the form of Chinese values

Need to be encoded in jswdk the more concise wording such as:

String name1 = new String (request.getParameter ("user_id"). GetBytes ("ISO8859_1"));

In addition, jdk1.3 support, do not join

In jdk1.2.2 below, even if the two kinds of methods used at the same time is also very unstable.

In the resin platform, the situation is better. As long as the first line of the page by adding:

Can correctly handle the Chinese.

If we add the code then it does not.

5 session included the Chinese

In jswdk, the strange thing is, if read from the form of encoded values can be displayed correctly;

However, given directly to Chinese values are not.

resin platform well, ibid.

6 for values of the variables assigned after the Chinese displayed correctly in Chinese.

For example, the following procedures:

Also jswdk1.0.1, above representation is not the problem in jdk1.2.2, but it can not be displayed under jdk1.3.

resin platform well, ibid, tested only in make up

Without the need to also be able to display Chinese correctly.

Experience:

jswdk may only be used for general development, stability and other issues may not be as commercial software.

As the jdk1.3 version many times better than those jdk1.2.2, and also better support for Chinese, so it should be used.

As a free commercial software, resin is not only fast, stable, and automatically compile, mistakes can be pointed out that the line can support the use of server-side javascript, etc., but at least I think that the support of the Chinese language well.

Of course, if you can not do anything with the right will show the Chinese what we expected.

Also, I believe in the unix / linux / solaris should under no such problem.







Recommended links:



"Dance like" Chinese EDITION



Development Catalogs



FLV to SWF



Storage Religion



Ultimate practicing four cents lets YOU easily got to the 99



Young PROFESSIONALS entering the workplace to learn the three key issues



In Section North soft, direct plug in for the "wings"!



Fireworks 4.0 Zhezhao Daquan ---- second class to create a bitmap Zhe Zhao



WMV to QT



BT brings benefits only to the minority Carrier BT is to pay



Printer Report



QT to WMV



China's environmental satellite data



Convert Text To Numbers



Thunder has more than 100 million users targeting NASDAQ



Sunday, September 19, 2010

Me introduce the judges to do creative practice contest Hugo



Ali software together CSDN, InfoQ, Javaeye and other well-known technology site, Beida Jade Bird and a number of training institutions, on July 2 was officially launched in Nanjing, "Wang ska - me introduce innovative practice contest" to find the most innovative Internet applications, providing developers the opportunity to achieve a dream for me introduce an open platform for users of fresh fashion to provide the most interactive applications.

"Wang Scar" Creative Practice Competition Competition and product innovation time points two seasons. No. 1 player has begun the season hot application, online selection in August 1 - 8 carried out on 25, participants can design a small plug-in Want Want, interactive games, tools, expression, or skin, so long as the Internet Top applications or services to the Want Want to enable users to need it, used cool.

Gold to create ska Oscar Wong

"Wang Scar" Creative Practice Competition Competition and product innovation time points two seasons. No. 1 player has begun the season hot application, online selection in August 1 - 8 carried out on 25, participate in exclusive prize Jieyou me introduce the most fortunate of five players, not only will be bringing home a symbol of high honor, worth tens of thousands of The "Wang ska" Special Award - Want Want Jin (50g thousands of gold), will in practice be 200,000 start-up stage funding and business sites free of charge.

Network creative originator - Hugo to comment

Learned that the contest organizers invited a number of prosperous ska in software development, network ideas have extensive experience in areas such as appraisal, in which the network Red Hugo as a guest judge, he once said that "" a Steamed The massacre, "" creative popular in the entire Internet. Only the early stages of the race, Wong ska has detonated more than prestigious national college students creative passion, enthusiasm competition has generated a lot of lovely ideas, one after another at me introduce the official online contest on display .

Many independent software developers and internet enthusiasts in the early growth stages, because the lack of startup funds, space and hardware, so many good ideas remain only on paper side of Appeal put into practice; or because of the lack of a sufficient number of success stories can not be quickly and effectively into the software services into end user. Ali software, "Wang ska - me introduce innovative practice of Competition", on the one hand for the developers to provide more creative space and business opportunities, on the other hand, by me introduce an open platform to enable developers to be in excellent products the value of practice, the client, but also to meet all kinds of Internet users growing demand for online applications, enriching the user experience.

Wang ska me introduce innovative practice will be the contest as an opportunity to enhance interaction, expanding openness, innovation, designed to provide users with a wider range of network integration services. Wang ska Creative Practice Competition Registration: http://wsk.alisoft.com/







Recommended links:



ARTICLES about Art - Screen Savers



Younger's Quickstep



Using VMware, vowed to computer "cloned a technique"



Help TOOLS Expert



I Am A Third Category



CONVERT .flv to .wmv



"Home" And The New Audio-visual! Want To Sing Sing With ABPlayer



Pao GS-816FC Fiber Disk ARRAY



Exception Handling in C # (1)



dat TO mp4



Ubuntu 8.04 Active Directory: Likewise



Different OPINIONS



f4v to MP4



psp 6000



Using tabs to align OPTIONS



Wednesday, August 4, 2010

C + + programmers to easily commit the error of 10 C #


We know, C # and C + + syntax is very similar, from a C + + to C # transformation, the difficulty is not the language itself, but rather familiar. NET-managed environment and on. NET framework for understanding.

Although C # and C + + in grammatical change is very small, almost not have any impact, but some changes are enough to make some careless moment of C + + programmers in mind. In this article we will discuss the C + + programmers the ten most likely to commit errors.

Trap 1: there is no clear end of the method

Almost completely sure that, for most in terms of C + + programmers, C # and C + + the biggest difference is that debris collection. This also means that programmers no longer need to worry about memory leaks and make sure to remove all the useless pointer. But we can no longer accurately control the process kill useless objects. In fact, in C #, there is no clear destructor.

If the use of non-management resources, without the use of these resources, you must explicitly release it. Recessive control of resources by Finalize method (also known as the finalizer) provided, when the object is destroyed, it will be called to recover debris collection program resources occupied by the object.

finalizer should only release the destruction of the object occupied Non-management resources, and other objects should not be involved. If the program is only used to manage resources, it need not be the implementation of Finalize method, only the non-manageability of resources will be used in the treatment of Finalize method. As the need to take up certain resources finalizer, it should only need it to perform the method finalizer.

Directly call an object's Finalize method is not permitted (except in sub-class called base class Finalize Finalize.), Debris collection program will automatically call Finalize.

From the syntax point of view, C # in the destructor and C + + is very similar, but in fact they are completely different. C # the destructor definition of Finalize method is a shortcut. Therefore, the following Erduan code is different:

~ MyClass ()
(
/ / Need to complete the task
)

MyClass.Finalize ()
(
/ / Need to complete the task
base.Finalize ();
)

Error 2: Finalize and Dispose to use whom?

From the above discussion, we have been very clear, explicit to call the finalizer is not allowed, it can only be called debris collection program. If you want to free up some no longer in use as soon as possible a limited number of non-managed resources (such as file handles), you should use the IDisposable interface, the interface has a Dispose method, which can help you accomplish this task. Dispose is no need to wait for Finalize to be called and be able to release the non-manageability of resources.

If you have used the Dispose method, you should stop the debris collection process and then the corresponding object method implementation of Finalize. To do this, you need to call the static method GC.SuppressFinalize, and the corresponding object pointer passed to it as a parameter, Finalize method can call the Dispose methods. Accordingly, we can get the following code:

public void Dispose ()
(
/ / Complete clean-up operation

/ / Notify the GC not to call Finalize method
GC.SuppressFinalize (this);
)

public override void Finalize ()
(
Dispose ();
base.Finalize ();
)

For some objects, may call the Close method is more suitable (for example, the document object calls Close on more appropriate than Dispose), you can create a private property of the Dispose method and the Close method of public property, and to call Dispose to realize Close call the Close method of some object.

Given the uncertainty will call Dispose, but the implementation is uncertain finalizer (we can not control when the GC will run), C # provides a Using statement to ensure the Dispose method will be called the earliest possible time. General approach is to define which objects to use, then use brackets for these objects to specify a range of activities, in the event when the innermost parentheses, Dispose method will be automatically invoked, the object for processing.

using System.Drawing;
class Tester
(
public static void Main ()
(
using (Font theFont = new Font ("Arial", 10.0f))
(
/ / Use theFont object

) / / Compiler will call Dispose object processing theFont

Font anotherFont = new Font ("Courier", 12.0f);

using (anotherFont)
(
/ / Use anotherFont object

) / / Compiler will call Dispose object processing anotherFont

)

)

In this case, the first part, Font object is created in the Using statement. When the Using statement at the end, the system will call Dispose, on the Font object for processing. In this case, the second part, Font object is created in the Using statement outside, in the decision to use it, then place it inside the Using statement, when the Using statement at the end, the system will call Dispose.

Using statement can also prevent other accidents from occurring, ensure that the system will call Dispose.

Error 3: C # in the value-type variables and reference-type variables are different

As with C + +, C # is a strongly typed programming language. C #, data types are divided into two categories: C # language itself, the inherent data types and user-defined data types, which is also similar with C + +.

In addition, C # language Hai Ba variables are divided into value types and reference types. Unless it is to be included in a reference type, value type variables retained in the stack, this point and C + +, variables are very similar. Reference type variable is a stack, its value is the address of the object heap, and C + +, the pointer is very similar. Value type variable value is directly passed to the method of reference-type variables are passed as parameters to the method, passing the index.

Classes and interfaces can create reference type variable, but need to point out that structure data type is a built-in C # data types, it is also a value-based data types.

Error 4: Note that implicit data type conversion

Boxing and unboxing enable value data type is used as the index data type using the two processes. Value-type variables can be packaged into an object, and then the return value is unpacked variables. Including built-in data types, including C #, the data of all types can be implicitly converted to an object. Packing a value type variable will generate an object instance, and then copied to the instance variable.

Boxing is implicit, if necessary where the index data type data type using a value type variable, the value of hidden variable will be transformed into the index data type of variable. Boxing will affect the performance of code execution, so should be avoided, especially when the data volume.

If you want to convert a packed object back to the original value type variable, it must be explicit to be unpacked. Unpacking need two steps: First, the object instance checks to ensure they are shaped by the values of variables are packaged into the; second step in the value of the instance to copy the value type variable. In order to ensure a successful solution package was unpacked the object must be packing a value type variable by the value of the index generated objects.

using System;
public class UnboxingTest
(
public static void Main ()
(
int i = 123;

/ / Package
object o = i;

/ / Solution Package (must be the dominant)
int j = (int) o;
Console.WriteLine ("j: (0)", j);
)
)

If the object is unpacked is not valid, or a different data type object index will result InvalidCastException different things.

Error 5: Structure and objects are different

C + + structures and classes in the almost, the only difference is that by default, the structure of access is public, its inheritance rights is public. Some C + + programmers to structure as a data object, but this is not a convention must be the case.

In C #, the structure is only a user-defined data types, and can not be substituted. Although the structure of the support properties, methods, fields and operators, but does not support inheritance and destructor.

More importantly, the class is an indexed data type, the structure is a value type data type. Therefore, the structure of the index operation in the expression of the target area without more useful. Array of operational structure more efficient, and in the operational aspects of the collection is less efficient. Set to index, structure must be packaged is suitable for use in the operation of the collection, a collection of classes in the large-scale operations more efficient.

Error 6: Virtual methods must be explicitly covered

In the C # language, the programmer of a virtual method in the coverage must be the dominant use of the override key word. Suppose a Window class is written by the A company, ListBox and RadioButton classes by B's and programmers in the company prepared to buy the A Window on the basis of class, prepared, B Company of the programmers of the Window class, including changes in the future little is known about the situation, including the design.

If the B's, a programmer to add a ListBox Sort method:

public class ListBox: Window
(
public virtual void Sort () (")
)

A company release a new version in the Window class before, this will not have any problems. A company if the Window class programmers also added a Sort method.

public class Window
(
/ / "
public virtual void Sort () (")
)

In C + +,, Windows class will be the ListBox Sort method Sort method of the class based approach, in the hope of calling Windows class Sort method, ListBox class Sort method will be invoked. In C #, virtual function is always considered to be the root of virtual dispatch. In other words, once C # finds a virtual method, you will not find in the virtual chain other virtual methods. If the ListBox is compiled again, the compiler will generate a warning message:

"Class1.cs (54,24): warning CS0114:''ListBox.Sort ()''hides
inherited member''Window.Sort ()''.

For the current members of the original method of coverage, you need to add the override key word, or add new key word.

To remove the warning message, the programmer must find out what he wants. ListBox class can be added before the Sort method new, that it should not override the virtual method in Window:

public class ListBox: Window
(
public new virtual void Sort () (")

This could clear the warning. If the programmer really want to overwrite methods in the Window, you must use the override key word to demonstrate its intentions explicit.

Error 7: class member variable initialization

C #, C + + initialization and different. Suppose there is a character with a private member variable age of the Person class, Employee class is generated by a succession of Person, and it has a private member variable nature of salaryLevel. In C + +, we can initialize the Employee's constructor initializes some salaryLevel, as shown in the following code:

Employee:: Employee (int theAge, int theSalaryLevel):
Person (theAge) / / initialize base class
salaryLevel (theSalaryLevel) / / initialize member variable
(
/ / Constructor code
)

This method in C #, is illegal. While still can initialize base class, but as the code above as initializes the member variable will cause a compiler error. In C #, we can define a member variable to initialize it when the same:

Class Employee: public Person
(
/ / Member variable definition
private salaryLevel = 3; / / initialization
)

Note: You must explicitly define each variable access.

Error 8: Boolean variables and integer variables are different from children

if (someFuncWhichReturnsAValue ())

In C #, Boolean variables and integer variables are not the same, so the following code is incorrect:

if (someFuncWhichReturnsAValue ())

if someFuncWhichReturnsAValue return to zero, said false, or that the idea is no longer true. The advantage is that the original assignment operator there will be confused with the same error will not happen again. So the following code:

if (x = 5)

At compile time error occurs because the x = 5 is the 5 assigned to the X, rather than a Boolean value.

Error 9: switch statements would be less than the implementation of some statement

In C #, if a switch statement to implement a number of operations, the program may not perform to the next statement. Thus, while the following code in C + + is legal, but in C #, not legal:

switch (i)
(
case 4:
CallFuncOne ();
case 5: / / error, will not be executed here
CallSomeFunc ();
)

To achieve the above purpose of the code needed to use a goto statement:

switch (i)
(
case 4:
CallFuncOne ();
goto case 5;
case 5:
CallSomeFunc ();
)

If the case statement does not execute any code, all the statements will be executed. Such as the following code:

switch (i)
(
case 4: / / can perform to
case 5: / / can perform to
case 6:
CallSomeFunc ();
)

Error 10: C # in the clear assignment of variables required

In C #, all the variables must be assigned before use. Therefore, you can define variables not initialize it, if it is passed to a method before, must be assigned.

If the only way through the index to pass a variable, and the variable is the method of output variables, this is it will cause problems. For example, suppose there is a method that returns the current time, hour, minute, second, if the write code like this:

int theHour;
int theMinute;
int theSecond;
timeObject.GetTime (ref theHour, ref theMinute, ref theSecond)

If you use theHour, theMinute and theSecond not before the three variables are initialized, it will generate a compiler error:

Use of unassigned local variable''theHour''
Use of unassigned local variable''theMinute''
Use of unassigned local variable''theSecond''

We can initialize these variables to 0 or other methods did not affect the value of the return value to solve this small problem the compiler:

int theHour = 0;
int theMinute = 0;
int theSecond = 0;
timeObject.GetTime (ref theHour, ref theMinute, ref theSecond)

This little too cumbersome, these variables are passed to the GetTime method, then change it. To solve this problem, C # specifically for this situation out parameter modifier provided, it can make an argument without initialization can be cited. For example, GetTime parameters in its own makes no sense, they are just to express the output of the method. Before the method returns, Out parameters must be assigned a value. Here is the revised GetTime methods:

public void GetTime (out int h, out int m, out int s)
(
h = Hour;
m = Minute;
s = Second;
)

Here is a new method called GetTime method:

timeObject.GetTime (out theHour, out theMinute, out theSecond);






Recommended links:



Barbed Words! Photoshop Special Effects Make The Word Cactus



Free mkv converter



PATRIOT'S "sports intelligence"



how to Convert .mp4 to .avi



Directory ASP And PHP



See the "examiner" is not big voice



.ts Files



Agriculture: The First Km And The Last Mile



Chinese version of HD-DVD is still the "core countries"



Cursors And Fonts introduction



Ps3 Video Formats



Knowledge Sub-test System: PV Operation And Dispel Doubts



Ali Mama Ma prove safety push over 1 million registered members Baidu



TA listen to the song, cool the dog's help you "search" out of



"Wall Street Journal": OUT of mouse traps



News about Computer Education



Review Cursors And Fonts