Sunday, August 23, 2020

The Fall of Rome: Political and Economic Corruption

Roman Empire bowed to the intensity of political and cone mirror debasement, remote intrusions, alongside cataclysmic events and sicknesses. The Roman Empire was thought to be a solid domain, in any case, Rome oust situated a lot of defilement, both strategically and financially. Rome had an aggregate of 19 e heads from 235285 CE ( Document A ). Thirteen of the nineteen sovereigns either were, or were accepted to have been, killed. An example Of death in eminence implies the FAA CT that individuals were discontent with their rulers.Along with that, a steady difference in rulers mama squeezes it difficult for anything to complete, in light of the fact that as the new sovereign assumes control over needs frequently change. The Roman financial and equity framework was especially for the well off: â€Å"†¦ A [wee Itty lawbreaker]†¦ Is not rebuffed for his foul play, while a poor man.. Experiences I lady punishment. † ( Document E ). This foul play caused for the destitut e individuals to dismiss their own home, the peep eel turned out to be less ready to battle to keep their domain thriving.Rome, however saw as this enormous, solid, and unbreakable realm, this was not the situation. Carelessness lead to the relinquishment of the standard reinforcement and march grog fix drills. The Roman warriors battled without reinforcement on the grounds that the protective layer turned out to be excessively overwhelming, f or the men never wore them.. Michael Grant expresses that, â€Å"There can be little uncertainty that the small nesses of the late Roman armed force was to a great extent due to the possible failure† ( Document B ). The absence of prepared fighters brought about numerous issues, as outlined in Document C Rome was available to a wide range of invaders.Rome does not have the normal outskirts some antiquated human advancements, for example, G rice had. Because of the absence of outskirts The Hunks effectively ousted the Roman individuals. Sins e â€Å"The Hunks surpass any meaning of savagery† ( Document D) he undeveloped, apathetic, and unprotected Roman fighters got no opportunity of triumph. Catastrophic events and diseases caused for a brisk drop of Roman populace; † Fifty thousand people had lost their lives in the flood [in the city Of Alexandria all en]†¦ ( Document With such a significant number of lives lost the measure of individuals to help secure the nation fell enormously. This absence of individuals make it much simpler for the as of now ruthlessly better Hunks than ova counters the â€Å"almighty' Rome. On the off chance that Rome had not been influenced by such solid calamities and ailment more officers would have had the option to add to battling the Hunks. Rome could have gone on for a more drawn out timeframe notwithstanding the political and monetary corruption.The domain may in any case be endeavoring today if the Roman officers would have stayed tireless, despite everything re hearsing their walks. Becoming used to their defensive layer so t hello could really wear it in battle. If not for the absence of regular outskirts in the enormous MME anger the Hunks might not have had the option to immerse the land. Another archive that would be into resting to peruse would be about how the Hung warriors felt while attacking and vanquishing this remote land.

Saturday, August 22, 2020

Rasputin The Man, The Mystery Essays - Grigori Rasputin

Rasputin: The Man, The Mystery Rasputin: The Man, The Mystery Presentation Grigory Yefimovich Rasputin is known as the Siberian Mystic Healer, whose life has been retold various of times furthermore, practically each time it is told it is retold in an alternate manner. Since Rasputin lived in a human progress not so propelled, little is know about his initial forty years of life. So most data on the man are ordinarily from stories families have passed on. Some state he is a blessed priest with incredible powers, then again he might be known as a fake with a bogus association to God. The Beginning Rasputin was conceived somewhere in the range of 1864 and 1865 in his own home of Pokrovskoe. It is currently known as Tiumen' Oblast. It is situated in Siberia on the Toura River. This was a little city situated close the Ural Mountains. At the focal point of the town stood a huge white church with a guilded arch, which was an image of Russia's solid strict foundation. At eighteen years old Rasputin experienced a strict change. He inevitably went to the religious community at Verkhoture. At this spot he became aquatinted to the Khlysty organization. Subsequent to spending some time at this religious community he didn't turn into a priest. At the point when he resulted in these present circumstances religious community he had no goals of turning into a priest. In any case, this even in the long run prompts distinction and force for Rasputin. At nineteen years old, Rasputin returned to his home in Pokrovskoe. There he began to look all starry eyed at and wedded Praskovia Fyodorovna. Together the two had three youngsters. They had Dimitri in 1897, Maria in 1898, and Varvara in 1900. Marriage wasn't sufficient to keep Rasputin in one spot. He kept on meandering to spots of strict importance suck as Mt. Athos, Greece, and Jerusalem. He was a self-announced sacred man. He had the ability to mend the debilitated and the ability to foresee what's to come. His acclaim developed significantly. Before long individuals went from significant distances in search of his all around found out about capacities and understanding. For Rasputin's assistance, individuals would reimburse him with food, presents, and cash. Rasputin has had no long time of strict or otherworldly preparing. He additionally had constrained instruction so he was left unskilled. This caused his showy capacities to turn out to be very valuable. At some point while Rasputin was furrowing in the fields he had a disclosure. The story expresses that a Heavenly Mother contacted him. She let him know of youthful Aleksei, the tsarevich and she trained him to show up at the kid's side to stop his dying. His draining was an outcome of his hemophilia. He made his underlying move towards St. Petersburg in1902, at the point when he visited the city of Kazan close to the Volga River. After this outing he had a quickly developing gathering of pupils and associates in the upper class, and he was known as a righteous man. The City of St. Petersburg Rasputin showed up in St. Petersburg at when church pioneers were extremely helpless. They needed individuals with strict impact, and who had control over the individuals. Rasputin was both a customary laborer ? straightforward, commanding, and direct ? while at the equivalent time he had the ability to shock individuals with his recuperating powers what's more, his knowledge into what's to come. Individuals in the city had various perspectives on the man. One was that he was a blessed man who had incredible forces. The other is that he was only a pessimistic, and that he utilized religion to cover his drive for sex, cash, and force. Sexual coexistence Rasputin had a functioning sexual coexistence. He was accounted for to hold bashes in the cellar of his home simultaneously he lived with his better half around 1900. Afterward, after Rasputin had an ascent to notoriety he pulled in an enormous horde of female devotees. A large number of the photos of Rasputin are with him encircled by ladies. There are reports of Rasputin assaulting ladies. These reports are false in light of the fact that Rasputin truly didn't have to assault the to get them into bed. These exercises didn't struggle with Rasputin's strict convictions. He didn't especially think about the conventional religion. He was an individual from the Khlisti order. Supporters of the Khlisti faction accepted that the entirety of the wants of the man ought to be satisfied, furthermore, man of its individuals held blow-outs to satisfy their requirements. A few people guarantee that Rasputin believed that he essentially got from engaging in sexual relations. There are reports of Rasputin engaging in sexual relations with the tsarina, however the are completely bogus. The Romanovs Rasputin showed up in St. Petersburg in 1905 and he was not welcomed

Friday, August 21, 2020

Scientific Method Applied To Forensic Science Environmental Sciences Essay

