Tuesday, May 12, 2020

Meaning of Interpreted or Compiled in JavaScript

Computers cannot actually run the code that you write in JavaScript (or any other language for that matter). Computers can only run machine code. The machine code that a particular computer can run is defined within the processor that is going to run those commands and can be different for different processors. Obviously, writing machine code was difficult for people to do (is 125 an add command or is it 126 or perhaps 27). To get around that problem what are known as assembly  languages were created. These languages used more obvious names for the commands (such as ADD for adding) and thus did away with the need to remember the exact machine codes. Assembly languages still have a one to one relationship with the particular processor and machine code that the computer converts those commands into. Assembly Languages Must Be Compiled or Interpreted Very early on it was realized that easier to write languages were needed and that the computer itself could be used to translate those into the machine code instructions that the computer can actually understand. There were two approaches that could be taken with this translation and both alternatives were chosen (either one or the other will be used depending on the language being used and where it is being run). A compiled language is one where once the program has been written you feed the code through a program called a compiler and that produces a machine code version of the program. When you want to then run the program you just call the machine code version. If you make changes to the program you need to recompile it before being able to test the changed code. An interpreted language is one where the instructions are converted from what you have written into machine code as the program is being run. An interpreted language basically gets an instruction from the program source, converts it to machine code, runs that machine code and then grabs the next instruction from the source to repeat the process. Two Variants on Compiling and Interpreting One variant uses a two-stage process. With this variant, the source of your program is compiled not directly into the machine code but instead is converted to an assembly-like language that is still independent of the particular processor. When you want to run the code it then processes that compiled code through an interpreter specific to the processor so as to get the machine code appropriate to that processor. This approach has many of the benefits of compiling while maintaining processor independence since the same compiled code can be interpreted by many different processors. Java is one language that often uses this variant. The other variant is called a Just in Time compiler (or JIT). With this approach, you dont actually run the compiler after you have written your code. Instead, that happens automatically when you run the code. Using a Just in Time compiler the code isnt interpreted statement by statement, it is compiled all in one go each time when it is called to be run and then the compiled version that it just created is what gets run. This approach makes it look a lot like the code is being interpreted except that instead of errors only being found when the statement with the error is reached, any errors detected by the compiler result in none of the code being run instead of all of the code up to that point being run. PHP is an example of a language that usually uses just in time compilation. Is JavaScript Compiled or Interpreted? So now we know what interpreted  code  and compiled code  mean, the question we next need to answer is what does all of this have to do with JavaScript? Depending on exactly where you run your JavaScript the code may be compiled or interpreted or use either of the other two variants mentioned. Most of the time you are ​running your JavaScript in a web browser and there the JavaScript is usually interpreted. Interpreted languages are usually slower than compiled languages. There are two reasons for this. Firstly the code to be interpreted actually has to be interpreted before it can be run and  secondly, that has to happen every time that the statement is to be run (not only every time you run the JavaScript but if it is in a loop then it needs to be done every time around the loop). This means that code written in JavaScript will run slower than code written in many other languages. How does knowing this help us where JavaScript is the only language available for us to run across all web browsers? The JavaScript interpreter itself that is built into the web browser is not written in JavaScript.  Instead, it is written in some other language that was then compiled. What this means is that you can make your JavaScript run faster if you can take advantage of any commands that JavaScript provides that allow you to offload the task to the JavaScript engine itself. Examples for Getting JavaScript to Run Faster An example of this is that some but not all browsers have implemented a document.getElementsByClassName() method within the JavaScript engine while others have yet to do so. When we need this particular functionality we can make out code run faster in those browsers where the JavaScript engine provides it by using feature sensing to see if the method already exists and only creating our own version of that code in JavaScript when the JavaScript engine doesnt provide it for us. Where the JavaScript engine does provide that functionality it should run faster if we use that rather than running our own version written in JavaScript. The same applies to any processing that the JavaScript engine makes available for us to call directly. There will also be instances where JavaScript provides multiple ways of making the same request. In those  instances, one of the ways of accessing the information may be more specific than the other. For example document.getElementsByTagName(table)[0].tBodies and document.getElementsByTagName(table)[0].getElementsByTagName(tbody) both retrieve the same  nodelist  of the  tbody  tags in the first table in the web page however the first of these is a specific command for retrieving the  tbody  tags where the second identifies that we are retrieving  tbody  tags in a parameter and other values can be substituted to retrieve other tags. In most  browsers, the shorter and more specific variant of the code will run faster (in some instances much faster) than the second variant and so it makes sense to use the shorter and more specific version. It also makes the code easier to read and maintain. Now in many of these  cases, the actual difference in the processing time will be very small and it will only be when you add many such code choices together that you will get any noticeable difference in the time your code takes to run. It is fairly rare though that changing your code to make it run faster is going to make the code significantly longer or harder to maintain, and often the reverse will be true.There is also the added benefit that future versions of JavaScript engines may be created that speed up the more specific variant even further so that using the specific variant may mean that your code will run faster in the future without you having to change anything.

