Sunday, December 29, 2019

NaN, Infinity, and Divide by Zero in VB.NET

Beginning programming books usually include this warning: Dont divide by zero! Youll get a runtime error! Things have changed in VB.NET. Although there are more programming options and the calculation is more accurate, it isnt always easy to see why things happen the way they do. Here, we learn how to handle division by zero using VB.NETs structured error handling. And along the way, we also cover the new VB.NET constants: NaN, Infinity, and Epsilon. What Happens If You Run 'Divide By Zero' in VB.NET If you run a divide by zero scenario in VB.NET, you get this result: Dim a, b, c As Double a 1 : b 0 c a / b Console.WriteLine( _ Have math rules _ vbCrLf _ been repealed? _ vbCrLf _ Division by zero _ vbCrLf _ must be possible!) So whats going on here? The answer is that VB.NET actually gives you the mathematically correct answer. Mathematically, you can divide by zero, but what you get is infinity. Dim a, b, c As Double a 1 : b 0 c a / b Console.WriteLine( _ The answer is: _ c) Displays: The answer is: infinity The value infinity isnt too useful for most business applications. (Unless the CEO is wondering what the upper limit on his stock bonus is.) But it does keep your applications from crashing on a runtime exception like less powerful languages do. VB.NET gives you even more flexibility by even allowing you to perform calculations. Check this out: Dim a, b, c As Double a 1 : b 0 c a / b c c 1 Infinity plus 1 is still infinity To remain mathematically correct, VB.NET gives you the answer NaN (Not a Number) for some calculations such as 0 / 0. Dim a, b, c As Double a 0 : b 0 c a / b Console.WriteLine( _ The answer is: _ c) Displays: The answer is: NaN VB.NET can also tell the difference between positive infinity and negative infinity: Dim a1, a2, b, c As Double a1 1 : a2 -1 : b 0 If (a1 / b) (a2 / b) Then _ Console.WriteLine( _ Postive infinity is _ vbCrLf _ greater than _ vbCrLf _ negative infinity.) In addition to PositiveInfinity and NegativeInfinity, VB.NET also provides Epsilon, the smallest positive Double value greater than zero. Keep in mind that all of these new capabilities of VB.NET are only available with floating point (Double or Single) data types. And this flexibility can lead to some Try-Catch-Finally (structured error handling) confusion. For example, the .NET code above runs without throwing any kind of exception, so coding it inside a Try-Catch-Finally block wont help. To test for a divide by zero, you would have to code a test something like: If c.ToString Infinity Then ... Even if you code the program (using Integer instead of Single or Double types), you still get an Overflow Exception, not a Divide by Zero exception. If you search the web for other technical help, you will notice that the examples all test for OverflowException. .NET actually has the DivideByZeroException as a legitimate type. But if the code never triggers the exception, when will you ever see this elusive error? When You'll See DivideByZeroException As it turns out, Microsofts MSDN page about Try-Catch-Finally blocks actually uses a divide by zero examples to illustrate how to code them. But theres a subtle catch that they dont explain. Their code looks like this: Dim a As Integer 0 Dim b As Integer 0 Dim c As Integer 0 Try   Ã‚  Ã‚  a b \ c Catch exc As Exception   Ã‚  Ã‚  Console.WriteLine(A run-time error occurred) Finally   Ã‚  Ã‚  Console.ReadLine() End Try This code does trigger an actual divide by zero exception. But why does this code trigger the exception and nothing weve coded before does? And what is Microsoft not explaining? Notice that the operation they use is not divide (/), its integer divide (\)! (Other Microsoft examples actually declare the variables as Integer.) As it turns out, integer calculation is the only case that actually throws that exception. It would have been nice if Microsoft (and the other pages that copy  their code) explained that little detail.

Saturday, December 21, 2019

Jane Austen s Pride And Prejudice - 1693 Words