Logical Method Applied To Forensic Science Environmental Sciences Essay Measurable science is regularly depicted as a science about examples of wrongdoing components, about assortment of data about the wrongdoing and its members, about guidelines of proof social affair, inquiring about, assessing and applying, and in the long run about those media and strategies dependent on this information fundamental for legal investigation conduction and wrongdoing avoidance (Raton, 2003). It makes it characteristic for this science to utilize explicit criminological techniques, however broad logical strategy tried by time and various parts of normal and physical information too. The term logical technique implies a strategy for look into wherein an issue is distinguished, pertinent information are accumulated, a theory is defined from these information, and the speculation is experimentally tried (Flexner Hauck, 1987). The issue is, numerous researchers neglect to assemble an essential hypothesis of how logical technique is applied to scientific science, while it is critical to separate the manner in which it is applied to this science and the manner in which it is applied to different sciences, as they contrast all things considered. Scientific sciences study the past and not the present, Dr. Thomas Young clarifies (Young, 2009). The principal stage, perception and portrayal is expected to discover and totally reflect what occurred. The action of perception requires effective and purposeful direct view of articles and marvels with the utilization of faculties. It incorporates the investigation of materials and items, structures and surfaces. It is particularly noteworthy during review, search, and other insightful activities. The reason for perception relies upon the character of the item or wonders we look at. Here and there we uncover something; now and again we search for specific attributes, properties and highlights this thing has. In different cases it very well may be the conduct of the suspect, denounced and so on. (Davis, 2005). As indicated by these rules, a few realities uncovered during perception and procedurally fixed can have the essentialness of proof, while others (like the conduct of a respondent during the cross examination) can be only a sort of material to construct variants. Thusly the e rrand is to portray a lot of characterized conditions, to reproduce the image of the wrongdoing or a tort, to reproduce the mind boggling assortment of past conditions as full as could be expected under the circumstances, focusing on timing and request of occasions. The right are the activities planned to uncover and fix the hints of the wrongdoing or tort that change quick and the confirmations which can be effectively lost or changed intentionally. At the point when the master has enough information to perceive what occurred, he figures a theory or a few of them to clarify the perception. This procedure can be likewise called versification we search for adaptations. The gnoseological perspective deciphers form as a type of transmission from ignorance to information about the researched occasion. That is the reason it is characterized as a structure and procedure of reflecting material world wonders and engaging the target idea of a contemplated object by thought itself. The procedure of insight doesnt put outskirts between intelligent, mental and subjective perspectives as they are for the most part the pieces of one procedure of attitude (Shafer, 2008). To have logical force, speculations ought to be hypothetically validated, permit explicit request of confirmation and appropriate strategies to check the variant. Speculation is a main thrust of science improvement; theory is one of the types of science. Aside from the general hypothesis of measurable science, the master ought to apply his own proficient experience. This stage depends on use of various sensible developments as an instrument. It is firmly associated with the following activity, comprising in working up expectations of other wonders or finishing up results. The media and techniques for shaping legal forecasts are planned for down to earth perception of certain social wonders which is a wrongdoing and target comprehending the topic of blame or guiltlessness of the subject. Subsequently they are to compare to the severe rules of unwavering quality, lawfulness, profound quality and worthiness. Each outcome, every result closed from the proposed variant ought to be deliberately confirmed. Until the rendition is refuted and dismissed, every reality legitimately originating from it ought to be checked in the light of its correspondence to the truth. Some part analyzed doesn't give the motivation to accept the rendition as something equitably obvious. On the off chance that the assessment gives negating information, you ought to never stop the tests. All the reasons of uniqueness ought to be discovered. Adulteration is a fundamental constituent of the logical strategy. The theory ought to be preferably either refuted or distorted. In the event that there is a likelihood to refute the speculation, the researcher can dispose of it and go to another, increasingly right theory. On the other hand, if the speculation is affirmed by the experimentation and the accompanying perception, it despite everything doesn't mean this affirmation demonstrates reality of the theory, Thomas Young cases (Young, 2009). Among different techniques, some factual strategies (producing quantitative outcomes) are applied. Despite the fact that they are not well known and, as per the consequences of the overview, just 7% of respondents depend on them. Quantitative techniques dont get wide viable use since they neglect to consider singular highlights, and on the grounds that this frameworks are not built up that well by any means (Shafer, 2008). The last and the significant stage incorporates the use of such logical strategy as analysis. It is normally founded on experimentally led test performed to contemplate the confirmed wonders and its connections with other marvels. The specific component of the investigation is plausibility and need to meddle during the time spent testing, considering the wonders from various sides and in various conditions. Through examination explore is applied in different structures. One of the best strategies avowed by the hypothesis of measurable science is equal (synchronous) testing by a few free experimenters. It implies that different agents are allowed to check and attempt to distort the speculation proposed by the researcher. This methodology gives the most ideal beat of examination and streamlining of working time of the group. It is likewise productive to check up a few forms over. Continuous check takes steps to take additional time and even ruin valuable confirmations, miss the method cutoff time of examination. Significant guideline of assessment comprises in the accompanying: test ought to go on until the form is refuted or until we accomplish the circumstance when we can believe it to be the goal truth. The logical strategy transforms a suspicion on any reality into a solid bit of information when we can demonstrate this is the main actuality to give such outcomes. The speculation additionally transforms into dependable information when it is demonstrated that every conceivable explanation of some reality with the exception of one are precluded. The measurable adaptation is directly under the accompanying conditions: On the off chance that every single imaginable speculation concerning the conditions of the wrongdoing under recognition were considered and no new information bring new forms. For example, if there are three forms of homicide (adamant crime, murder, or a mishap), invalidate of the two renditions aside from the first doesnt demonstrate the headstrong homicide is valid. It can go to be a mix-up and truth nay be in the self destruction variant missed by the examiner. All the adaptations proposed concerning the circumstance were confirmed and every one of them with the exception of the just one dispassionately demonstrated were negated and discarded. All the results (conditions) consistently closed from the demonstrated rendition were completely contemplated and uncovered by affirmation. The rendition affirmed is totally planned with different conditions of the case. Just for the situation all the conditions recorded are watched, the rendition can be conceded as the one comparing to the real world and communicating the goal truth (Flexner Hauck, 1987). In the long run, when the speculation is affirmed more than once through occasions after some time, this theory has all the odds to turn into a hypothesis. At the point when we state a hypothesis, we mean a typical standard utilized by researchers to elucidate wonders and make forecasts of further occasions. With everything taken into account, we have seen the methodical methodology given by the general logical technique when applied to the scientific science. Simultaneously it is important to recall that criminological science itself is regularly characterized as the use of science to law. It's a given, it isn't perfect at all and has its own drawbacks comprising in specific confinements, yet at the same time it has exhibited its supportability in the circle of wrongdoings. The logical technique has demonstrated itself after some time to be a dependable method to show up at genuine, quantifiable, recognizable truth, Dr. Thomas Young declares (Young, 2009).

Business 6 Essay Example | Topics and Well Written Essays - 500 words - 1

Business 6 - Essay Example In this social direction, individuals are progressively self-engaged and will in general put their enthusiasm before those of a gathering. Then again, China rehearses community. This is whereby the group’s interests preceded individuals’ interests. Force direction sorts societies into power regard and force open minded social orders. Force regard social orders regard the levels of leadership and acknowledge power dependent on position in an association or in the general public. Authority isn't normally addressed. This direction is basic in China. Force open minded social orders question authority and don't really purchase what authority says as found in the United States of America. The third classification of Hostede’s order is vulnerability direction, which centers around people’s emotions toward ambiguous or unsure circumstances. This sorts societies into vulnerability acknowledgment and vulnerability shirking. The United States will in general lean more on vulnerability acknowledgment since her societies are undisturbed by change. Chinese social set ups, then again, will in general grasp vulnerability shirking, which displays unbending frameworks dependent on rules (Ajami, Cool, Goddard, and Khambata, 2006). China and the United States are among the main economies on the planet. Be that as it may, the socio-social parts of the two economies extraordinarily vary. Chinese societies will in general keep away from vulnerability, favor power separation and are typically adjusted to long haul women's liberation and cooperation directions (Smith, Dugan, and Trompenaars, 1996). Then again, Americans are all the more transient situated and will in general kindness independence and manliness. They are additionally not troubled by vulnerability and are progressively popularity based (Fu and Yukl, 2000). In such manner, Americans and Chinese appear to vary in practically all parts of their societies. Culture affects business both at household and universal levels. Cateora and Graham (1999) saw that

Monday, July 6, 2020

Architecture of .Net Framework - Free Essay Example