Wednesday, May 6, 2020

Tourism has often been criticised for damaging the environment and undermining local cultures Free Essays

Environment and undermining local cultures. To what extent Is this true in Hong Kong? You should give both the advantages and disadvantages of Hong Kong’s tourist industry but your essay should support one side only. Tourism is travel for recreational, leisure or business purposes. We will write a custom essay sample on Tourism has often been criticised for damaging the environment and undermining local cultures or any similar topic only for you Order Now It has become a popular global leisure activity, which is of vital importance for many countries, due to large intake of money for businesses with their goods and services and the opportunities for employment in the service industries. This rapid expanding industry shows both positive and negative effects. Hong Kong is an attractive and vibrant city that worth tourists’ travelling as we can see many tourists in some tourist spots every day, for instance, Central, Causeway Bay, Tsim Sha Tsui, Mong Kok and so on. However, tourism in Hong Kong has long been criticised for damaging the environment and undermining local cultures. First and foremost, tourism can promote job opportunities. A good example is the operation of the Hong Kong Disneyland. It attracts more fresh graduates and young adults to find jobs and work there, and hence increase employment rate of Hong Kong. Undeniably, under the background of rising job opportunities, tourism can stimulate economic growth. As more and more tourists around the globe visit Hong Kong, this increases foreign exchange earnings and boost sales of shops. To cater for tourists’ needs, there will be improvement of facilities or infrastructure such as roads, buildings, airports and communication systems, which may be improved to meet growing demands. Although tourism can bring us benefits, its drawbacks cannot be disregarded. Tourism may damage traditional culture. Tourists visit to Hong Kong will focus more their attention on shopping than seeing some popular tourist spots related to traditional cultures. Although economic growth is stimulated, Hong Kong will soon become a consumer society. Tourism could cause pollution. The non-biodegradable rubbish left behind by many tourists often ends up being dumped into landfills, rivers and the sea. Furthermore, young people will grow up in a deteriorating environment and be affected by what they see tourists do and then follow their behaviours such as drunkenness, drug abuse and gambling. In some serious cases of crimes, the relationship between two countries may be worsen because of the records of criminals. In my view, tourism has often been criticised for damaging the environment and undermining local cultures. When you walk on the streets and beaches, you can see a lot of waste and litter on the ground, even though local citizens throw some of them on the floor. Moreover, the reason why tourism undermines local cultures is tourists enjoy material comfort more than spiritual satisfaction. They realize that there are lots of cheap goods in Hong Kong and then rush into the shops and buy whatever they can without consideration. This forms a consumer culture. When they find something they have bought is useless, they will throw them away immediately. This definitely damages the environment and becomes a vicious cycle as time goes by. To remedy the problem, the local government should implement some effective measures to make tourist industry more traditional and environmentally-friendly, for example, holding more traditional activities so as to attract tourists and let them know more about local culture. Education of tourists to be a responsible person in their home countries is extremely important. Although different countries have different rules and laws, ‘When in Rome, do as Roman do’, tourists should strictly follow the rules when they are traveling to Hong Kong or even other places. If they do not obey the law, they would receive heavy penalty and even imprisonment, no matter they are tourists who visit Hong Kong. How to cite Tourism has often been criticised for damaging the environment and undermining local cultures, Papers

Saturday, May 2, 2020