The study of two comparative texts emphasises the understanding of social, historical and cultural contexts through the reflections of illicit and explicit similarities and differences in the values and attributes presented. Jane Austen’s 1813 novel Pride and Prejudice and Fay Weldon’s 1993 epistolary text Letters to Alice, both challenge the worth of their time as contexts change, but values are upheld. Weldon’s reflection on Austen’s nineteenth century environment, conveys to responders how marriage, gender roles and social class continue to be relevant issues in both regency times and the modern world. Through witnessing Aunt fay’s commentaries on the world of Austen, responders are provided with a foundation for a modern understanding†¦show more content†¦By placing the ideas of wealth and marriage together, Austen is presenting the financially beneficial values of marriage in 19th century England, as an honourable way security. Austen uses this idea that marriage is vital for social stability, through her characterisation of Charlotte Lucas as a woman who does not â€Å"think highly of men or matrimony† and believes that â€Å"Happiness in marriage is entirely a matter of chance.† With the acceptance of Mr Collins’ marriage proposal, despite not being a product of love, she is able to ensure her financial security with a man of fortune, hence her marriage acts as a product of her time. As responders, Austen’s reflection of marriage in 19th century England allows for the enhanced understanding of societal values. The importance and values associated with marriage in Pride and Prejudice are reflected and strengthened through Weldon’s discussion of similarities and differences between contexts. Weldon juxtaposes the age of marriage between both contexts as Aunt Fay states that â€Å"Marriage was later, too: on average between twenty-five and twenty eight, though Jane Austen’s heroines seem to have stated panicking in their early twenties.† Through this comparison she is stating that although the rite of marriage is still an important aspect in life, it is not as significant as it was in regency times. This is reinforced by Fran

Friday, December 13, 2019

Arctic National Wildlife Refuge Dispute Free Essays