Architecture of the . NET Framework Chapter 1 Architecture of the . NET Framework The . NET Framework development platform introduces many new concepts, technologies, and terms. The goal of this chapter is to give an overview of the . NET Framework: to show how it is architected, to introduce some of the new technologies, and to define many of the new terms. I’ll also take you through the process of building your source code into an application or a set of redistributable components (types), and then explain how these components execute. Compiling Source Code into Managed Modules OK, so you’ve decided to use the . NET Framework as your development platform. Great! Your first step is to determine what type of application or component you intend to build. Let’s just assume that you’ve handled this minor detail, everything is designed, the specifications are written, and you’re ready to start development. Next, you must decide what programming language to use. This is usually a difficult task because different languages offer different capabilities. For example, in unmanaged C/C++, you have pretty low-level control of the system. You can manage memory exactly the way you want to, create threads easily if you need to, and so on. Visual Basic 6, on the other hand, allows you to build UI applications very rapidly and allows the easy control of COM objects and databases. If you use the . NET Framework, your code targets the common language runtime (CLR), which affects your decision about a programming language. The common language runtime is just what its name says it is: A runtime that is usable by different and varied programming languages. The features of the CLR are available to any and all programming languages that target it-period. If the runtime uses exceptions to report errors, then all languages get errors reported via exceptions. If the runtime allows you to create a thread, then any language can create a thread. In fact, at runtime, the CLR has no idea which programming language the developer used for the source code. This means that you should choose whatever programming language allows you to express your intentions most easily. You may develop your code in any programming language you desire as long as the compiler you use to compile your code targets the CLR. So if what I say is true, then what is the advantage of using one programming language over another? Well, I think of compilers as syntax checkers and correct code analyzers. They examine your source code, ensure that whatever you’ve written makes some sense, and then output code that describes your intention. Simply put, different programming languages allow you to develop using different syntax. Don’t underestimate the value of this. For mathematical or financial applications, expressing your intentions using APL syntax can save many days of development time when compared to expressing the same intention using Perl syntax, for example. Microsoft is creating several language compilers that target the runtime: C++ with managed extensions, C# (pronounced â€Å"C sharp†), Visual Basic. NET, JScript, Java, and an intermediate language (IL) Assembler. In addition to Microsoft, there are several other companies creating compilers that produce code that targets the CLR. At this writing, I am aware of compilers for Alice, APL, COBOL, Component Pascal, Eiffel, Fortran, Haskell, Mercury, ML, Mondrian, Oberon, Perl, Python, RPG, Scheme, and Smalltalk. The figure on the next page shows the process of compiling source code files: 1 Applied . NET Framework Programming As the figure shows, you can create source code files using any programming language that supports the CLR. Then, you use the corresponding compiler to check syntax and analyze the source code. Regardless of which compiler you use, the result is a managed module. A managed module is a standard Windows portable executable (PE) file that requires the CLR to execute. In the future, other operating systems may use the PE file format as well. A Managed Module is composed of the following parts: Part PE header Description This is the standard Windows PE file header, which is similar to the Common Object File Format (COFF) header. The PE header indicates the type of fileGUI, CUI, or DLL—and also has a timestamp indicating when the ile was built. For modules that contain only IL code (see below, Intermediate Language Code), the bulk of the information in the PE header is ignored. For modules that contain native CPU code, this header contains information about the native CPU code. This header contains the information (interpreted by the CLR and utilities) that makes this a managed module. It includes the version of the CLR required, some flags, the MethodDef metadata token of the managed module’s entry point method (Main method), and the location/size of the module’s metadata, resources, strong name, some flags, and other less interesting stuff. Every managed module contains metadata tables, of which there are 2 main types: those that describe the types and members defined in your source code, and those that describe the types and members referenced by your source code. CLR header Metadata 2 Architecture of the . NET Framework Part Intermediate Language (IL) Code Description This is the code that was produced by the compiler as it compiled the source code. IL is later compiled by the CLR into native CPU instructions. Most compilers of the past produced code targeted to a specific CPU architecture, such as x86, IA64, Alpha, or PowerPC. All CLR-compliant compilers produce intermediate language (IL) code instead. IL code is sometimes referred to as managed code, because its lifetime and execution are managed by the CLR. IL code is discussed later in this chapter. In addition to emitting IL, every compiler targeting the CLR is required to emit full metadata into every managed module. In brief, metadata is simply a set of data tables that describe what is defined in the module, such as types and their members. In addition, metadata also has tables indicating what the managed module references, such as imported types and their members. Metadata is a superset of older technologies such as type libraries and IDL files. The important thing to note is that CLR metadata is far more complete than its predecessors. And, unlike type libraries and IDL, metadata is always associated with the file that contains the IL code. In fact, the metadata is always embedded in the same EXE/DLL as the code, making it impossible to separate the two. Since the metadata and code are produced by the compiler at the same time and are bound into the resulting managed module, the metadata and the IL code it describes are never out of sync with one another. Metadata has many uses. Here are some of them: †¢ Metadata removes the need for header and library files when compiling, because all the information about the referenced types/members is contained in one file along with the IL that implements those type/members. Compilers can read metadata directly from managed modules. Visual Studio uses metadata to help you write code. Its IntelliSense feature parses metadata to tell you what methods a type offers and what parameters that method expects. The CLR code verification process uses metadata to ensure that your code performs only â€Å"safe† operations. Verification is discussed shortly. Metadata allows an object’s fields to be serialized into a memory block, remoted to another machine, and then deserialized, recreating the object and its state on the remote machine. Metadata allows the garbage collector to track the lifetime of objects. For any object, the garbage collector can determine the type of the object, and from the metadata it knows which fields within that object refer to other objects. †¢ †¢ †¢ †¢ The next chapter, â€Å"Building, Packaging, Deploying, and Administering Applications and Types,† will describe metadata in much more detail. And a little later in this chapter, we’ll explore intermediate language in more detail. Four of the compilers that Microsoft offersC#, Visual Basic, JScript, and the IL Assembleralways produce managed modules, which require the CLR to execute. That is, end users must have the CLR installed on their machines in order to execute any managed modules. This situation is similar to the one that end users face with MFC or VB 6 applications: they must have the MFC or VB DLLs installed in order to run them. The Microsoft C++ compiler, by default, builds unmanaged modules: the EXE or DLL files with which we are all familiar. These modules do not require the CLR in order to execute. However, by specifying a new command-line switch, the C++ compiler can produce managed modules that do require the CLR to execute. Of all the Microsoft compilers mentioned, C++ is unique in that it is the only language that allows the developer to write both managed and 3 Applied . NET Framework Programming unmanaged code and have it emitted into a single managed module. This can be a great feature because it allows developers to write the bulk of their applications in managed code (for type-safety and component interoperability) but continue to access their existing unmanaged C++ code. Combining Managed Modules into Assemblies The CLR doesn’t actually work with modules; it works with assemblies. An assembly is an abstract concept, which can be difficult to grasp at first. First, an assembly is a logical grouping of one or more managed modules or resource files. Second, an assembly is the smallest unit of reuse, security, and versioning. Depending on the choices you make with your compilers or tools, you can produce a single-file assembly or you can produce a multi-file assembly. Chapter 2, â€Å"Building, Packaging, Deploying, and Administering Applications and Types,† discusses assemblies in great detail, so I don’t want to spend a lot of time on it here. All I want to do now is make you aware that there is this extra conceptual notion that offers a way to treat a group of files as a single entity. The figure below should help explain what assemblies are about: In this figure, we are passing the file names of some managed modules and resource (or data) files to a tool. This tool produces a single PE file that represents the logical grouping of files. This PE file contains a block of data called the manifest, which is simply another set of metadata tables. These tables describe the assembly: the files that make it up, the publicly exported types implemented by the files in the assembly, and the resource or data files that are associated with it. By default, compilers actually do the work of turning the emitted managed module into an assembly. That is, the C# compiler emits a managed module that contains a manifest. The manifest indicates that the assembly consists of just the 4 Architecture of the . NET Framework one file. So for projects that have just one managed module and no resource files, the assembly will be the managed module, and you don’t have any additional steps to perform during your build process. If you wish to group a set of files into an assembly, then you will have to be aware of more tools (such as the assembly linker, AL. exe) and their command-line options. These tools and options are explained in the next chapter. An assembly allows you to decouple the logical and physical notions of a reusable, deployable, versionable component. The way in which you partition your code and resources into different files is completely up to you. For example, you could put rarely used types or resources in separate files that are part of an assembly. The separate files could be downloaded from the web as needed. If the files are never needed, theyre never downloaded, saving disk space and reducing installation time. An assembly lets you break up the physical deployment of the files but still treat them as a single collection. The modules in an assembly also include information, including version numbers, about referenced assemblies. This information makes an assembly self-describing. In other words, the CLR knows everything that an assembly needs in order to execute. No additional information is required in the registry or in the Active Directory, so deploying assemblies is much easier than deploying unmanaged components. Loading the Common Language Runtime Each assembly that you build can either be an executable application or a DLL containing a set of types (components) for use by an executable application. Of course, the CLR is responsible for managing the execution of code contained within these assemblies. This means that the . NET Framework must be installed on the host machine. Microsoft has created a redistribution package that you can freely ship to install the . NET Framework on your customers machines. Future versions of Windows will include the . NET Framework, at which point you will no longer need to ship it with your assemblies. You can tell whether the . NET Framework has been installed by looking for the MSCorEE. dll file in the %windir%system32 directory. The existence of this file tells you that the . NET Framework is installed. However, several versions of the . NET Framework may be installed on a single machine simultaneously. If you want to determine exactly which versions of the . NET Framework are installed, examine the subkeys under the following registry key: HKEY_LOCAL_MACHINESOFTWAREMicrosoft. NETFrameworkpolicy. When you build an EXE assembly, the compiler/linker emits some special information into the resulting assemblys PE File header and the files . text section. When the EXE file is invoked, this special information causes the CLR to load and initialize. Then the CLR locates the entry point method for the application and lets the application start executing. Similarly, if an unmanaged application calls LoadLibrary to load a managed assembly, the entry point function for the DLL knows to load the CLR in order to process the code contained within the assembly. For the most part, you do not need to know about or understand how the CLR actually gets loaded. For the curious, however, I will explain how a managed EXE or DLL starts the CLR. If you’re not interested in this, feel free to skip to the next section. The figure on the next page summarizes how a managed EXE loads and initializes the CLR. 5 Applied . NET Framework Programming When the compiler/linker creates an executable assembly, the following 6-byte x86 stub function is emitted into the . text section of the PE file: JMP _CorExeMain The _CorExeMain function is imported from the Microsoft MSCorEE. dll dynamic-link library, and therefore MSCorEE. dll is referenced in the import (. idata) section of the assembly file. (MSCorEE. ll stands for Microsoft Component Object Runtime Execution Engine. ) When the managed EXE file is invoked, Windows treats it just like any normal (unmanaged) EXE file: the Windows loader loads the file and examines the . idata section to see that MSCorEE. dll should be loaded into the process’s address space. Then, the loader obtains the address of the _CorExeMain function inside MSCorEE. dll and fixes up the stub function ’s JMP instruction in the managed EXE file. The primary thread for the process begins executing this x86 stub function, which immediately jumps to _CorExeMain in MSCorEE. ll. _CorExeMain initializes the CLR and then looks at the CLR header for the executable assembly to determine what managed entry point method should execute. The IL code for the method is then compiled into native CPU instructions, after which the CLR jumps to the native code (using the process’s primary thread). At this point, the managed application code is running. The situation is similar for a managed DLL. When building a managed DLL, the compiler/linker emits a similar 6-byte x86 stub function for a DLL assembly in the . text section of the PE file: JMP _CorDllMain Architecture of the . NET Framework The _CorDllMain function is also imported from the MSCorEE. dll, causing the . idata section for the DLL to reference MSCorEE. dll. When Windows loads the DLL, it automatically loads MSCorEE. dll (i f it isn’t already loaded), obtains the address of the _CorDllMain function, and fixes up the 6 byte x86 JMP stub in the managed DLL. The thread that called LoadLibrary to load the managed DLL then jumps to the x86 stub in the managed DLL assembly, which immediately jumps to the _CorDllMain in MSCorEE. dll. CorDllMain initializes the CLR (if it hasn’t already been initialized for the process) and then returns so that the application can continue executing as normal. These 6-byte x86 stub functions are required to run managed assemblies on Windows 98, Windows 98SE, Windows ME, Windows NT 4, and Windows 2000 because all these operating systems shipped long before the CLR became available. Note that the 6-byte stub function is specifically for x86 machines. This stub does not work properly if the CLR is ported to run on other CPU architectures. Because Windows XP and the Windows . NET Servers support both the x86 and the IA64 CPU architectures, the loader for Windows XP and the Windows . NET Servers was modified to look specifically for managed assemblies. On Windows XP and the Windows . NET Servers, when a managed assembly is invoked (typically via CreateProcess or LoadLibrary), the OS loader detects that the file contains managed code. It does this by examining directory entry 14 in the PE file header (see IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR in WinNT. h). If this directory entry exists and is not 0, then the loader ignores the file’s import (. data) section entirely and knows to automatically load MSCorEE. dll into the address space for the process. Once loaded, the OS loader makes the process thread jump directly to the correct function in MSCorEE. dll. The 6-byte x86 stub functions are ignored on machines running Windows XP and the Windows . NET Servers. One last note about managed PE files: Managed PE files always use the 32-bit PE file format; th ey do not use the newer 64-bit PE file format. On 64-bit Windows systems, the OS loader detects the managed 32-bit PE file and automatically knows to create a 64-bit address space. Executing the Code in Your Assembly As mentioned earlier, managed modules contain both metadata and intermediate language (IL) code. IL is a CPUindependent machine language created by Microsoft after consultation with several external commercial and academic language/compiler writers. IL is much higher-level than most CPU machine languages. IL understands object types and has instructions that create and initialize objects, call virtual methods on objects, and manipulate array elements directly. It even has instructions that throw and catch exceptions for error handling. You can think of IL as an objectoriented machine language. Usually, developers prefer to program in a high-level language, such as C# or Visual Basic. NET. The compilers for all these high-level languages produce IL. However, like any other machine language, IL can be written in assembly language and Microsoft does provide an IL assembler, ILAsm. exe. Microsoft also provides an IL disassembler, ILDasm. exe. Some people are concerned that IL does not offer enough intellectual property protection for their algorithms. In other words, you could build a managed odule and someone else could use a tool, like an IL disassembler, to reverse engineer exactly what your application code does. Yes, it’s true that IL code is higher-level than most other assembly languages and, in general, reverse engineering IL code is relatively simple. However, when you implement a web service or web form 7 Applied . NET Framework Programming application, your managed module resides on your server, inacc essible to anyone outside your company. Outsiders cannot use any tool to see the IL code, so your intellectual property is completely safe. If you are concerned about any of your managed modules that you do distribute, then you can use the Microsoft obfuscator utility (OB. exe), which is downloadable from https://www. GotDotNet. com. This utility â€Å"scrambles† the names of all the private symbols in your managed module metadata. It will be difficult for someone to â€Å"unscramble† the names and understand the purpose of each method. Note that the Microsoft obfuscator scrambles metadata names only and does not scramble the IL code in anyway since the CLR must be able to process unscrambled IL. If you don’t feel that the obfuscator offers the kind of intellectual property protection that you desire, then you can consider implementing your more-sensitive algorithms in some unmanaged module, which will contain native CPU instructions instead of IL and metadata. Then, you can use the CLR’s interoperability features to communicate between the managed and unmanaged portions of your application. Of course, this assumes that you’re not worried about people reverse engineering the native CPU instructions in your unmanaged code. Any high-level language will most likely expose only a subset of the facilities offered by the CLR. IL assembly language, however, gives a developer access to all the facilities of the CLR. So if your programming language of choice hides a CLR feature that you really wish to take advantage of, you can write that portion of your code in IL assembly or in another programming language that exposes the CLR feature you seek. The only way for you to know what facilities are offered by the runtime is to read documentation specific to the CLR itself. In this book, I try to concentrate on CLR features and how they are exposed or not exposed by the C# language. I suspect that most other books and articles will present the CLR via a particular language and that most developers will come to believe that the CLR offers only those features that the developers chosen language exposes. As long as your language allows you to accomplish what youre trying to do, this blurred perspective is not a bad thing. Personally, I feel that an ability to switch programming languages easily with rich integration between languages is an awesome feature of the CLR. I also believe that this is a feature that will, unfortunately, often be overlooked by developers. Programming languages like C# and Visual Basic. NET are excellent languages for doing I/O operations. APL is an awesome language for doing advanced engineering or financial calculations. Through the CLR, you can write the I/O portions of your application using C# and then write the engineering calculations using APL. The CLR offers a level of integration between these languages that is unprecedented, and really makes mixed-language programming worthy of consideration for many development projects. An important thing to note about IL is that it is not tied to any specific CPU platform. This means that a managed module containing IL can run on any CPU platform as long as the operating system running on that CPU platform hosts a version of the CLR. Although the initial release of the CLR will run only on 32-bit Windows platforms, developing an application using managed IL sets up a developer to be more independent of the underlying CPU architecture. In October 2000, Microsoft (along with Intel and Hewlett-Packard as co-sponsors) proposed a large subset of the . NET Frameworks to the ECMA (the European Computer Manufacturer’s Association) for the purpose of standardization. The ECMA accepted this proposal and created a technical committee (TC39) to oversee the standardization process. The technical committee is charged with the following duties: 8 Architecture of the . NET Framework †¢ †¢ †¢ Technical Group 1: Develop a dynamic scripting language standard (ECMAScript). Microsoft’s implementation of ECMAScript is JScript. Technical Group 2: Develop a standardized version of the C# programming language. Technical Group 3: Develop a common language infrastructure (CLI) based on a subset of the functionality offered by the . NET Framework’s CLR and class library. Specifically, the CLI defines a file format, a common type system, an extensible metadata system, an intermediate language (IL), and access to the underlying platform (P/Invoke). In addition, the CLI also defines a factorable (to allow for small hardware devices) base class library designed for use by multiple programming languages. Once the standardization is completed, these standards will be contributed to ISO/IEC JTC 1 (Information Technology). At this time, the technical committee will investigate further directions for CLI, C#, and ECMAScript, as well as entertain proposals for any complementary or additional technology. For more information about ECMA, please see https://www. ECMA. ch and https://MSDN. Microsoft. com/Net/ECMA. With the standardization of the CLI, C#, and ECMAScript, Microsoft won’t â€Å"own† any of these technologies. Microsoft will simply be one company of many (hopefully) that are producing implementations of these technologies. Certainly Microsoft hopes that their implementation will be the best in terms of performance and customer-demand-driven features. This is what will help sales of Windows, since the Microsoft â€Å"best of breed† implementation will only run on Windows. However, other companies are free to implement these standards and compete against Microsoft. Of course, IL instructions cannot be executed directly by today’s CPUs (although this may change someday). In order to execute a method, its IL code must first be converted to native CPU instructions. To make this conversion, the CLR provides a JIT (just-in-time) compiler. The figure below shows what happens the first time a method is called. 9 Applied . NET Framework Programming Just before the Main method executes, the CLR detects all the types that are referenced by the code in Main. This causes the CLR to allocate an internal data structure that is used to manage access to each referenced type. In the figure above, the Main method refers to a single type, Console, causing the CLR to allocate a single internal structure. This internal data structure contains an entry for each method defined by the type. Each entry holds the address where the method implementation can be found. When initializing this structure, the CLR sets each entry to a function contained inside the CLR itself. I call this function JITCompiler. When Main makes its first call to WriteLine, the JITCompiler function is called. The JITCompiler function is responsible for compiling a method’s IL code into native CPU instructions. Since the IL is being compiled â€Å"just in time†, this component of the CLR is frequently referred to as a JITter or JIT Compiler. When called, the JITCompiler function knows what method is being called and what type defines this method. The JITCompiler function then searches the defining assembly’s metadata for the called method’s IL. JITCompiler verifies and compiles the IL code into native CPU instructions, which are then saved in a dynamically allocated block of memory. JITCompiler goes back to the type’s internal data structure and replaces the address of the called method with the address of the block of memory containing the native CPU instructions. Finally, JITCompiler jumps to the code in the memory block. This code is the implementation of the WriteLine method (the version that takes a String parameter). When this code returns, execution resumes in Main, as normal. Suppose now that Main calls WriteLine a second time. This time, because the code for WriteLine has already been verified and compiled, the call goes directly to the native code in the memory block, skipping the JITCompiler function entirely. After the WriteLine method executes it returns to Main. The figure below shows what the situation looks like when WriteLine is called the second time: 10 Architecture of the . NET Framework The important thing to note is that the process incurs a performance hit only the first time a method is called. All subsequent calls to the method execute at the full speed of the native code: Verification and compilation to native code is not performed again. Note that the JIT compiler stores the native CPU instructions in dynamic memory: The compiled code is discarded when the application terminates. So if you run the application in the future or if you run two instances of the application simultaneously (in two different operating system processes), then the JIT compiler will have to compile the IL to native instructions again. For most applications, the performance hit incurred by JIT compilation is not significant. Most applications tend to call the same methods over and over again, so these methods will take the performance hit only once while the application executes. Also, a process normally spends more time inside the method than it spends calling the method. Be aware that the JIT compiler optimizes the native code just like the back end of an unmanaged C++ compiler. Again, the optimization may take time, but the code will execute with much better performance than unoptimized code. Developers coming from an unmanaged C or C++ background are probably thinking about the performance ramifications of all this. After all, unmanaged code is compiled for a specific CPU platform, and when invoked, the code can simply execute. In this managed environment, compiling the code is accomplished in two phases. First, the compiler passes over our source code, doing as much work as possible in producing IL. But then, in order to actually execute the code, the IL itself must be compiled into native CPU instructions at run time, requiring that more memory be allocated, and requiring addition CPU time to do the work. Believe me, I approached the CLR from a C/C++ background myself, so I was quite skeptical and concerned about this additional overhead. The truth is that this second compilation stage that occurs at runtime does hurt performance and it does allocate dynamic memory. However, Microsoft has done a lot of performance work to keep this additional overhead to a minimum. 11 Applied . NET Framework Programming If you too are skeptical, then you should certainly build some applications to test the performance for yourself. In addition, you should run some non-trivial managed applications produced by Microsoft or others and measure their performance. I think youll be surprised at how good the performance actually is. In fact, hard as this might be to believe, many people (including me) think that managed applications could actually out-perform unmanaged applications. For example, when the JIT compiler compiles the IL code into native code at runtime, the compiler knows more about the execution environment than an unmanaged compiler would know. Here are some ways that managed code could out-perform unmanaged code: †¢ A JIT compiler could detect that the application is running on a Pentium 4 and produce native code that takes advantage of any special instructions offered by the Pentium 4. Usually, unmanaged applications are compiled for the lowest common denominator CPU and avoid using special instructions that would give the application a performance boost on newer CPUs. A JIT compiler could detect that a certain test is always false on the current host machine. For example, a method with code like this: if (numberOfCPUs ; 1) { } †¢ could cause the JIT compiler to not generate any CPU instructions for the above code if the host machine has only 1 CPU. In this case, the native code has been fine-tuned for the host machine: the code is smaller and executes faster. †¢ The CLR could profile the code execution and recompile the IL into native code while the application runs. The recompiled code could be reorganized to reduce incorrect branch predictions depending on the observed execution patterns. For these and many other reasons, you should expect future accomplishments with managed code to execute better than todays unmanaged code. As I said, the performance today is quite good for most applications, and it promises to improve as time goes on. If your experiments show that the CLRs JIT compiler does not offer your application the kind of performance it requires, then you might want to take advantage of the NGen. exe tool that ships with the . NET Framework SDK. This tool compiles all the IL code for an assembly into native code and saves the resulting native code to a file on disk. At runtime, when an assembly is loaded, the CLR automatically checks to see whether a precompiled version of the assembly also exists, and if it does, the CLR loads the precompiled code so that no compilation at runtime is required. IL and Verification IL is stack-based, which means that all its instructions push operands onto an execution stack and pop results off the stack. Accordingly, IL offers no instructions to manipulate registers. Compiler developers can easily produce IL code: They dont have to think about managing registers, and there are fewer IL instructions (since none exist for manipulating registers). And here’s another simplification: IL instructions are typeless. For example, IL offers an add instruction that adds the last two operands pushed on the stack. IL does not offer a 32-bit add instruction and a 64-bit add instruction. When the add instruction executes, it determines the types of the operands on the stack and performs the appropriate operation. 12 Architecture of the . NET Framework In my opinion, the biggest benefit of IL is not that it abstracts away the underlying CPU. The biggest benefit is application robustness. While compiling IL into native CPU instructions, the CLR performs a process called verification. Verification examines the high-level IL code and ensures that everything it does is â€Å"safe. † For example, verification checks that no memory is read from without having previously been written to, that every method is called with the correct number of parameters, that each parameter is of the correct type, that every method’s return value is used properly, that every method has a return statement, and so on. The metadata for each managed module includes all the method and type information used by the verification process. If the IL code is determined to be â€Å"unsafe,† then a System. Security. VerifierException exception is thrown, preventing the method from executing. By default, Microsoft’s C# and Visual Basic. NET compilers produce â€Å"safe† code. Safe code is code that is verifiably safe. However, using C#’s unsafe keyword or using other languages (such as C++ with Managed Extensions or IL Assembly language), you can produce code that cannot be verifiably safe. That is, the code might, in fact, be safe, but the verification is unable to prove it. To ensure that all methods in your managed module contain verifiably safe IL, you can use the PEVerify. exe utility that ships with the . NET Framework SDK. When Microsoft developers test their C# and Visual Basic. NET compilers, they run the resulting module through PEVerify to ensure that the compiler always produces verifiably safe code. If PEVerify detects unsafe code, then Microsoft fixes the compiler. You may want to consider running PEVerify on your own modules before you package and ship them. If PEVerify detects a problem, then there is a bug in the compiler and you should report this to Microsoft (or whatever company produces the compiler youre using). If PEVerify doesnt detect any unverifiable code, then you know that your code will run without throwing a users machine. Note that an administrator can elect to turn verification off (using the . NET Management Microsoft Management Console Snap-In). With verification off, the JIT compiler will compile unverifiable IL into native CPU instructions; however, the administrator is taking full responsibility for the codes behavior. VerifierException on the end- In Windows, each process has its own virtual address space. Separate address spaces are necessary because Windows can’t trust the application code. It is entirely possible (and unfortunately, all too common) that an application will read from or write to an invalid memory address. Placing each Windows process in a separate address space enhances robustness: One process cannot adversely affect another process. However, by verifying the managed code, we know that the code does not improperly access memory and cannot adversely affect another application’s code. This means that we can run multiple managed applications in a single Windows virtual address space. Because Windows processes require a lot of operating system resources, launching many processes can hurt performance and limit available OS resources. Running multiple applications in a single OS process reduces the number of processes, which can improve performance, require fewer resources, and offer equivalent robustness. This is another benefit of managed code as compared to unmanaged code. The CLR does, in fact, offer the ability to execute multiple managed applications in a single OS process. Each managed application is called an AppDomain. By default, every managed EXE will run in its own separate address space that has 13 Applied . NET Framework Programming just the one AppDomain. However, a process hosting the CLR (such as IIS or a future version of SQL Server) can decide to run AppDomains in a single OS process. The . NET Framework Class Library Included with the . NET Framework is a set of Framework Class Library (FCL) assemblies that contains several thousand type definitions, where each type exposes some functionality. All in all, the CLR and the FCL allow developers to build the following kinds of applications: †¢ †¢ †¢ Web Services. Components that can be accessed over the Internet very easily. Web services are, of course, the main thrust of Microsofts . NET initiative. Web Forms. HTML-based applications (web sites). Typically, web form applications make database queries and web service calls, combine and filter the returned information, and then present that information in a browser using a rich HTML-based UI. Web forms provide a Visual Basic 6- and InterDevlike development environment for web applications written in any CLR language. Windows Forms. Rich Windows GUI applications. Instead of using a web form to create your applications UI, you can use the more powerful, higher-performance functionality offered by the Windows desktop. Windows form applications can take advantage of controls, menus, mouse and keyboard events, and can talk directly to the underlying operating system. Like web form applications, Windows form applications make database queries and call web services. Windows Forms provides a Visual Basic 6-like development environment for GUI applications written in any CLR language. Windows Console Applications. For applications with very simple UI demands, a console application provides a quick and easy solution. Compilers, utilities, and tools are typically implemented as console applications. Windows Services. Yes, it is possible to build service applications controllable via the Windows Service Control Manager (SCM) using the . NET Framework. Component Library. Of course, the . NET Framework allows you to build stand-alone components (types) that may be easily incorporated into any of the above mentioned application types. †¢ †¢ †¢ Since the FCL contains literally thousands of types, a set of related types is presented to the developer within a single namespace. For example, the System namespace (which you should become most familiar with) contains the Object base type, from which all other types ultimately derive. In addition, the System namespace contains types for integers, characters, strings, exception handling, and console I/O, as well as a bunch of utility types that convert safely between data types, format data types, generate random numbers, and perform various math functions. All applications use types from the System namespace. To access any platform feature, you need to know which namespace contains the types that expose the facility youre after. If you want to customize the behavior of any type, you can simply derive your own type from the desired FCL type. The . NET Framework relies on the object-oriented nature of the platform to present a consistent programming paradigm to software developers. It also enables developers to create their own namespaces containing their own types, which merge seamlessly into the programming paradigm. Compared to Win32 programming paradigms, this greatly simplifies software development. Most of the namespaces in the FCL present types that you can use for any kind of application. The table below lists some of the more general namespaces, with a brief description of what the types in that namespace are used for: 14 Architecture of the . NET Framework Namespace System System. Collections Purpose of Types All the basic types used by every application. Managing collections of objects. Includes the popular collection types such as Stacks, Queues, Hashtables, and so on. System. Diagnostics Instrumenting and debugging your application. System. Drawing Manipulating 2D graphics. Typically used for Windows Forms applications and for creating images that are to appear in a web form. System. EnterpriseServices Managing transactions, queued components, object pooling, just-in-time activation, security, and other features to make the use of managed code more efficient on the server. System. Globalization National Language Support (NLS), such as string compares, formatting, and calendars. System. IO Doing stream I/O, walking directories and files. System. Management Managing other computers in the enterprise via WMI. System. Net Network communications. System. Reflection Inspecting metadata and late binding to types and their members. System. Resources Manipulating external data resources. System. Runtime. InteropServices Enabling managed code to access unmanaged OS platform facilities, such as COM components and functions in Win32 DLLs. System. Runtime. Remoting Accessing types remotely. System. Runtime. Serialization Enabling instances of objects to be persisted and regenerated from a stream. System. Security Protecting data and resources. System. Text Working with text in different encodings, like ASCII or Unicode. System. Threading Performing asynchronous operations and synchronizing access to resources. System. Xml Processing XML schemas and data. This book is about the CLR and about the general types that interact closely with the CLR (which would include most of the namespaces listed above). This means that the content of this book is applicable to all . NET Framework programmers regardless of the type of application theyre building. You should be aware, however, that in addition to supplying the more general namespaces, the FCL offers namespaces whose types are used for building specific application types. The table below lists some of the application-specific namespaces: Namespace System. Web. Services System. Web. UI System. Windows. Forms System. ServiceProcess Purpose of Types Building web services. Building web forms. Building Windows GUI applications. Building a Windows service controllable by the Service Control Manager. I expect many good books will be published that explain how to build specific application types (such as Windows services, web forms, or Windows forms). These books will give you an excellent start at building your application. I tend to think of these application-specific books as helping you learn from the top down because they concentrate on the application type and not on the development platform. It is my intent that this book offer information that will help you learn from the bottom up. The two types of books should complement each other: After reading this book and an 15 Applied . NET Framework Programming application-specific book, you should be able to easily and proficiently build any kind of . NET Framework application you desire. The Common Type System By now, it should be obvious to you that the CLR is all about types. Types expose functionality to your applications and components. Types are the mechanism by which code written in one programming language can talk to code written in a different programming language. Because types are at the root of the CLR, Microsoft created a formal specification – the common type system (CTS)—that describes how types are defined and behave. The CTS specification states that a type may contain zero or more members. In Chapter 7, â€Å"Type Member Accessibility,† Ill discuss all these members in great detail. For now, I just want to give you a brief introduction to them: †¢ †¢ Field. A data variable that is part of the object’s state. Fields are identified by their name and type. Method. A function that performs an operation on the object, often changing the object’s state. Methods have a name, signature, and modifiers. The signature specifies the calling convention, number of parameters (and their sequence), the types of the parameters, and the type of value returned by the method. Property. To the caller, this member looks like a field. But to the type implementer, this member looks like a method (or two). Properties allow an implementer to validate input parameters and object state before accessing the value and to calculate a value only when necessary; they also allow a user of the type to have simplified syntax. Finally, properties also allow you to create read-only or write-only â€Å"fields. † Event. A notification mechanism between an object and other interested objects. For example, a button could offer an event that notifies other objects when the button is clicked. †¢ †¢ The CTS also specifies the rules for type visibility and for access to the members of a type. For example, marking a type as public exports the type, making it visible and accessible to any assembly. On the other hand, marking a type as assembly (called internal in C#) makes the type visible and accessible to code within the same assembly only. Thus, the CTS establishes the rules by which assemblies form a boundary of visibility for a type, and the runtime enforces the visibility rules. Regardless of whether a type is visible to a caller, the type gets to control whether the caller has access to its members. The following list shows the valid options for controlling access to a method or field: †¢ †¢ †¢ †¢ †¢ Private. Callable only by other methods in the same class type. Family. Callable by derived types, regardless of whether they are within the same assembly. Note that many languages (like C++ and C#) refer to family as protected. Family and Assembly. Callable by derived types, but only if the derived type is defined in the same assembly. Assembly. Callable by any code in the same assembly. Note that many languages refer to assembly as internal. Family or Assembly. Callable by derived types in any assembly and by any types in the same assembly. Note that C# refers to family or assembly as protected internal. 6 Architecture of the . NET Framework †¢ Public. Callable by any code in any assembly. In addition, the CTS defines the rules governing type inheritance, virtual functions, object lifetime, and so on. These rules have been designed to accommodate the semantics expressible in modern programming languages. In fact, you won’t even need to learn the CTS rules, per se, becau se the language you use exposes its own language syntax and type rules in the same way you are familiar with today; it maps the language-specific syntax into the language of the CLR when it emits the managed module. When I first started working with the CLR, I soon realized that it is best to think of the language and the behavior of your code as two separate and distinct things. Using C++, you can define your own types with their own members. Of course, you could have used C# or Visual Basic. NET to define the same type with the same members. Sure, the syntax you use for defining this type is different depending on the language you choose, but the behavior of the type will be absolutely identical regardless of the language because the CLR—by means of the CTS—defines the behavior of the type. To help make this clear, let me give you an example: The CTS supports single inheritance only. The C++ language supports types that inherit from multiple base types; nevertheless, the CTS cannot accept and operate on any such type. To help you, the Visual C++ compiler reports an error if it detects that you’re attempting to create managed code that includes a type inherited from multiple base types. Here’s another CTS rule: All types must (ultimately) inherit from a predefined type, System. Object. As you can see, Object is the name of a type defined in the System namespace. This Object is the root of all other types and therefore guarantees every type instance has a minimum set of behaviors. Specifically, the System. Object type allows you to: †¢ †¢ †¢ †¢ †¢ compare two instances for equality obtain a hash code for the instance query the true type of an instance perform a shallow (bitwise) copy of the instance obtain a string representation of the instances object’s current state The Common Language Specification COM allows objects created in different languages to communicate with one another. The CLR goes further. It integrates all languages to let objects created in one language be treated as equal citizens by code written in a completely different language. To make this possible, the CLR defines a standard behavior for types, embeds self-describing type information (metadata), and provides a common execution environment. Language integration is a fantastic goal, of course, but the truth of the matter is that programming languages are very different from one another. For example, some languages lack features commonly used in other languages: †¢ †¢ †¢ †¢ ase-sensitivity unsigned integers operator overloading methods that support a variable number of parameters 17 Applied . NET Framework Programming If you intend to create types that are easily accessible from other programming languages, then it is important that you use only features of your programming language that are guaranteed to be available in all other languages. To help you with this, Microsoft has defined a commo n language specification (CLS) that details for compiler vendors the minimum set of features that their compilers must support if they are to target the runtime. Note that the CLR/CTS supports a lot more features than the subset defined by the common language specification, so if you don’t care about language interoperability, you can develop very rich types limited only by the capabilities of the language. Specifically, the CTS defines rules to which externally visible types and methods must adhere if they are to be accessible from any CLR-compliant programming language. Note that the CLS rules do not apply to code that is only accessible within the defining assembly. The figure below summarizes the way in which language features overlap with the CLS, within the wider context of the CLR/CTS. As this figure shows, the CLR/CTS offers a broadly inclusive set of features. Some languages expose a large subset of the CLR/CTS; in fact, A programmer willing to write in IL assembly language is able to use all the features offered by the CLR/CTS. Most other languages—such as C#, VB, and Fortran—expose a subset of the CLR/CTS features to the programmer. The CLS defines a minimum set of features that all languages must support. If you are designing a type in one language and you expect that type to be used by another language, then you should not take advantage of any features that are outside of the CLS. Doing so means that your type members might not be accessible by programmers writing code in other programming languages. In the code below, a CLS-compliant type is being defined in C#. However, the type has a few non-CLS-compliant constructs that cause the C# compiler to complain about the code: using System; // Tell compiler to check for CLS Compliance [assembly:CLSCompliant(true)] // Errors appear because the class is public public class App { // Error: Return type of App. Abc() is not CLS-compliant 18 Architecture of the . NET Framework public UInt32 Abc() { return 0; } / Error: Identifier App. abc() differing // only in case is not CLS-compliant public void abc() { } // No error: Method is private private UInt32 ABC() { return 0; } } In the code above, the [assembly:CLSCompliant(true)] attribute is applied to the assembly. This attribute tells the compiler to ensure that any publicly exposed type has no construct that would prevent the type from being accessed from any other pro gramming language. When the code above is compiled, the C# compiler emits two errors. The first error is reported because the method Abc returns an unsigned integer; Visual Basic. NET and some other languages cannot manipulate unsigned integer values. The second error arises because this type exposes two public methods which differ only by case: Abc and abc. Visual Basic. NET and some other languages cannot call both of these methods. Note that if you were to delete public from in front of class App and recompile, both errors would go away. The reason is that the App type would default to internal and would therefore no longer be exposed outside the assembly. For a complete list of CLS rules, refer to the Cross-Language Interoperability section in the . NET Framework SDK documentation. Let me distill the CLS rules to something very simple. In the CLR, every member of a type is either a field (data) or a method (behavior). This means that every programming language must be able to access fields and call methods. Certain fields and certain methods are used in special and common ways. To make coding these common programming patterns easier, languages typically offer additional abstractions. For example, languages expose concepts such as enums, arrays, properties, indexers, delegates, events, constructors, destructors, operator overloads, and conversion operators. When compilers come across any of these constructs in your source code, the compiler must translate them into fields and methods so that the CLR (and any other programming language) can access the construct. Consider the following type definition that contains a constructor, a destructor, some overloaded operators, a property, an indexer, and an event. Note that additional code is introduced to make the code compile; the code does not illustrate the correct way to implement a type. sing System; class Test { // Constructor public Test() {} // Destructor ~Test() {} // Operator overload public static Boolean operator == (Test t1, Test t2) { return true; } public static Boolean operator ! = (Test t1, Test t2) { return false; } 19 Applied . NET Framework Programming // An operator overload public static Test operator + (Test t1, Test t2) { return null; } // A Property public String AProperty { get { return null; } set { } } // An Indexer public String this[Int32 x] { get { return null; } set { } } // An Event event EventHandler AnEvent; } When the compiler compiles this code, the result is a type that has a number of fields and methods defined in it. You can easily see this using the IL disassembler tool (ILDasm. exe) provided with the . NET Framework SDK to examine the resulting managed module: The table on the next page shows how the programming language constructs got mapped to the equivalent CLR fields and methods: 20 Architecture of the . NET Framework Type Member AnEvent . ctor Finalize add_AnEvent get_AProperty get_Item op_Addition op_Equality op_Inequality remove_AnEvent set_AProperty set_Item Member Type Field Method Method Method Method Method Method Method Method Method Method Method Equivalent Programming Language Construct Event. The name of the field is AnEvent and its type is System. EventHandler Constructor Destructor Event add accessor method Property get accessor method Indexer get accessor method + operator == operator ! = operator Event remove accessor method Property set accessor method Indexer set accessor method The additional nodes under the Test type that are not mentioned in the table above—. lass, . custom, AnEvent, AProperty, and Item—identify additional metadata about the type. These nodes do not map to fields or methods; they just offer some additional information about the type that the CLR, programming languages, or tools can get access to. For example, a tool can see that the Test type offers an event, called AnEvent, which is exposed via the two methods (add_AnEvent and remove_AnEvent). Interoperability with Unmanaged Code The . NET Framework offers a ton of advantages over other development platforms. However, very few companies can afford to redesign and re-implement all their existing code. Microsoft realizes this and has built the CLR so that it offers mechanisms that allow an application to consist of both managed and unmanaged parts. Specifically, the CLR supports three interoperability scenarios: †¢ Managed code can call an unmanaged function in a DLL. Managed code can easily call functions contained in DLLs using a mechanism called P/Invoke (for Platform Invoke). After all, many of the types defined in the FCL internally call functions exported from Kernel32. dll, User32. ll, and so on. Many programming languages will expose a mechanism that makes it easy for managed code to call out to unmanaged functions contained in DLLs. Example: A C# or VB application can call the CreateSemaphore function exported from Kernel32. dll. Managed code can use an existing COM component (server). Many companies have already implemented a number of unmanaged COM components. Using the type library from these components, a managed assembly can be created that describes the COM component. Managed code can access the type in the managed assembly just like any other managed type. See the TlbImp. exe tool that ships with the . NET Framework SDK for more information. If you do not have a type library or you want to have more control over what TlbImp. exe produces, you can manually build a type in source code that the CLR can use for doing the proper interop. Example: Using DirectX COM components from a C# or VB application. †¢ 21 Applied . NET Framework Programming †¢ Unmanaged code can use a managed type (server). A lot of existing unmanaged code requires that you supply a COM component for the code to work correctly. You can implement these components easily using managed code, avoiding all the code that has to do with reference counting and interfaces. See the TlbExp. exe and RegAsm. exe tools that ship with the . NET Framework SDK for more information. Example: Creating an ActiveX control or a shell extension in C# or VB. In addition to the above, the Microsoft Visual C++ compiler (version 13) supports a new /clr command-line switch. This switch tells the compiler to emit IL code instead of native x86 instructions. If you have a large amount of existing C++ code, you can recompile the code using this new compiler switch. The new code will require the CLR to execute, and you can modify the code over time to take advantage of the CLR-specific features. Note that the /clr switch cannot compile to IL any method that does one of the following: †¢ †¢ †¢ †¢ contains inline assembly language (via the __asm keyword), accepts a variable number of arguments, calls setjmp, contains intrinsic routines (such as __enable, __disable, _ReturnAddress, and _AddressOfReturnAddress). For a complete list of the constructs that the C++ compiler cannot compile into IL, see the documentation for the Visual C++ compiler. When the compiler can’t compile the method into IL, it compiles the method into x86 so that the application still runs. Note further that although the IL code produced is managed, the data is not managed. That is, data objects are not allocated from the managed heap, and they are not garbage collected. In fact, the data types do not have metadata produced for them and the type method names are mangled. The C code below calls the standard C runtime library printf function and also calls the WriteLine method in System. Console. Note that the System. Console type is defined in the Framework Class Library. Accordingly, C/C++ code can use libraries available to C/C++ as well as managed types. #include #using using namespace System; // For printf // For managed types defined in this assembly // Easily access System namespace types // Implement a normal C/C++ main function void main () { // Call the C-Runtime librarys printf function printf(Displayed by printf. ); // Call System. Consoles WriteLine method Console::WriteLine(Displayed by Console::WriteLine. ); } Compiling this code couldnt be easier. If the code above were placed in a Test. cpp file, youd compile it by executing the following line at the command prompt: cl /clr Test. cpp 22 Architecture of the . NET Framework The result is a Test. exe assembly file. If you run Test. exe, youll see the following output: C:;Test Displayed by printf. Displayed by Console::WriteLine. If you use ILDasm to examine this file, you’ll see the following: Here, ILDasm shows all the global functions and global fields defined within the assembly. Obviously, the compiler has generated a lot of stuff automatically. If you double-click the Main method, ILDasm will show you the IL code: . method public static int32 modopt([mscorlib]System. Runtime. CompilerServices. CallConvCdecl) main() cil managed { . vtentry 1 : 1 // Code size 28 (0x1c) . maxstack 1 IL_0000: ldsflda valuetype $ArrayType$0x0faed885 ? A0x44d29f64. unnamed-global-0 IL_0005: call vararg int32 modopt([mscorlib]System. Runtime. CompilerServices. CallConvCdecl) printf(int8 modopt([Microsoft. VisualC]Microsoft. VisualC. NoSignSpecifiedModifier) modopt([Microsoft. VisualC]Microsoft. VisualC. IsConstModifier)*) IL_000a: pop IL_000b: ldsflda valuetype $ArrayType$0x0e6cb2b2 ? A0x44d29f64. unnamed-global-1 IL_0010: newobj instance void [mscorlib]System. String::. ctor(int8*) IL_0015: call void [mscorlib]System. Console::WriteLine(string) IL_001a: ldc. i4. 0 23 Applied . NET Framework Programming IL_001b: ret } // end of method Global Functions::main What we see here isn’t pretty because the compiler generates a lot of special code to make all this work. You can see, however, that the IL above makes calls to both printf and the WriteLine method in Console. 24 Architecture of the . NET Framework 25