Impact of Corporate Social Responsibility on Equity of Woolworth

Question: Discuss about the Impact of Corporate Social Responsibility on Brand Equity of Woolworth. Answer: Introduction Corporate Social Responsibility and brand equity have been extensively studied in marketing research process. Corporate Social Responsibility is one effective component that offers various ways of developing brand equity within any organization (Youn Ryu, 2016). Therefore, corporate social responsibility has great impact on the brand equity of organizations. Corporate social responsibility is used by various organizations for managing their functional measures with respect to various social and consumer related facts and issues within organizations. This research paper is elaborating about the impact analysis of corporate social responsibility on brand equity of Australian business organizations. In contrast with these facts, this research paper has selected the Woolworth as one business organization for analyzing the impacts of the corporate social responsibility of brand equity of Woolworth. In contrast with these facts, various stakeholder relationships is evaluated with respect to the context of corporate social responsibility and the concept of brand equity involved within the organizational structure of the Woolworth. Aims and Objectives This project aims to investigate impact of corporate social responsibility on brand equity of Woolworth, an Australian retail organization. Following are the concerned objectives for impact assessment of Corporate Social Responsibility on Woolworth: To study the existing nature of CSR within Woolworth with respect to evolving trends within retail industry of Australia. To identify the intent of CSR policies within Woolworth To analyze the policies of Woolworth with respect to the brand equity of the company To understand the relationship of brand awareness and corporate social responsibility of Woolworth Methodology The methodology is the process that will be followed by the researcher in order to manage research tasks and methods. There are mainly two types of research methodology. These are qualitative and quantitative methodology (Tingchi et al., 2014). The qualitative methodology is concerned with the process of literature and documents collected as the primary and secondary data collected for managing the research. Apart from this, the quantitative methodology is concerned with the process of the managing the responses of participants involved within the research process. These are mainly concerned with the quantitative research process. Chosen methodology: Mixed Approach This research is considering the mixed approach for the doing he research. Both the qualitative and quantitative approach is concerned for this research process (Grhan-Canli, Hayran Sarial-Abi, 2016). The qualitative research is helpful in this research as various the theoretical aspects are considered for managing the supportive facts about the impact of CSR on brand equity. Apart from these perspectives, the quantitative study is involved due to collecting the responses of various resources involved within the corporate social responsibility and brand equity measures. The quantitative study refers to the immediate responses of the organizational members about how corporate policies as well as social movement by Woolworth are impacting on the brand value of the organization. Research Design The exploratory research design process is chosen within this research process in order to support the descriptive design was able to support the functional details about the corporate social responsibility and brand equity of Woolworth. Other than this research design rest of the research design process are omitted because of their longitudinal aspects involved within research process. Methods of data collection The primary data are collected with the help of surveys done among the employees and clients of Woolworth for evaluating the impact of CSR on the brand equity of the organization (Fatma, Rahman Khan, 2015). Apart from this, the secondary data is collected from the published resources about the brand equity and corporate social responsibility. Data and analysis The qualitative data analysis is done with the help of case study, narrative resources that are present in web. In addition to this, the quantitative study is conducted with respect to interviews and surveys of the resources. References Fatma, M., Rahman, Z., Khan, I. (2015). Building company reputation and brand equity through CSR: the mediating role of trust.International Journal of Bank Marketing,33(6), 840-856. Grhan-Canli, Z., Hayran, C., Sarial-Abi, G. (2016). Customer-based brand equity in a technologically fast-paced, connected, and constrained environment.AMS review,6(1-2), 23-32. Hur, W. M., Kim, H., Woo, J. (2014). How CSR leads to corporate brand equity: Mediating mechanisms of corporate brand credibility and reputation.Journal of Business Ethics,125(1), 75-86. Tingchi Liu, M., Anthony Wong, I., Shi, G., Chu, R., L. Brock, J. (2014). The impact of corporate social responsibility (CSR) performance and perceived brand quality on customer-based brand preference.Journal of Services Marketing,28(3), 181-194. Youn, S. H., Ryu, S. Y. (2016). The impacts of CSR program on young students' attitudes toward the corporation and natural environment: Tourism study from a convergence perspective.Indian Journal of Science and Technology,9(26).