Arctic National Wildlife Refuge, or ANWR, is a refuge geared toward preserving national wildlife in northeastern Alaska. ANWR is about 19 million acres, in space, and contains a potential drilling spot for oil and petroleum. The potential drilling spot is a small area known as the 10-02 Area. We will write a custom essay sample on Arctic National Wildlife Refuge Dispute or any similar topic only for you Order Now It is only 1. 5 million acres, or 8%, of ANWR, would even be considered for development (What is ANWR). The controversy surrounding ANWR is whether to drill or not to drill into the 10-02 area. Some people want to preserve the wilderness and to find more fuel-efficient technologies.Others want to lower gas prices and to create more job opportunities. If the government decides to drill for oil, it could possibly lead to about 17 billion barrels of oil, to last the United States for the next 20 years. According to the official ANWR website, Prudhoe Bay is located 60 miles west of ANWR and has produced about 10 billion barrels of oil in the past 20 years. It is currently producing about 1. 4 million barrels a day, but is slowly declining; this induces the need for a new source. The northeastern part of ANWR is America’s best opportunity in finding another oil and gas field the size of Prudhoe Bay.The coastal plain of ANWR could produce up to 1. 5 million barrels of oil a day and would save the U. S. $14 billion a year in imports (Making the Case). 75% of Alaskans want to drill in the designated ANWR area, 10-02. They feel that it could possibly relieve Americans of their foreign dependency for imported oil and petroleum. The United States currently spends up to $330 billion on foreign oil imports, not including the money used to protect and acquire it. The total area of area10-02 only amounts to 8% of ANWR’s total area, which is 1. million acres. Out of the 1. 5 million acres considered for development, only 2,000 acres of the Coastal Plain would actually be affected, which is less than half of one percent (Top Ten). Drilling in ANWR would also create anywhere from 250,000 to 750,000 job opportunities, as well as an opportunity to better the economy. Drilling in ANWR also has no impact on wildlife. This can be proven by the fact that the Central Arctic Caribou Herd that migrates through Prudhoe Bay has grown from 3,000 to its current population of about 32,000 healthy caribou.The total amount of oil that is expected from ANWR estimates from 9 to 16 billion barrels (Making the Case). There is also an underside to drilling in ANWR. Although it would considerably lower gas prices, it would take approximately ten years for the oil to actually reach the marketplace. Clara Tsang argues that instead of drilling in ANWR, the government should produce more energy-efficient technologies. She also states that during the peak of drilling, only 876,000 barrels of oil will be produced a day. That is not enough oil to significantly reduce world oil prices.She states that the 2000 acres designated for drilling, Area 10-02, only accounts for where the actual equipment will be, not including the areas of the oil reservoirs. Lastly, Tsang argues the destruction of moral and spiritual grounds for conserving a place for meditation and inspiration (Tsang). On the official website for the Defenders of Wildlife, it states that we shouldn’t industrialize a natural treasure (Arctic National). It also states that if drilling became imminent that destroy the coastal plain of the Beaufort Sea, the most sensitive area of the entire refuge.They believe in preserving the national wildlife’s habitat, instead of tampering with an arctic, subarctic and boreal ecosystem (Wildlife Impacts). According to the ANWR official website, Louisiana can be greatly affected by drilling in ANWR. It would create approximately 14,800 jobs in module and facility construction, exploration, and production engineering. It also states that Louisiana has already been greatly affected by Prudhoe Bay. Since 1980, Louisiana has spent almost $400 million in Prudhoe Bay. Also, over 850 Louisiana vendors are doing business in Alaskan oil fields.An example is the Prudhoe Bay gas expansion module GHX-2, produced in New Iberia, in 1994 (What Development). Drilling in ANWR could greatly benefit the United States. It could boost the economy, decrease foreign oil trade, lower oil prices worldwide and create about 750,000 jobs, throughout the United States. On the other hand it could ruin ecosystems and tamper with wildlife’s habitats, for a less than significant amount of oil. Either way a decision has to be made. Prudhoe Bay is steadily declining. The question is whether the government wants to ontinue paying the high price of foreign imports or drill at ANWR and potentially ruin fragile and ecologically sensitive ecosystems.Works Cited â€Å"Arctic National Wildlife Refuge. † Defenders. org. 2008. Defenders of Wildlife. 19 Oct. 2008. . â€Å"Making the Case for ANWR†. ANWR. org 2008. Frontier Communications. 19 Oct. 2008. lt; http://www. anwr. org/Background/Making-the-Case-for-ANWR. phpgt;. â€Å"Top Ten Reasons to Support ANWR Development. † ANWR. org 2008. Frontier Communications. 19 Oct. 2008. lt; http://www. anwr. rg/ANWR-Basics/Top-ten-reasons-to-support-ANWR-development. phpgt;. Tsang, Clara. â€Å"Arguments Against Drilling in ANWR. † 19 Oct. 2008. . â€Å"What Development of Alaska’s Arctic Coastal Plain Means to Louisiana. † ANWR. org 2008. Frontier Communications. 19 Oct. 2008. . â€Å"What is ANWR and Where is it? † ANWR. org 2008. Frontier Communications. 19 Oct. 2008. lt; http://www. anwr. org/ANWR-Basics/What-is-ANWR-and-where-is-it. phpgt;. â€Å"Wildlife Impacts from Oil Drilling in the Refuge. † Defenders. org. 2008. Defenders of Wildlife. 19 Oct. 2008. . How to cite Arctic National Wildlife Refuge Dispute, Essays

Thursday, December 5, 2019

Environmental Laws and Sustainability An Introduction

