Sunday, October 24, 2010

"CLR Via C #" Study Notes (3) constant and field



"CLR Via C #" book read twice before the rough, but has failed to understand in depth, but a lot of content is forgotten, is now ready to re-read it, and read the written part, because the process of writing is also a deeper understanding of the process. Study of this series be considered a record, it would not be easy after their inspection, if you still some help, I am very happy. I am a selective look at the book, so order and may not be the same as the order book.

CLR Via C # Study Notes (1) primitive type value type reference type

CLR Via C # Study Notes (2) boxing and unboxing

CLR Via C # Study Notes (3) constant and the field (cosnt readonly)

Constants and fields are the type of data members, but the difference is significant. See below under the constant example to understand

1. Constant value will never change. There are many types of fields, the value of non-read-only field can be changed.

2. Constant value must be determined at compile time, that the definition would assign. Compiled constant values on the preservation of the assembly metadata; field is stored in dynamic memory at run time to get field values.

3. Constant definition must be primitive types, the primitive types can refer to (CLR Via C # Study Notes (1) primitive type value type reference type); field definitions can be any type.

4. Because the constant value can not change, it can be seen as a static type, in the IL code, you can see there is constant static modifier, so call time and call the static field, as the class name directly. Constant names ; field before the call to the static fields and constants, like the class name directly. field name, call the non-static field must be an instance of the class. ,

5. C # does not allow modification of constant use of static, because the constant implied in itself is static type; field can use the static, use the static definition of the field is static fields.

1 Create a class library project named Oec2003ClassLibrary, in default of the class to write the following code in Class1

1 namespace Oec2003ClassLibrary

2 (

3 public class Class1

4 (

5 public const double PI = 3.14;

6

7 public static double _pi = 3.14;

8)

9)

10

2 Create a web project, add a reference to the Oec2003ClassLibrary class library project, the new page ConstTest.aspx, write the following code in the PageLoad

1 protected void Page_Load (object sender, EventArgs e)

2 (

3 Response.Write (Class1.PI + "

");

4 Response.Write (Class1._pi);

5)

3 will ConstTest Make start page, run, you can see the result as follows

4 will now Oec2003ClassLibrary project Class1's code to read as follows, and then re-compile the project.

1 namespace Oec2003ClassLibrary

2 (

3 public class Class1

4 (

5 public const double PI = 3.1415926;

6

7 public static double _pi = 3.1415926;

8)

9)

5, just refresh the page, you can see the following results

Page 6 of the new run ConstTest the following results can be seen

As can be seen from the above example, the application does not re-compile the case, the constant value will never change. If the application program wants to get a new constant value, Jiu must be re-compiled, so when an application program running set of applications that want to get another value of concentration, Ze Bu Neng use the constant, Ke Yi using the read-only Ziduan (readonly).

Field is also a type of data members, field modifiers are static readonly volatile, there is no modification of the Modified field is an instance of ordinary fields. static readonly can be used together, is a static read-only field. The volatile in the later part of the introduction.

About readonly must pay attention to

l 1 when the readonly field is modified by the value type, when the call to change the field if the value of view, it will compile error.

l 2 when the readonly field is modified with reference types, the call can not change its reference, but you can change the application object's value, see the following example.

1 projects in Oec2003ClassLibrary Class1.cs file to write the following code

1 namespace Oec2003ClassLibrary

2 (

3 public class Class1

4 (

5 public const double PI = 3.14;

6 public static readonly double _pi = 3.14;

7

8 public static readonly User user = new User ("oec2003");

9)

10 public class User

11 (

12 public User (string name)

13 (

14 Name = name;

15)

16 public string Name (get; set;)

17)

18)

19

2 In the web project, add pages, is named Readonly.aspx, PageLoad code below

1 protected void Page_Load (object sender, EventArgs e)

2 (

3 User user = Class1.user;

4 Class1.user.Name = "oec2005"; / / static read-only field is applied correctly modify the value of the object, run in the page display oec2005

5

6 Class1.user = new User ("oec2005"); / / error can not compile, can not change to another reference

7

8 Response.Write (user.Name);

9)

10

From the above you can know about the read-only (Readonly) field, once defined can not change its value, even if a reference type can only change the reference value of the object. However, it also is not as absolute, the following came to see how to use reflection to achieve change in the value of read-only field.

1 As used in reflection, the first reference to the namespace using System.Reflection;, and then modify the code in Class1.

1 namespace Oec2003ClassLibrary

2 (

3 public class Class1

4 (

5 public readonly Int32 _age = 25;

6 public readonly User _user = new User ("oec2003");

7)

8 public class User

9 (

10 public User (string name)

11 (

12 Name = name;

13)

14 public string Name (get; set;)

15)

16)

2 modified PageLoad code, will use reflection before the contents of the output read-only field.

1 protected void Page_Load (object sender, EventArgs e)

2 (

3 Class1 myClass = new Class1 ();

4

5 User user = myClass._user;

6

7 Response.Write ("Name:" + user.Name + "Age:" + myClass._age);

8)

The results are as follows

3 modified PageLoad code, using reflection and then modify the value of the output read-only field.

1 protected void Page_Load (object sender, EventArgs e)

2 (

3 Class1 myClass = new Class1 ();

4

5 Type myType = typeof (Oec2003ClassLibrary.Class1);

6 myType.GetField ("_age"). SetValue (myClass, 30); / / change the value type the value of read-only field

7 myType.GetField ("_user"). SetValue (myClass, new User ("glass")); / / change the reference value of read-only field

8

9 User user = myClass._user;

10 Response.Write ("Name:" + user.Name + "Age:" + myClass._age);

11)

The results are as follows

Oh, we can see whether it is read-only field value type or reference type read-only field can be successfully modified by reflection.

In some interviews often encounter the difference between const and readonly This problem of the root base is the difference between constant and fields, readonly field is modified by a field only, the practical application of the selection according to const or readonly actual demand, const better performance, because there is no allocation of memory, but many restrictions, such as restrictions on the type definition, seems not very flexible.







Recommended links:



Stop ekrn exe problems quick fixing tip



Hot Covert Surveillance



3G market to look FORWARD to



CTI Capital coveted



Picked Audio Recorders



ASF To MPG



The world's major MEDIA on the views of Chrome OS



Evaluate Java And JavaScript



Hot Graphic Viewers



MP4 To WMP



Great way to circumvent the procurement risk



MKV To WMV



QTP Descriptive language experience



For the B / S structure, to UNDERSTAND the point



FTP operation of COMMON sense



Robin Li Baidu executives leave: "make money the most important"



Sunday, October 10, 2010

Mac can become the third money-maker Jobs



"Business Week" recently published an article that those who have iPod or iPhone's enterprise workers want configure Apple's Mac computers office, no doubt that the corporate PC market, Apple's military expansion and provided an unprecedented opportunity, and Apple is ready for this? Mac iPod and iPhone can continue after a third money-maker of the Jobs?

In the first quarter of this year, Apple Mac sales worldwide increased by more than 51% over the same period last year, exceeded all analyst expectations, the growth rate of almost the entire computer industry more than three times the average. IPod and iPhone products in the promotion of the two, Apple's annual income from 5.4 billion in 2002 to rise rapidly to 24 billion U.S. dollars last year. In the past five years, Apple's stock has risen 23 times Biao, the company's market capitalization reached 154 billion U.S. dollars, more than a technology giant Hewlett-Packard, Intel and Dell.

Once a favorite of students and artists Mac is becoming the first choice for consumers. Apple is expected, despite the current economic environment facing the downturn, but the rapid growth of demand will lead to its second-quarter revenue rose 33% to 72 billion U.S. dollars. At the same time, the needs of business users on the Mac also began to grow. Those who like innovative staff began to require employers to configure the Mac computers in the office. Market research firm Yankee Group's 250 types of enterprises surveyed, found that 87% of the company in his office allocation of some Apple computers, two years earlier to 48%.

For those staff, they are likely to buy the iPod or iPhone, but placed in the home Mac, back in the office of course, reluctant to switch to the Windows interface. These staff tired of Windows, Microsoft is not doing to well, but Apple's Mac really cool. Even IT giants IBM and Cisco are conducting tests to determine whether the Office should be Mac introduced. The search giant several years ago to allow employees to freely choose their work computer.

The other companies will surely follow. A large computer services company's chief information officer, said his staff recently received 25 e-mail, asked Mac computers in the office profile. However, taking into account the need for additional staff to maintain the Mac computer, the chief information officer rejected these demands. Same router manufacturer Juniper's chief information officer also received a staff office proposed configuration requirements Mac computer. To this end the company launched a test on the Mac, 600 Juniper staff equipped with Mac computers, to test the cost of maintenance costs. As long as the cost of not too high, the company plans release the power of the computer staff selection is expected to at least 25% of employees would choose Mac.

In this process, Steve Jobs did not spend a penny of promotion costs. Of the last century 80's, Apple in the enterprise PC market can be said is defeated, for 1997, Jobs returned to Apple after the company decided to focus on consumers and students for the PC-group market. Therefore, the company did not target the enterprise market sales and technical support teams.

Jobs declined to comment on. But he has previously said that Apple is more focused on consumer-oriented PC market, he believes it is very difficult for any company to meet the business needs of users and consumers.

According to market research firm IDC data, PC-year corporate market was 150 billion U.S. dollars, Apple accounted for only 2.19% of the share. So long as Apple's market share in this a way to enhance revenue will increase 1.5 billion U.S. dollars, which will drive Apple's fiscal 2008 profit forecast 11.5% growth will be more than 5 billion U.S. dollars. There is no doubt that Apple's market worth a try.

Apple's iPhone, will be the stepping stone into the corporate office market, it is an apple to develop a clear plan to one of the products into the enterprise market. Apple plans in June this year to upgrade the software on the iPhone, so with companies such as Microsoft Exchange mail systems work better together, in addition to allow business users to create custom iPhone applications, such as inventory checks, Apple said it has been more than 160 major companies are testing the software co.

Gartner Group research analyst, said the discussions on the iPhone began to encourage businesses should also consider whether the introduction of Mac computers. At least in the corporate R & D department should introduce more of the Mac computer, because iPhone application development only in the Mac on.

At the same time, Microsoft's latest operating system Vista has to a certain extent, helped Apple's favor. Microsoft took five years of development of the operating system it is possible to become one of the best works of the failure of the system is not only a lack of compelling new features, and requires users to buy more expensive PC, hardware, and a small problem after another. 90% of office workers are still in use XP, but Microsoft plans to June 30 this year, PC makers to stop XP system, no doubt that Apple has created a great opportunity.

But Microsoft said that Apple tried to breakthrough in the enterprise PC market is not easy, because for the enterprise market, we must consume enormous financial resources to build a sales and technical support departments, and Apple's secrecy mechanisms will hinder and business users to establish a strong relations. More importantly, Apple can not modify the product design to meet the different needs of business users.

However, with the development of network technology to the next 10 years, Windows and the Mac will no longer be competition between. By then, most corporate users of computing tasks will be achieved through the network, not demand a particular Windows application software, the Internet will serve as a platform to replace Windows.

With the harmonious relationship between business users, Apple is also made no small progress. Because Mac computers also use Intel's chips, which can also run Microsoft's Windows system, this no doubt makes the enterprise users to migrate to the Mac platform, with not as difficult. In addition, Mac uses virtualization software technology that can run Mac OS and Windows systems and can easily switch. This feature is also prompted some customers to use Mac computers power.

However, the large corporate market, Apple's Mac computers have encountered greater resistance. Because these companies have more complex IT systems, the introduction of Mac training and maintenance costs will increase, in addition to software restrictions is an important reason, such as SAP applications can not run in Mac.

In addition, Apple's corporate culture is also a further expansion in the enterprise market, the challenges to be faced. Apple is well known for confidentiality, but business users need to know that their products are the next few years the evolution of line, no doubt Apple will not share this information, in addition to the necessary partners. In addition, PC-market, business users want to establish a close working relationship, and Apple is difficult to do, because almost all of its sales are conducted through the Internet.

The price is also an important factor. Current PC, the average price has dropped to 963 U.S. dollars, while the Mac, the average price of 1526 U.S. dollars, and Apple's relatively inexpensive desktop iMac with a built-in display mode, which is for the budget-sensitive business users indeed a problem, because the display replacement time should be longer than the host.

Industry analysts pointed out, Mac can continue after the iPod and iPhone, as Jobs's third money-maker, which depends largely on Jobs's decision. His position as the original, Apple iTunes will not sell the film, not to enter the mobile phone market. And now all changed. Although Apple can ignore the corporate PC market, but several years later when Apple's search for new sources of growth which is very attractive.









Recommended links:



SWsoft Virtuozzo: MAVERICK chaser



Struts framework in the Session object TO create and control



Screen SAVERS Shop



TD 3 Tender Cover Is The Key To Solve



VOB To SWF



College Job: Workplace Rules Are Familiar With The Key



Beautiful call, XP Mac OS PERFECT clone



Guide Cursors And Fonts



FLV To Zune



Lucent China's Revenue Fell 9 Longa Marriage To Be Laid Off Thousands



Dressing appropriately, moderate conversation interview etiquette all captures



Fixing Your Windows Registry With Top Registry



SA118 Chinese translation 2



U.S. will send experts want to increase overseas trade negotiations to combat piracy weight



3GP to MPEG



Saturday, September 25, 2010

Paladin 4, the efficiency of the most rapid kill BOSS



Xiao Xuan start is this look at equipment and classes, to steal 3 Fantasy prolonging exposed. I average 63 to that level. Together a set of equipment. Shoes 46, the head 51, the clothes 50, 54 weapons, plus a set of spiritual things and attention. See your favorite, and 140 physical attacks and 30% physical attack deterrent to Milky Way's 54-day sword with the potential 5. Comparison of cool hack. . . There is all shoes Kaji all of that increase rapidly +55 speed. . You will find that your advantage is the speed of the

However, BOSS will be deceleration, this time on all three individuals plus mirror state, with smoke mirror moon props. BOSS Do not use this skill, do not wave gas. Wait Xuanxiaodaning Bingjian. . . 10000 on the rebound back to his sword around, so he played it a few this skill. Free to cut him, and constantly add different characters to mirror their own state, can be easily passed. Mirror on the state of the Canadian chief of the village behind the house crescent items are sold, small water droplets that.

Then head joined to deal with you, and this time you just kill against Nvzhang Men to Nvzhang Men on OK!!!! Have a particularly good kill, (first you have to feel the insurance on each throw a stealth ) first round. . MM is generally faster Korea before the action twice in the BOSS. South Korea MM study of fire, with flames melting gold down Nvzhang Men magic defense, then purple spirit return in five cases in the British expand skills. Milky Way to eat Longxue stone marrow (plus attack medicine) and the evil mad skills can be opened. . . . Then two BOSS, the first necessity is the second daughter started Jian Zhen, Yuen Xiao 8 is a group of fire into the skills, then South Korea MM, to the British lost a purple stone marrow plus Longxue attack. Then the purple-British. . . . . . . 1000 square residual lightsaber. . . . I can play Nvzhang Men 64 of about 66,000 blood. Britain also finished purple kill himself hung up. . . . . And Milky Way with the skills regret days, shines half of the victory, Nvzhang Men of a total of 10W of blood. . . . It is easy to?

That is not only my 64's .. 54 level 2 rounds can kill Nvzhang Men, do not you say easy?







Recommended links:



Video Mix 2



3GP To MPEG



Taiwan's UMC case: killing monkey to Scare?



AVI to 3GP



Sogou Pinyin Input method Magical Eight



DB2 Basics



International surveys: one year loss of 10,000 PRACTITIONERS in the game



Picked Audio CD Burners



Deep antivirus Guide (1)



Good ASP And PHP



Graphic Reviews



Initial bitmap



Watch cool mechanical picture production Process



The national rate of 99.5% administrative villages



DV to AVI



Tuesday, September 14, 2010

Robin Li: PPC will not hurt the user experience



At half past nine p.m. on the 19 November news, Baidu (Nasdaq: BIDU) 20:00 tonight on the Baidu search PPC CCTV coverage held conference call with analysts, CEO Robin Li said in a telephone conference, and the user if the PPC search results The correlation peak may not hurt the user experience.

Q & A session before the analysts, Baidu CEO Robin Li made a brief statement, said the Baidu Baidu has CCTV coverage of PPC search to make quick response to exposure by CCTV's "treatment of venereal disease," "cancer" and other keyword bidding rating business has an emergency descent, there is no other licensed health care company PPC has also been removed.

Into the question and answer session after the analyst in the gold issue on the user experience, ask questions, "Many users complain that Baidu's sponsored links in search results, some of the first page of search results is to promote the whole link, but Google is very few of these promotion link, Baidu has any plan to change to improve the user experience? "

Baidu CEO Robin Li said that PPC results may not hurt the user experience, "We think that user experience is very important to us, but the bid ranking users if and when the most relevant search results may not hurt the user experience, this is why we are sometimes more than other search engine results link the cause. "

Robin Li said, has been improved on the PPC platform, while also doing some experiments to improve the user experience: such as reducing the number of sponsored links, and other specific keywords.

Last Saturday, two days, CCTV's "News 30 minutes" program broadcast twice Baidu PPC long-standing abuses of the press, pointed out that because of false information spread by the network Baidu PPC was questioned and exposed the fraud of the internal staff to help insider. Baidu in the 17 open on the evening program that the issue of false medical information to apologize.







Recommended links:



Hong Kong PCCW Privatization Commission will vote by sealed-depth inquiry



f4v to mp4



Cool song found the dog's omnipotent tool



Infomation Web Servers



The new second GENERATION of new ID card readers



dat to MP4



A move into a digital video camera to camera



How to avoid the trap of price competition?



Comment Download Managers



Ubuntu will build a full team in China



Expert Anti-Virus Tools



Articles ABOUT Games Simulation



Dell second quarter profit By 28 percent cited dissatisfaction with the price war has hurt revenue



Convert .flv To .wmv



EMC Q3 earnings results announced revenue fell 5.3% over the same period



Mxf Converter



Customize The "Send To" Menu



Wednesday, July 7, 2010

Youtube to MP4 Box

It's most popular and very easy to use YouTube tools. helps you Fast download, convert, play, manage your favorite YouTube videos. If you're a YouTube fan, you'll love YouTube tool! is the most powerful YouTube assistant on the planet. YouTube tool easily: 1. Fast downloads YouTube videos, 2. Supports unlimited simultaneous downloads (a real time saver!), 3. Automatically names the downloaded video the same as the YouTube title, 4. Converts YouTube videos to various video formats, including Video, DVD, VCD, AVI, MPG, MPEG, Divx, Xvid, WMV, RM, RMVB, MOV, MP4, 3GP, SWF, DAT, H264, VOB, Flash, PDA, M4V, 3G2, AMV, CDA, DV,QuickTime, ASX, TV, VHS, FLV, H264, BDMV, MAC, Apple TV, Zune, iPod, PDA, PSP, PS2, PS3, Xbox, Xbox 360, Mobile Phone, Cell Phone, Blackberry, Wii, Laptops, Printers, Palm OS, Pocket PC, PPC, Treo, Psion, EPOC, iphone.
Supports customize or create user's own profile for any new (portable) device. The video conversion supports preview. About Playing Features. Embedded YouTube Video (Offline) Player is available, it supports offline play YouTube video, .flv video and .swf video. Supports "Drag and Drop" video files direct to the main window. Easy to select the source files. Cool UI skin available. - is the most powerful YouTube assistant on the planet.



Recommand Link:



for you REFERENCE Tools



Business Databases And Tools evaluation



SIMPLE Help Tools



How to convert flac to mp3



LasVegas DVD to MOV



Converting avi to mp4



avi Converter



Silver MPEG to DVD Converter



Youtube To Xbox 360 Store



matroska video



Avex-DVD Ripper Expert



Free FLV Watermarker



Youtube Movie to Xbox Home



Youtube Movie to VCD Platinum



Youtube Movie to Pocket PC FREEWARE



PowerVideoMaker for PowerPoint 2000



Thursday, July 1, 2010

Vacations AVI to DVD

Vacations AVI to DVD is a professional and easy-to-use AVI to DVD Software, easy convert AVI file to MPG, MPEG, WMV, MP4, 3GP, MOV, RM, VCD, DVD, SVCD, MPEG1/2/4 iPod, Zune, PSP, iPhone formats. also can support batch video files conversion of different video formats such as DVD AVI MPEG ASF MOV SWF at the same time. Besides, it also can support to burn VCD SVCD DVD. And best of all, it has a powerful video decompress/compress engine that convert whole AVI movie to DVD in 30 minutes! Except for converting AVI to iPod Video and converting Video to iPod,it also supports converting among MPG, WMV, MP4, 3GP, MOV, RM, PSP Video, iPod Video, Zune Video, iPhone Video!



Recommand Link:



Recommend Network And Internet



Christmas-Idea Flash Mobile MOV to PSP



Youtube Backup + Converter Software



Picked Browsers



DVD to PSP CONVERTER



Mobile Phone Audio Editor



Youtube to MOV Guide



MovieTaxi 3GP Video Converter Platinum



video to IRIVER E150 conversion



mts to mkv



Clone DVD III



CD-R to M3U SUITE



SUPER DVD to iPod Converter version 008



Download DVD to iAudio 9 soft



Daniusoft DVD Video Converter Pack



Lohan DVD To DivX



Picked Pager Tools



Wednesday, June 16, 2010

Vacations DVD to SWF


Vacations DVD to SWF is easy converts your Flash swf files to compliant Avi, Mpeg, VCD, SVCD or DVD structures (VOB and IFO).It converts your batch files into a compliant DVD Video set of files and burns it on a DVD blank media DVD+-R(W). The aspect ratio can be automatically selected or forced to a specific format. The program works for NTSC and PAL video format and create automatically chapters. Multiple audio tracks are supported. and burn them to a DVD-R, DVD+R, DVD+RW, and DVD-RW, so that you can play your Flash swf on DVD player.It is a Powerful and versatile DVD creator. The user-firenldy and easy-to-use interface lets you set begin-time/end-time for each Flash swf and batch convert. Very quick in conversion speed and no quality is lost! Cool SWF Converter Mixer Convert Macromedia Flash SWF to MPEG AVI video file. SWF to Video Converter is a powerful utility that supports to convert Macromedia Flash SWF files to MPEG AVI or VCD SVCD DVD compatible MPEG files including movie clips, action scripts and audio in the Flash movies. Also join many SWF files in one large AVI or VCD SVCD DVD compatible MPEG file. Allow the human interaction on Flash content during conversion, no skip frames and support 32bits RGBA alpha channel video that can be directed imported by video authoring tool for composition. Main features: batch conversion for SWFs to MPEG AVI VCD SVCD DVDs, batch Join for SWFs to MPEG AVI VCD SVCD DVDs, join many SWF files in one large video file, extract MP3/WAV sound.



Recommand Link:



Shop Mathematics EDUCATION



Explosion DVD Copy



Bliss CD-R OGG to WAV Backup



iSkysoft DVD Audio Ripper for Mac



Audio Tags EDITOR



Lohan DVD Ripper Platinum



comments Audio Presentation Tools



Youtube to MOV Top Rated



Advanced VIDEO Editor



EXPLOSION RM to DVD



Youtube FLV To Blackberry Deluxe



LOHAN DVD to Blackberry



DVD & Video CONVERTER Pack



How to Mobile Converter



Compare Casino And Gambling



link to static pages?



Youtube to Pocket PC Box