Thursday, March 19, 2020

Legalizing Marijuana Essays - Herbalism, Medicinal Plants

Legalizing Marijuana Essays - Herbalism, Medicinal Plants Legalizing Marijuana To the AIDS or cancer patient, it is the plant that fights nausea and appetite loss. To the nutritionist, its seed is second only to the soybean in nutritional value, and is a source of cooking oil and vitamins. To the paper or cloth manufacturer, it is the plant that provided much of our paper and clothing for hundreds of years and produces four times more fiber per acre than trees. To the environmentalist, it is the plant that could greatly slow deforestation, restore robbed nutrients by other crops, and help prevent erosion. And according to Lonnelle Aikman, "Preliminary findings show the drug may prove effective against glaucoma and asthma, and control such side nausea in cancer treatment" (158). Unfortunately, to most people in this country, it is a useless plant when it comes to economic or medical value. Marijuana should be legalized in the United States. In technical terms, hemp, cannabis, or for the average American, marijuana, it is used only for recre! ational purposes. I think marijuana is a plant that could save the world. In this paper I hope to reverse prejudices, relieve ignorance, and inform people of the known and potential therapeutic uses of this remarkable plant. As of today the nation stands behind three basic ideas of what to do with marijuana; legalize marijuana, make it legal only as a prescription drug, or keep it as it is, illegal. People who are pro-marijuana, argue that marijuana is considerably less harmful than tobacco and alcohol, the most frequently used legal drugs. Furthermore marijuana has never directly caused anyone's death. People who side with the legalization of marijuana for medical purposes believe that the ends justify the means. But the people who want to keep it illegal think that the medical uses do not outweigh the harmful side effects. Before deciding whether marijuana should be legal or illegal, one needs to know some basic facts. Lester Grinspoon, M.D. and James B. Bakalar note "most botanists agree that there are three species of marijuana; Cannabis sativa, the most widespread of the three, is tall, gangly, and loosely branched, growing as high as twenty feet; Cannabis indica is shorter, about three or four feet in height, pyramidal in shape and densely branched; Cannabis ruderalis is about two feet high with few or no branches" (1). They also say that "Cannabis has become one of the most widespread and diversified of plants. It grows as weed and cultivated plant all over the world in a variety of climates and soils" (1). Marijuana was first cultivated in China around 4000 B.C. It was mainly used as a sedative and analgesic, but today it is commonly used for the "high" or the euphoric feeling it causes. The most active ingredient in marijuana is delta-9-tetrahydrocannibinal commonly referred to a! s THC, which wasn't discovered until the 1960s. Marijuana is illegal today because of the Marijuana Stamp Tax Act passed in 1937. This act prohibited the use, sale, and growing of marijuana. It was made illegal because no one understood why smoking marijuana made people feel the way they did, and because it was associated with Indians and other so called "immoral people." Today marijuana is illegal because research has shown some intoxicating effects. Such as hallucination, anxiety, depression, extreme variability of mood, paranoia and schizophrenia lasting up to six hours. Raphael Mechoulam says, "Although cannabis causes initial restlessness, excitement, and sometimes boisterous, impulsive behavior, pacing and dancing, the main picture is of reduced physical activity apart from speech" (316). Physical effects include reddening of the eyes, dryness of the mouth and throat, a moderate increase in heart rate, tightness in the chest, drowsiness, unsteadiness, and uncoordinated muscular contractions. Marijuana buffers ! the central nervous system, but is not known to produce a considerable amount of tar in the lungs. Although marijuana has not been proven to be physically addictive, its use can be psychologically addictive. These are the negative effects of marijuana, and the primary reasons why domestic people, doctors, and politicians want to keep marijuana illegal. Supporters of legalizing marijuana state that some legal drugs are just as bad. For example, alcohol has many of the same side effects of marijuana. Alcohol

Tuesday, March 3, 2020

Overview of Partial Classes in Visual Basic .NET