Wednesday, July 1, 2020

How to Demonstrate Interest in Your Prospective Colleges

How to Demonstrate Interest in Your Prospective Colleges At their core, college admissions officers have a good deal in common with 7th graders. While they may not share the same hygiene issues, burgeoning rebellious spirit, or general awkwardness, thirteen-year-old’s minds are often dominated by one critical question—the same exact question that keeps college admissions officers up at night—do they like me, or do they â€Å"like me† like me?Admissions officers are under enormous pressure to meet their enrollment goals by May 1st of each year. Shockingly, in 2019, admissions directors at 72% of schools surveyed were either concerned or very concerned about meeting there yearly enrollment target; only 8% had zero concerns in this area. The best way to meet enrollment is to have a high yield rate, which refers to the percentage of admitted applicants that go on to enroll in the institution. The best way to have a high yield rate is to admit students whom you suspect are highly-motivated to actually enroll at your college over all of their other prospective schools. The measure that admissions officers use to hone in on candidates who are likely to enroll is something called demonstrated interest.The evidence that â€Å"demonstrated interest† matters According to the most recent National Association of College Admission Counseling (NACAC) survey, 16% of colleges and universities consider demonstrated interest as having â€Å"considerable importance† in the admissions process; another 21% of institutions rated it as being of â€Å"moderate importance.† Add these two groups together and the percentage of schools who strongly value a little attention from applicants is 37%, a comparable total to colleges reporting an importance on placing on AP or SAT Subject Test scores, the college interview, class rank, or even extracurricular activities.How can I demonstrate interest to colleges?Hopefully we’ve convinced you that this whole â€Å"demonstrated interest† thin g is worth your time. Now, comes the answer to the question: How exactly do I go about convincing a college that I â€Å"like them† like them? Below, we highlight five simple ways to show your prospective colleges some much-desired affection, starting with the least labor-intensive and progressing from there.1.  Complete an online information request formJust about every college in the world features a page on its admission website where prospective students can request general information, subscribe to the college’s newsletter, and/or indicate academic programs/activities that are especially appealing. They’ll likely send you piles of printed materials through snail mail which, whether you carefully peruse or toss directly into the recycle bin, will serve the purpose of communicating interest.You can complete this short task by visiting the admissions website for each of your prospective colleges or by Googling the colleges name and the terms request informat ion or join mailing list. Check out these examples below:Amherst College Request InformationGeorgia Institute of Technology Request InformationPomona College Request Information2.  Connect on Social MediaThe majority of schools offer applicants the chance to create an online admissions profile where they can submit and track their online application, schedule a campus tour, and interact with college staff via Facebook, Twitter, Instagram, YouTube and other social media. Believe it or not, according to a recent NACAC survey on social media use in college admissions, 60% of applicants report liking or following a school on at least one of platforms listed above. Thus, clicking the like button won’t singlehandedly separate you from the pack, but it will succeed in â€Å"checking a box† when admissions committees ultimately sit down to review your application.3. Email your admissions counselorColleges typically have admissions officers assigned to recruit and evaluate applicants from specific regions of the country/state. Finding the correct counselor for your home state or county should be easy to locate on the school’s admissions website.Once you find your counselor, send a brief email introducing yourself and describing your interests in the institution. An introductory email also presents a great opportunity to ask questions related to the admissions process or a particular academic program. It is also an ideal time to show that you’ve done your research on their school by asking targeted questions about unique aspects of their campus or academic programs. Avoid asking things that can easily be found online like, â€Å"What are the average SAT scores for admitted applicants?†4.  Attend admissions events in your areaIf an admissions representative from a prospective college visits your high school or another nearby location for an information session or college fair, make it a point to be there, and be sure to introduce yourself.  If you are interested enough in a school to apply, you should definitely be interested enough to meet a rep who has traveled (sometimes across the country) right into your backyard. Afterward, send a brief email thanking them for their time and expressing the enthusiasm you feel for applying to their school. Again, nothing earth-shattering—just another small step in demonstrating that you are serious about their school.5.  Visit campusAnyone can click on a website but only the truly interested will make the effort to travel. A campus visit is viewed by admissions committees as one of the strongest indicators of interest. Of course, there is inequity at play here, as not everyone can afford to take off work and trek all over the country visiting schools with their children. Fortunately, many colleges now offer subsidized campus visits for lower-income students.However you get to campus, while there, make every effort to schedule an interview or informal meeting with your admissions counselor. Connecting in-person with an admissions officer provides you the opportunity to show your counselor that you are more than just your grades and test scores and of course gets you brownie points when they calculate your so-called interest quotient.6.  Spend time on your â€Å"Why this college?† essayOur previous five tips can all be executed before actually applying, but this one involves demonstrating interest during the process itself. Many schools, even those who accept the Common or Coalition App, require applicants to complete supplementary materials which typically involve composing an essay about why their school appeals to you. Take this invitation very seriously as it is a way to show an admissions committee that you’ve done your homework on their school and are genuinely excited about enrolling. For more tips on mastering the â€Å"Why this college?† essay, check out our previous blog on the subject.7.  Apply earlyIt goes without saying that this is the most extreme and, if you are applying early decision, irrevocable, way that you can demonstrate interest. To go back to our 7th grade love example, it’s the equivalent of skipping the â€Å"I like you† phase and going right into publicly declaring your undying love. Of course, colleges like ED applicants because they can count on them as automatic members of their freshman class. If you are considering applying ED, first revisit our blog on the subject and check out our Dataverse page which shows EA/ED admissions rates at almost 100 top schools.Key TakeawaysColleges want to know that you genuinely want themIf you convince a school that you are likely to enroll it can be an advantage in the admissions processConnect with your school through social media and fill out an online form requesting more infoMake a personal contact with the admissions officer for your regionAttend a formal admissions event on campus and/or locally, if avail ableDemonstrating interest doesn’t involve a significant investment of time or money on your part—however, the return on this minimal investment will be high.Use the â€Å"Why this College?† essay as an opportunity to write a love letter to a prospective schoolCarefully consider the ultimate act of demonstrating interest—applying early decisionCheck out our YouTube video below to learn more!