Question: Discuss the sustainable approaches and Issues with the Climate Changes and Global Warming? Answer: Introduction The sustainable development is defined in many ways. In one aspect, the sustainable development can be defined as the procedures for maintaining the healthy environment (Morelli, 2011, p.3). On the other hand, Nuangchalerm and Kwuanthong (2010, p.6) implied, the environmental management is concerning the effective interaction procedures of Environment with a human. The study on environmental management is identifying the desirable approaches to the environment by considering the economic, physical, technological and social constraints. However, some of the issues are also concerning the environmental hazards. The impact of climate change and global warming on the human beings is preventing the sustainable development aspects. It is very much indicative that the interdisciplinary and the transdisciplinary surroundings protect the environment from the complexities as well. The present world faces several natural calamities, the climate changing, erosion, flood, desertification, and def orestations. The study of sustainable development of the global environment requires the proper definition for understanding the approaches. In one aspect, Zhao et al. (2010, p.1555) mentioned that the globalization is the term used for building up the interrelation between the different countries. On the contrary, Suresh (2011, p.120) defined that the globalization is the other form of liberalization, which is entailing the restrictions set by the international government. However, it is to be noted that in this present world, the climate change issues have been much prominent in considering the relevance of the sustainable approaches. The living beings face several issues due to such global warming and the climate-changing scenario. Shen et al. (2013) indicated that the temperature of the earth is increasing, which is sometimes not feasible for the sustainable development. When any business companies are assuring the sustainability and the proper business environment, it is very much important to maintain the actual corporate social responsibility. The emission of the greenhouse gas is sometimes required for the industrial business, but the act of deforestation is not able to maintain the balance of the amount of CFC. Therefore, the environment has been suffering from the pollutions, which is harmful to every living being. On the other hand, the act of cutting down the trees is enhancing the amount of Carbon dioxide, which directly affects the environment. Even the waste of the natural resources that have been used in the industrial business is also ensuring the increased level of environmental hazards. The challenges are much prominent in concerning the increased level of the global warming. The increased level of the carbon emission is spreading over the atmosphere, and the emission of the GHGs is highlighting the issues with the economic activities. It is assured that people are very much concerned about the environment where they are living. However, in this present world, not only the local environment, the entire global scenario is in risks due to the global warming issues. Nuangchalerm and Kwuanthong (2010, p.7) mentioned that the little emissions of CFC is hampering the industrial business. As a result, the degradation of the ozone layer is quite prominent. The carbon dioxide extracted from several flaming materials can damage the climate more profoundly. As far as the human population is concerned, it is to be noted that both nature and the human beings are drastically affected with the increasing level of the carbon emission. Morelli (2011, p.9) defined that the natural re sources are also affected due to the climate changing scenario. Sustainable approaches In concerning the sustainable development, the judgment of the human attitude is very much important. The act of deforestations, over consumptions and wastages of the natural resource, and over a generation of waste can hamper the sustainability of the comfortable environment. It is very much indicative that in this present world, the rise of the different industries has become much prominent (Kolmannskog, 2013). Due to such implication, the human beings are adopting several amenities, which are giving rise to these deforestations and the waste of natural resources procedures. This is enhancing the larger scale of the biodiversity and soil slaughtering, which is hampering the ecosystem more profoundly. The present issues are concerning the sustainable development of the human beings living in this environment. The act of deforestations is increasing the level of the carbon dioxide and decreasing the level of oxygen. As a result, the Global warming issues have become very much prominent. The further evaluations of such challenges have been discussed below: Issues with the Climate Changes and Global Warming According to Kaiposzta (2013, p.2), to understand the issues underpinning the sustainable development, it is very much important to know the basic science regarding the global warming and greenhouse gasses. It is very much indicative that the emission of the greenhouse gas is causing the global warming. The absorption of the infra-red radiating on the surface of the earth can also cause global warming. The presence of the greenhouse gas is aligned with the current climate existed in the present environment. It is quite prominent that the sustainable approaches are very much significant. In this present world, the industrial business is assuring the technical amendments and the modified nature of the information technologies. Du (2011, p.1) implied that the industrial business required the emission of the CFC and therefore, nature sometimes gets affected with the increasing level of the carbon emission. The act of deforestations is surely decreasing the level of the oxygen emission and enhancing the level of the carbon dioxide. In this modernized world, the human beings are adopting some trends in deforesting and building up the new infrastructures. On the other aspects, the waste of the natural resource is also hampering the ecosystem (Dernbach and Mintz, 2011, p.535). This questions the sustainable development in concerning the secure life of the human being and other living beings. Oxygen is required for the respiratory system of the human beings and other living beings. In case of the deforestations, the level of oxygen decreases, which is hampering the lives. On the other hand, the industrial revolution needs the uses of the natural resources. It has been seen; the wastages are gathered in a place, which is causing the environmental pollution. Therefore, it is mandatory for the industries in recycling the natural resources for avoiding the environmental pollutions. Brandon (201 2, p.25) opined that the industrial business should recycle the natural resources, which can a relevant approach for saving the resources and reusing them. The usages of the recycled resources will be decreasing the pollution level, and the sustainability of the human beings will be concerned. However, it is very much indicative that the climate changing is creating the effects on the human beings. In some of the cases, the technical development is considering the use of the natural resource. However, the wastages of the natural resources can even affect the industrial works. The approaches in this modernized world are much fascinated with the act of deforestations, which is harmful not only to human beings, even for the other living beings as well. On the other hand, it is even justified that the reusable resources can enhance the business profitability and the sustainability of the global environment. However, it is needed to be sure that the global warming can affect the business when the level of carbon dioxide is increased. It is to be ensured that the social and the political issues are also concerning the evaluation of the nature of the global environment. The changes in climate are leading the political figures in the country in setting the different regulatory aspects, which is important for the sustainable approaches for the business entities. When the business companies are stabilizing the business, it is very much important for them to maintain the CSR rules and the welfare of the environment. In such cases, the environmental factor plays a very vital role. Boer (2010, p.3102) notified that the changing global climate is sometimes significantly affecting the business environment. The social, political, economical, and other aspects are much concerned. Even the increase level of the greenhouse gasses is sometimes affecting the industrial business as well as the human lives. The political scenario of a country can assure the business sustainability and the changes in climate can affect such scenari o. The social-economic scenario is much influenced by the changing climate and global warming. Therefore, it is very much necessary for the business companies even to maintain such global scenario concerning the sustainable development of the environment. Conclusion The entire study is reflecting the environmental management and the effects of the natural calamities over the environment. The study is identifying the necessity of the maintenance of the environmental aspects. The acts of deforestations, resource wasting, etc. are affecting the environment more specifically. The emission of carbon dioxide and CFC is significantly creating the environmental pollution, which is not only harmful to the human beings and other living beings as well. Even the wastages of the resources for the industrial business are also creating hazards in the environment. The changing climate is affecting the social, political, economical development. Therefore, it is much necessary to structure the natural resources and to use them for the welfare of the environment. Even the development of several technicalities can ensure the protection of the environment from Global warming. References Boer, G. (2010). Changes in Interannual Variability and Decadal Potential Predictability under Global Warming. Journal of Climate, 22(11), pp.3098-3109. Brandon, P. (2012). Sustainable development: ignorance is fatal what dont we know?. Smart and Sustainable Built Environment, 1(1), pp.14-28. Dernbach, J. and Mintz, J. (2011). Environmental Laws and Sustainability: An Introduction. Sustainability, 3(12), pp.531-540. Du, W. (2011). Cooperative Game on Economic Management of Air Environment. JSD, 4(1). Kaiposzta, J. (2013). New approaches to achieve sustainable regional development. Visegrad Journal on Bioeconomy and Sustainable Development, 2(2). Kolmannskog, V. (2013). What Gestalt Approaches Can Contribute to Climate Change Transformation. JSD, 6(10). Morelli, J. (2011). Environmental Sustainability: A Definition for Environmental Professionals. Journal of Environmental Sustainability, 1(1), pp.1-10. Nuangchalerm, P. and Kwuanthong, B. (2010). Teaching Global Warming  through Socioscientific issues-based Instruction. Asian Social Science, 6(8). Shen, B., Wang, J., Li, M., Li, J., Price, L. and Zeng, L. (2013). China's approaches to financing sustainable development: policies, practices, and issues. WENE, 2(2), pp.178-198. Suresh, H. (2011). Energy Resource Allocation for Sustainable Development: A Case Study. IJEE. Zhao, P., Yang, S. and Yu, R. (2010). Long-Term Changes in Rainfall over Eastern China and Large-Scale Atmospheric Circulation Associated with Recent Global Warming. Journal of Climate, 23(6), pp.1544-1562.