Overview of Partial Classes in Visual Basic .NET Partial Classes are a feature of VB.NET that is used almost everywhere, but theres not much written about it. This might be because there are not a lot of obvious developer applications for it yet. The primary use is in the way ASP.NET and VB.NET solutions are created in Visual Studio where its one of those features that is normally hidden. A partial class is simply a class definition that is split into more than one physical file. Partial classes dont make a difference to the compiler because all the files that make up a class are simply merged into a single entity for the compiler. Since the classes are just merged together and compiled, you cant mix languages. That is, you cant have one partial class in C# and another in VB. You cant span assemblies with partial classes either. They all have to be in the same assembly. This is used a lot by Visual Studio itself, especially in web pages where it is a key concept in code behind files. Well see how this works in a Visual Studio, but understanding what changed in Visual Studio 2005 when it was introduced is a good starting point. In Visual Studio 2003, the hidden code for a Windows application was all in a section called a Region marked Windows Form Designer generated code. But it was still all there in the same file and it was easy to view, and change, the code in the Region. All of the code is available to your application in .NET. But since some of it is code that you should almost never mess with, it was kept in that hidden Region. (Regions can still be used for your own code, but Visual Studio doesnt use them anymore.) In Visual Studio 2005 (Framework 2.0), Microsoft did approximately the same thing, but they hid the code in a different place: a partial class in a separate file. You can see this at the bottom of the illustration below: Click Here to display the illustrationClick the Back button on your browser to return One of the syntax differences between Visual Basic and C# right now is that C# requires that all partial classes be qualified with the keyword Partial but VB does not. Your main form in VB.NET doesnt have any special qualifiers. But the default class statement for an empty Windows application looks like this using C#: public partial class Form1 : Form Microsofts design choices on things like this are interesting. When Paul Vick, Microsofts VB designer, wrote about this design choice in his blog Panopticon Central, the debate about it in the comments went on for pages and pages. Lets see how all this works with real code on the next page. On the previous page, the concept of partial classes was explained. We convert a single class into two partial classes on this page. Heres an example class with one method and one property in a VB.NET project Public Class CombinedClass   Ã‚  Ã‚  Private m_Property1 As String   Ã‚  Ã‚  Public Sub New(ByVal Value As String)   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  m_Property1 Value   Ã‚  Ã‚  End Sub   Ã‚  Ã‚  Public Sub Method1()   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  MessageBox.Show(m_Property1)   Ã‚  Ã‚  End Sub   Ã‚  Ã‚  Property Property1() As String   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Get   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Return m_Property1   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  End Get   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Set(ByVal value As String)   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  m_Property1 value   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  End Set   Ã‚  Ã‚  End Property End Class This class can be called (for example, in the Click event code for a Button object) with the code: Dim ClassInstance As New _   Ã‚  Ã‚  CombinedClass(About Visual Basic Partial Classes) ClassInstance.Method1() We can separate the properties and methods of the class into different physical files by adding two new class files to the project. Name the first physical file Partial.methods.vb and name the second one Partial.properties.vb. The physical file names have to be different but the partial class names will be the same so Visual Basic can merge them when the code is compiled. Its not a syntax requirement, but most programmers are following the example in Visual Studio of using dotted names for these classes. For example, Visual Studio uses the default name Form1.Designer.vb for the partial class for a Windows form. Remember to add the Partial keyword for each class and change the internal class name (not the file name) to the same name. I used the internal class name: PartialClass. The illustration below shows all of the code for the example and the code in action. Click Here to display the illustrationClick the Back button on your browser to return Visual Studio hides partial classes such as Form1.Designer.vb. On the next page, we learn how to do that with the partial classes we just created. The previous pages explain the concept of partial classes and show how to code them. But Microsoft uses one more trick with the partial classes generated by Visual Studio. One of the reasons for using them is to separate application logic from UI (user interface) code. In a large project, these two types of code might even be created by different teams. If theyre in different files, they can be created and updated with a lot more flexibility. But Microsoft goes one more step and hides the partial code in Solution Explorer as well. Suppose we wanted to hide the methods and properties partial classes in this project? Theres a way, but its not obvious and Microsoft doesnt tell you how. One of the reasons you dont see the use of partial classes recommended by Microsoft is that its not really supported very well in Visual Studio yet. To hide the Partial.methods.vb and Partial.properties.vb classes that we just created, for example, requires a change in the vbproj file. This is an XML file that isnt even displayed in Solution Explorer. You can find it with Windows Explorer along with your other files. A vbproj file is shown in the illustration below. Click Here to display the illustrationClick the Back button on your browser to return The way were going to do this is to add a root class that is completely empty (only the Class header and End Class statement are left) and make both of our partial classes dependent on it. So add another class named PartialClassRoot.vb and again change the internal name to PartialClass to match the first two. This time, I have not used the Partial keyword just to match the way Visual Studio does it. Heres where a little knowledge of XML will come in very handy. Since this file will have to be updated manually, you have to get the XML syntax right. You can edit the file in any ASCII text editor - Notepad works just fine - or in an XML editor. It turns out that you have a great one in Visual Studio and thats what is shown in the illustration below. But you cant edit the vbproj file at the same time that youre editing the project its in. So close the project and open only the vbproj file. You should see the file displayed in the edit window as shown in the illustration below. (Note the Compile elements for each class. DependentUpon sub-elements must be added exactly as shown in the illustration below. This illustration was created in VB 2005 but it has been tested in VB 2008 as well.) Click Here to display the illustrationClick the Back button on your browser to return For many of us, its probably enough to know that partial classes are there, just so we know what they are when were trying to track down a bug in the future. For large and complex systems development, they could be a small miracle because they can help organize code in ways that would have been impossible before. (You can also have partial structures and partial interfaces!) But some people have concluded that Microsoft invented them just for internal reasons - to make their code generation work better. Author Paul Kimmel even went so far as to suggest that Microsoft actually created partial classes to lower their costs by making it easier to outsource development work around the world. Maybe. Its the kind of thing they might do.