Tuesday, May 19, 2020

Symbolism and Reflectionism that are used throughout ‘To Kill a Mockingbird’ - Free Essay Example

Sample details Pages: 3 Words: 948 Downloads: 8 Date added: 2019/02/20 Category Literature Essay Level High school Topics: To Kill a Mockingbird Essay Did you like this example? As well as the ideas regarding the quote to which it is named, there are many other examples of symbolism and reflectionism that are used throughout ‘To Kill a Mockingbird’. A primary example of this reflects around the alleged ‘crime’ and trial of ‘Tom Robinson’, a young and powerful field hand working under ‘Link Deas’. Early in the novel, we learn that he has been accused of raping a young white women, ‘Mayella Ewell†. Don’t waste time! Our writers will create an original "Symbolism and Reflectionism that are used throughout ‘To Kill a Mockingbird’" essay for you Create order The details are unclear throughout the early stages, as we must follow ‘Jean-Louise â€Å"Scout† Finch’s understanding of the events and, as a young child, she struggles understanding the alleged idea of rape and torture, naturally predisposed to follow her fathers guidance; Atticus Finch is the defense attorney representing Tom Robinson in Maycomb court lawhouse. Eventually, the reader discovers why the details have been so unknown and ‘clouded’ throughout the novel, and that is because they essentially don’t exist. When Scout, her brother ‘Jem’ and a childhood friend ‘Dill’ manage to enter the courthouse on prosecution day, they and many ‘Maycombians’ discover the truth, no matter how they may ignore it. Upon discussing the details of the trial with several witnesses, including ‘Robert Ewell’, Mayella’s father, and Mayella herself, it is clear that Tom Robinson did not commit this cri me. Bob and Mayella’s testimonies are confused, details are ‘released’ and ignored between them and a clear reasonable doubt hangs heavily on the courtroom. In addition, Tom Robinson could not have inflicted the injuries, as he has a crippled left arm. Eventually Tom has to explain what really happened, and upon being asked why he ran from the ‘Ewell’ property after Robert discovered Mayella trying to seduce him, he said this; â€Å"If you were a ni**er like me, you’d run too†(261). All of these items show the reader that Tom Robinson is the symbolic representation of racism and slavery in the South during the 1930’s. As a young man, Tom just barely missed being involved in slavery, yet he still feels the weight of its connotations and the racism upon him in every moment. His arm being crippled by a cotton gin as a child; this represents that the scars of slavery and racism will never truly heal. It also is an example of how he is powerless, particularly against ‘white America’. He is a valiant worker and has a growing family but being disabled and black means that ‘his time will come’. Although there are people who support and agree with him, like the Finches, Link Deas and the surrounding black community, they can never outweigh the injustice that has always faced him. He represents the lowest of American society, despite being one of the strongest, most respectful and hard working members of it. In the end, when he tries to es cape and scale the fence of his prison, he is killed brutally, showing that society will never truly let go of racism and prejudice, and it can never be escaped. In addition, the fact that he would have made it if he had had two working arms shows that people like him in the South were doomed from the beginning, and that no amount of hard work and purity can shine above the oppression they face in society. Another example of symbolism in the novel, is through the character of the Finch childrens best friend, ‘Dill Harris Baker’. In chapter one and two, we are introduced to Dill just as the Scout and Jem would be, with childish interest, confusion and intrigue. We grow to know Dill as time comes to pass, and he becomes an essential member of life to both of the Finch’s. Despite his mysterious origins and small, weak stature; in the first several chapters, when Jean Louise and Jem are the youngest, he is a staple character, travelling back to his own home in ‘Meridian’ once the school year begins. Scout reminisce of their friendship as children before detailing the beginning of the school year. â€Å"Thus, we came to know Dill as a pocket Merlin, whose head teemed with eccentric plans, strange longings and quaint fantasies†(10). This shows us that in ‘To Kill a Mockingbird’ Dill is representative of childhood. Small and quaint, he is one of the most important and pure characters for when the children are youngest. He is the most eccentric and purely happy members of the three titular characters, and is extremely innocent. Even showing this through several moments. When Scout becomes annoyed at one point, she beats him up, and still he returns to her and Jem, wide eyed and eager to continue, not even aware of the general social constraints of friendship. In most moments he is simply happy to be with them and they are happy to be with him. This goes on for a long while, through some of the trials and tribulations of childhood, strained in moments of weakness and strong in moments of purity. And the decision for him to return to Meridian every school year shows that in some capacity, both Jem and Scout are being forced to grow up by entering and continuing their schooling. For most of the center of the story, Dill is not with them, representing the struggles and pains of growing, and how at moments your childhood must be left behind. However, by the end of the story, he has returned, the group desperate to see each other. This shows us that their childhood may return, although that doesn’t mean that they haven’t matured. These are t wo pieces of evidence that show the reader moments of symbolism in Harper Lee’s, ‘To Kill a Mockingbird’.