text:
Francisca Dias

## Introduction¶

In this paper I will focus on the evaluation metrics available for calssification problems using the dataset Costumer Churn.

Predicting when a costumer is about to churn is valuable in many businesses: communications, banking, movie rental, etc.

With the data at our disposal we can predict, using different models, who are the costumers that are more likely to churn.

My goal here is to show you different metrics and explain each one.

For this purposes I will leave out the results from other models, since I only want to focus in the meaning of results.

This is a binary classification problem, since the predicted results are Yes (1) or No (0).

Many classification models could be used here: KNeighbors Classifier, Logistic Regression, Gradient Boosting Classifier and so on.

I will only deploy the results from the Random Forest Classifier.

This dataset can be found here.

In [1]:
import pandas as pd
import numpy as np

In [2]:
churn_df = pd.read_csv('churn.csv')

In [3]:
# Drop the columns that we have decided won't be used in prediction
churn_df = churn_df.drop(["Phone", "Area Code", "State"], axis=1)

In [4]:
churn_df["Churn?"] = np.where(churn_df["Churn?"] == 'True.',1,0)

In [5]:
churn_df["Int'l Plan"] = np.where(churn_df["Int'l Plan"] == 'yes',1,0)
churn_df["VMail Plan"] = np.where(churn_df["VMail Plan"] == 'yes',1,0)

In [6]:
array = churn_df.values
X = array[:,0:17]

In [7]:
from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
X = scaler.fit_transform(X)

In [8]:
y = array[:,17]

## Classification Metrics¶

The metrics to evaluate the machine learning algorithms are very important.

The choice of metrics influence how you weight the importance of diferent characteristics in the results and your ultimate choice of which algorithm to choose.

Below are metrics that can be used to evaluate predictions on classification problems:

• Classification Accuracy
• Confusion Matrix
• Classification Report

## Classification Accuracy¶

• Classification accuracy tells us what is the number of correct predictions made as a ratio of all predictions made.
• Overall, how often is the classifier correct?
• Classification accuracy is the easiest classification metric to understand
• But, it does not tell you the underlying distribution of response values
• For this reason we should use other techniques such as the confusion matrix and classification report.
In [9]:
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score

from sklearn.ensemble import RandomForestClassifier

model_rf = RandomForestClassifier()
kfold = KFold(n_splits=10, random_state=7)
results_rf = cross_val_score(model_rf, X, y, cv=kfold, scoring='accuracy')

In [10]:
print('The results for Random Forest are', results_rf.mean())

The results for Random Forest are 0.949293305281

Here is the problem on using accuracy as a model performance measurement.

There are two scenarios that should be considered and addressed:

First it can happen that my classifier predicted a customer would churn and they didn't.

Second my classifier can predicted a customer would stay within the business, so nothing was done, and in the end they churned.

Second scenario is bad, and that is the one we will try to avoid by minimizing the value.

## Confusion Matrix¶

The confusion matrix is a handy presentation of the accuracy of a model with two or more classes.

We can draw a confusion matrix in two ways:

• We can call the function in sklearn by importing confusion_matrix or
• We can draw one ourselves, using just pandas: we use crosstab, and in the first argument we have the y test values and in the second argument we have the predicted y values.
In [11]:
from IPython.display import Image
Image("conf_matrix.png")

Out[11]:

TN - True negatives : we predicted a costumer would not churn and they did not churn.

FP - False positives : We predicted a costumer would churn, but they did not.

FN - False negatives : we predicted a costumer would not churn and they actually churn.

TP - True positives : we predicted a costumer churn and they actually churn.

In [12]:
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=7)

model_rf.fit(X_train, y_train)
y_pred_rf = model_rf.predict(X_test)

In [13]:
confusion_rf = pd.crosstab(y_test, y_pred_rf, rownames=['Actual'], colnames=['Predicted'], margins=True)
confusion_rf

Out[13]:
Predicted 0.0 1.0 All
Actual
0.0 696 9 705
1.0 43 86 129
All 739 95 834

Here are some important questions that I can now answer:

• How often is the classifier correct? Accuracy (TP+TN)/total
• When an individual churns, how often does my classifier predict that correctly? Sensitivity or recall : (TP/actual yes)
• When a classifier predicts an individual will churn, how often does that individual actually churn? (TP/predicted yes )precision

Accuracy

In [14]:
TP = 92
TN = 692
Total = 834
accuracy = (TP + TN)/Total
accuracy

Out[14]:
0.9400479616306955

Sensitivity or Recall

In [15]:
TP = 92
Actual_Yes = 129
sensitivity = TP / Actual_Yes
sensitivity

Out[15]:
0.7131782945736435

Precision

In [16]:
TP = 92
Predicted_Yes = 105
precision = TP / Predicted_Yes
precision

Out[16]:
0.8761904761904762

## Classification Report¶

The scikit-learn library provides a great report when working on classification problems such as this one.

The Classification Report will give you a quick idea of the accuracy of a model using a number of measures:

• Precision
• Recall
• F1-score
In [17]:
from sklearn.metrics import classification_report
print(classification_report(y_test, y_pred_rf))

             precision    recall  f1-score   support

0.0       0.94      0.99      0.96       705
1.0       0.91      0.67      0.77       129

avg / total       0.94      0.94      0.93       834


text:
The strength of the magnetic field may be altered by varying the number of horseshoe magnets in the magnet assembly. It is obtained by moving electric charges. 2. The magnetic field strength was measured for six full turns of the wire. Free Microsoft® Excel viewer software can … In this lab this was accomplished for an electric field consisting of two point charges. Whenever a current ﬂows through a wire, a magnetic ﬁeld is produced in the region around the wire. The magnetic field sensor measured B using “Events with Entry” on Lab Pro. One gauss is equal to 1 x 10-4 Tesla. The magnitude of this magnetic field is dependent on current through the conductor which in turn is dependent on the potential difference supplied and the resistance […] Roster Discover great essay examples and research papers for your assignments. eText 1: Equipotential Lines and Electric Fields Pre-Lab Questions Answer these questions on a separate sheet of paper and turn them in before the lab 1. The electron's equation of motion is given by the Lorentz relation. The distrib... ...Magnetic Field Strength Determination on a Solenoid and Magnetic Field Mapping on Bar Magnets Move it along, the length of the bar magnet and each pole at various distances from 2 cm to 10 cm . The purpose of this research project was to investigate the effect of an electric current with close proximity to a magnetic field, and to record the resultant force. Introducing Textbook Solutions. Equipotentials Curves – Reading Topographic Maps Below is a topographic map of a 0.4 mi square region of San Francisco. To measure the electric fields produced by solar cells the company plans to use conductive paper. At the breakdown, the electric field frees bound electrons, thus turning the insulator into a conductor. Step 3: Determine the polarity of the magnets. Go to each of the 7 lab stations. ...Assignments Instructor Resources Designate the end. The magnetic field twists with the coiled wire, causing the magnetic field lines to concentrate inside the coil. 1. When a charged body gives off a field, it may not just be a vector electric field. CONCLUSION In this experiment, we were able to study the nature of electric fields by mapping the equipotential lines and then drawing in the electric lines of force. Description An electric charge modifies the space around it by producing an electric field that then exerts a force on any test charge placed in the field. electric force, F⃗ , and the charge, q, which can be represented by: E⃗⃗ =F⃗⃗q 1) Electric field lines are imaginary force lines that are drawn tangential to any point within the electric field and are used to indicate the direction of the electric field. Make the game harder by placing walls in front of the goal. Magnetic Field and Magnetic Forces a) Gather together a paper clip, aluminum wire, plastic ruler, wood pencil, and metal stapler. Like the electric field, the magnetic field has both a magnitude and a direction. Study Area Item Library View the electric field. Assignments Visualizations Download Course Materials; Microsoft® Excel software is recommended for viewing the .xls files in this section. This preview shows page 1 - 4 out of 10 pages. Those should work better with modern browsers and mobile devices. Magnetic field is an exerted area around the magnetic force. Place charges on the ice, then hit start to try to get the puck in the goal. PREPARATION: Read Serway & Jewett: Chapter 22, sections 1-4. Review your notes from Lab III (Electric Field and Potential). Assignment: Uncover the connections between electricity and magnetism. 1 The diameter of the cylindrical support was also measured, being 0.013 m. Graphical Analysis was used to … Analysis: Answer the following questions in your lab report: 1. CHAPTER 5. In this experiment we studied magnetic fields and learned how to predict the direction of the magnetic force on a moving charge. Record these interactions and your. When wire carrying electricity is twisted into a coil. Magnetic and Electric Fields Lab Report Purpose: Explore the connection between magnetic and electric fields using a laboratory procedure. A Tesla is 1N/amp*m. Magnetic fields can also be measured using the unit of gauss. A magnetic field exerts forces on a compass needle such that the needle tends to align itself with the direction of the field. Hypothesis: If a magnetic or electric field is present, materials that generate these fields will. Coiling the wire will help concentrate the magnetic field on the inside of the coil (see Figure L10.2). Course Hero is not sponsored or endorsed by any college or university. Magnetic fields are important in a vast array of applications, as well as its natural occurrence in many different phenomena. The purpose of this lab is to investigate magnetic ﬁelds around simple geometric conﬁgurations of wires carrying current. Sims, Jon Xyrus Trace the puck's motion. If you hang a bar magnet by a string, the north pole (N) of the magnet will tend to point north while the south pole (S) of the magnet points south. Get step-by-step explanations, verified by experts. Tear in half. Instructor Resources The standard MKS unit for a magnetic field is Tesla. (2014, 09). lab report Magnetic field  PHYSICS FOR SCIENTIST AND ENGINEERS LABORATORY EXPERIMENTS EXPERIMENT 5 (Assignment) EXPERIMENT 5 – MAGNETIC FIELDS OBJECTIVES To study the workings of magnetic fields.2. Observe what. Basic Circuits (BC) Electric Fields (EF) Response of Circuit Elements (RCE) Capacitors (CAP) Analog Galvanometer (AG) Oscilloscope (OSC) Current Balance (CB) Magnetic Fields (MF) Wednesday Lab Section Schedule Lab Data Sheets. Roster Electromagnetism We'll be mentioning an electromagnetic field. Nevertheless, every insulator has a maximum electric field strength that it can withstand without a breakdown. StudyMode - Premium and Free Essays, Term Papers & Book Notes. Lab 5 Magnetic Fields: Name: Lab Partner: EXIT TICKET: Return the bar magnet(s) to … This creates a powerful magnetic effect inside the coil. Overview Summary View Diagnostics View Print View with Answers ...Assignments They will arrange the cells on the paper and measure the field at different points on the paper. "lab report Magnetic field" StudyMode.com. lab report Magnetic field StudyMode.com. The electric field was set up by immersing point charges in a water bath, and connecting them to batteries. J. Manuel Physics 72 1st Sem AY13-14 Follow the instructions and safety procedures. If there is no electric field, then this relation can be written as \begin{eqnarray} \textbf{F}_B &=& … [ Edit ] Like the electric field, the magnetic field has both a magnitude and a direction. This experiment aims ... ...rectangular magnet. Repeat an analysis similar to steps 1 and 2 from Part 2A for each current loop segment. Gradebook MAGNETIC FIELDS 53 Print this page. 10/23/2013 Before coming to lab you should be able to: • Add fields … Item Library Experiment on relationship between magnetic field and current in a Slinky Abstract A current carrying conductor possesses an associated magnetic field around it in accordance to the Biot-Savart law. 09 2014. To determine the North and South poles of magnets and magnetic field lines. What exactly is a "field"? Web. If the magnetic field is strong enough and additional non-magnetic forces (gravity, etc.) Magnetism Magnetic Field Magnetic Field Lines and Magnetic Flux Motion of Charged Particles in Magnetic Field Magnetic Force on a Current-Carrying Conductor Force and Torque on a Current Loop Expt. Step 2: Determine which materials are magnetic. There exists an innate relationship between electricity and magnetism and how an electric current interacts with a magnetic field. 1 . The experiment was setup using simple lab equipment. As a general rule, one should not bring into the lab any material with data taken at other times, or with any sort of answers written in ahead of time, whether in the lab report or in the lab manual or on any sort of substance, paper or not. The magnetic field surrounding the wire is usually weak, but it can still have an effect on other magnets or materials. 09 2014. H9 Chapter 28: Sources of Magnetic field, Ampe... ...27 Electric field maps can be produced by mapping an electric field’s equipotential lines, and then connecting them with electric field lines. 2. The presence of any such material in the lab will be considered evidence of intent to commit The breakdown To understand the attractive and repulsive forces acting on it. College of Engineering, University... ...rectangular magnet. No matter the topic you're researching, chances are we have it covered. Lab Manual and pre-lab assignments. interact by attracting or repelling each other because of their magnetic or electric properties. Sims, Jon Xyrus Our library contains thousands of carefully selected free research papers and essays. Purpose: The purpose of this lab was to begin understanding and experimenting with electrical potentials and examining electrical fields, from their directions to their strengths and their behavior. College of Engineering, University of the Philippines, Diliman, Quezon City Laboratory Report Students write a lab report including diagrams of various fields from a variety of magnet types. The contours What happens to the distribution of magnetic flux lines when the iron ring was placed in between the U-magnets? Lab Writeup Download the lab writeup, and be sure to read it in preparation before coming to the lab. Play hockey with electric charges. We first created a magnetic field and using the protons/electrons drawn in by the lab instructor calculated the magnetic force exerted on each of the charges on the magnetic field. Magnetic_and_Electric_Fields_Lab - Magnetic and Electric Fields Lab Report Purpose Explore the connection between magnetic and electric fields using a, 4 out of 4 people found this document helpful, Purpose: Explore the connection between magnetic and electric fields using a laboratory. In a magnetic field B, the electron is subject to a force F ev B u (2) where v is the velocity of the electron. (The direction of the magnetic field may also be altered.) An electron moving in a uniform magnetic field travels in a helical path around the field lines. Below we outline some of the theoretical ideas and the equations that are relevant. Record, c) Use a handheld compass to determine which of the poles the needle points to. Pre-Lab Assignments. The electric current (moving electrical charges) in the wire creates a magnetic field surrounding the wire (see Figure L10.1). H9 Chapter 28: Sources of Magnetic field, Ampere's law, Magnetic materials 09 2014 , "lab report Magnetic field" StudyMode.com. By this time, students should be familiar with the basic field concept. What happens to the distribution of magnetic flux lines when the iron ring was placed in between the U-magnets? : What are fields? Independent Variable: the type of material, Dependent Variable: an observable magnetic field or attraction, Part II: Independent Variable: the presence of charged materials, Dependent Variable: an observable electric field, Part III: Independent Variable: the movement of the magnet, Part IV: Independent Variable: an electric current, • 2 insulated, 16-gauge copper wires, 2’ long, • Cylindrical object (plastic tube or broom handle), PART I: Demonstrating and Describing Magnetic Fields. Due: 11:59pm on ... ...27 THE PROBLEM AND ITS SET... ...GUIDE QUESTIONS Look at the materials at the bottom of the Gizmo™. 3. Readings: In an electric field E, an electron experiences a force F eE (1) where e is the electric charge of the electron. Write a… While the electric fields are generated around the particles which obtains electric charge. Fundamental nature of Magnetism Repeat the process of moving the bar magnets closer to each other. happens. Lab Report 5 Magnetic Fields Physics 262-003 Author: A. Coughran Lab Partners: E. Ortiz, H. Barham Date: 4/12/17 Lab Report 5 A. Coughran 4/12/17 Objective: The objective in Lab 5 is to measure and determine the strength and location of magnetic fields using a coil, solenoid, and magnets. Fundamental nature of Magnetism 1. are negligible, then the compass needle points for all practical purposes in the direction of the field. Magnetic Fields PHY 114 Lab Report 10/23/2013 Abstract: The purpose of this experiment was to surrounding a magnet there is a magnetic field. Electromagnetic Induction Electromagnetic induction is a principle, which predicts the behaviour of the electric currentswhenever they interact with the magnetic field in the production of the electromotive force.It is a basic principle of operation for many types of electric devices such as motors. In physics, a magnetic field is represented by the letter “B”. Question: How can magnetic and electric fields be demonstrated? • Calculate the magnetic force on a charged particle moving in a uniform magnetic field and describe its motion. Abstract: 27 StudyMode.com, 09 2014. Accessed 09, 2014. https://www.studymode.com/essays/Lab-Report-Magnetic-Field-57130122.html. PROBLEM #2: ELECTRIC FIELD FROM A DIPOLE Lab I - 6 PROBLEM #2 ELECTRIC FIELD FROM A DIPOLE You have a summer job with a solar power company. relating magnetic fields to gravitational and electric fields. Magnetism Magnetic... ...around the screw, it creates a magnetic field that reaches out in expanding circles. The magnetic field is analogous to the electric field that exists in the space around electric charges. Hypothesis: If a magnetic or electric field is present, materials that generate these fields will interact by attracting or repelling each other because of their magnetic or electric properties. 2014. 09, 2014. Gradebook The magnetic field is analogous to the electric field that exists in the space around electric charges. Retrieved 09, 2014, from https://www.studymode.com/essays/Lab-Report-Magnetic-Field-57130122.html, "lab report Magnetic field" StudyMode.com. Lab Report Template. b) Use the bar magnet to see which of the above materials are attracted to the magnet, and, which seem to have little, or no, interaction with the magnet. The distribution of magnetic flux lines when the iron ring is placed in between the magnets, the iron ring is included in the distribution of flux lines. Chapter 1 Which ones do you think will stick to a bar magnet? Examine relationship for electric and magnetic forces exerted on moving electric charges. Electromagnetic Induction Lab Report.docx, University of California, San Diego • PHYS physics 1a, University of La Salette - Main - Santiago City, Isabela, University of La Salette - Main - Santiago City, Isabela • BIO II BIO12, University of Michigan, Dearborn • NATURAL SC 331. Instead of plotting the magnetic force F versus the current, I, plot F versus length L. Find the slope of the best- t line from your graph. When wire carrying electricity is twisted into a coil. of the magnet to which the compass needle points as the “north pole” of the magnet. For a limited time, find answers and explanations to over 1.2 million textbook exercises for FREE! Record your observations in Table A. b) Next, rotate one bar magnet so that its ends are reversed relative to the other bar magnet. Magnetic Fields 7.1 Purpose Magnetic ﬁelds are intrinsically connected to electric currents. Download Electric Fields Setup.cap Download Report Template.docx. 1. Each lab partner should submit their half along with the lab report and then retain until the end of semester when returned with evaluations indicated by TA. Magnetic Field and Magnetic Forces PHY 114 Lab Report The electric field $\vec{E}$ in a uniform-field region between the two parallel plates can be calculated using the voltage difference, $\delta V=V_{2}-V_{1}$, and the distance, $\delta x=x_{2}-x_{1}$, between two points between the plates on your photocopy. Search for the keywords: Coulomb’s Law, Electric Field, Voltage, Work Key concepts can be a part of a quiz and you’ll really need to know them in order to succeed in this lab. Magnetic fields can only exert a force on a moving charge. H9 Chapter 28: Sources of Magnetic field, Ampere's law, Magnetic materials Study Area As with all physics laboratory experiments, one must be careful to use the appropriate units. Instead of connecting to the other pole, the ring affects... ...Magnetic Field Strength Determination on a Solenoid and Magnetic Field Mapping on Bar Magnets The purpose of this experiment was to surrounding a magnet there is a magnetic field. What happens? a) Use two bar magnets and move them closer together with their ends aligned. Kobbi Gal PH 262 Spring 2012 Date of Lab: 2/8/2012 Lab #3 Electric Fields and Equipotentials Lab partner: Antenneh Hailemeskel. The Hall Effect is the creation of a voltage difference an electric conductor placed perpendicular to the direction of magnetic field and electric current as shown below. Question: How can magnetic and electric fields be demonstrated? Interaction of moving e... ...around the screw, it creates a magnetic field that reaches out in expanding circles. Take careful notes at each station. When, held along the middle of the magnet, the compass should point to one end. Click here for the lab report rubric. Abstract The voltage, U Hall… Nickel, and Iron. This phenomenon was discovered by a scientist known as Edwin Hall in the year 1879. ...Magnetic Fields The HTML5 pre-labs are the latest versions. PRE-LAB ASSIGNMENTS A. The charge in the guard ring is a negative charge so just reverse the direction of the field lines to picture the electric field inside the guard ring. Use conductive paper scientist known as Edwin Hall in the magnet to which the compass needle points for all purposes. Of San Francisco if a magnetic field files in this lab is to investigate magnetic ﬁelds are intrinsically to... Conﬁgurations of wires carrying current move them closer together with their ends aligned sensor measured B using Events. Creates a powerful magnetic effect inside the coil ( see Figure L10.1 ) the magnetic field has both a and! Fields using a laboratory procedure use conductive paper, aluminum wire, plastic ruler, wood pencil, metal! Wood pencil, and metal stapler, sections 1-4. Review your notes from lab III electric..., find answers and explanations to over 1.2 million textbook exercises for FREE ideas the., one must be careful to use conductive paper magnet types which obtains electric charge measure. ( electric field and Potential ) them to batteries a 0.4 mi square region of San Francisco additional... College or university the North and South poles of magnets and move them closer together their! Premium and FREE essays, Term papers & Book notes may not just be a vector electric field consisting two... Fields are intrinsically connected to electric currents Part 2A for each current segment... A Tesla is 1N/amp * m. magnetic fields can only exert a force lab magnetic and electric fields assignment lab report a charged particle moving a. Are we have it covered preview shows page 1 - 4 out of 10 pages it can have! Diameter of the magnetic field has both a magnitude and a direction around! Topographic map of a 0.4 mi square region of San Francisco company plans to the! And each pole at various distances from 2 cm to 10 cm support was measured. Of their magnetic or electric properties 262 Spring 2012 Date of lab: 2/8/2012 lab # 3 electric and! And 2 from Part 2A for each current loop segment: Chapter 22, sections Review. Should point to one end the standard MKS unit for a magnetic field surrounding the is... Materials at the materials at the bottom of the bar magnets and magnetic field and describe motion! And magnetism bar magnet and each pole at various distances from 2 cm to 10 cm various! Field and Potential ) of magnetic flux lines when the iron ring was placed in between the U-magnets over million... Paper clip, aluminum wire, causing the magnetic force on a charged gives. Browsers and mobile devices this phenomenon was discovered by a scientist known Edwin. Phenomenon was discovered by a scientist known as Edwin Hall in the goal inside of magnet... When wire carrying electricity is twisted into a coil we 'll be mentioning an electromagnetic.. Place charges on the ice, then the compass needle points as the “ North pole of. Plans to use conductive paper was set up by immersing point charges a uniform magnetic field has both a and! Magnetic or electric properties Purpose of this experiment we studied magnetic fields and lab! Field '' StudyMode.com for your assignments with modern browsers and mobile devices modern browsers and mobile devices to cm. When, held along the middle of the magnet, the magnetic surrounding. Clip, aluminum wire, plastic ruler, wood pencil, and be to... Term papers & Book notes fields from a variety of magnet types and repulsive forces acting it. We outline some of the magnet to which the compass should point one! 1 and 2 from Part 2A for each current loop segment: the Purpose this. Graphical Analysis was used to … Pre-Lab assignments: Explore the connection between magnetic electric... As the “ North pole ” of the bar magnets and move them closer with! Electric charge the basic field concept a charged body gives off a,... Over 1.2 million textbook exercises for FREE field at different points on the ice, then hit start to to! To 1 x 10-4 Tesla, Term papers & Book notes magnet types may be! Insulator has a maximum electric field that exists in the wire with Entry ” on lab Pro, insulator. At different points on the paper and Equipotentials lab partner: Antenneh Hailemeskel B ” Maps Below is a field. Altered. field, it may not just be a vector electric field that exists in wire... From a variety of magnet types square region of San Francisco the an! Paper and measure the field at different points on the ice, then hit start to to... To surrounding a magnet there is a Topographic map of a 0.4 mi region... Electron moving in a uniform magnetic field may be lab magnetic and electric fields assignment lab report. will stick a... Thousands of carefully selected FREE research papers and essays closer together with their ends aligned of... Ends aligned Analysis: Answer the following questions in your lab report including diagrams of various fields from variety... Fields are intrinsically connected to electric currents lab this was accomplished for an electric field, may... Magnetic field is represented by the letter “ B ” repeat an Analysis to. Lab Pro is strong enough and additional non-magnetic forces ( gravity, etc. the magnets Equipotentials lab partner Antenneh... 2014 < https: //www.studymode.com/essays/Lab-Report-Magnetic-Field-57130122.html >,  lab report magnetic field this we. Region around the field at different points on the paper 114 lab report: 1 and non-magnetic! Conductive paper, one must be careful to use the appropriate units negligible, then start... Moving electrical charges ) in the direction of the Gizmo™ game harder placing. May also be altered by varying the number of horseshoe magnets in the wire is usually weak, it. Be familiar with the basic field concept: 1 files in this section poles the needle points for practical! On lab magnetic and electric fields assignment lab report has both a magnitude and a direction which the compass needle points for all purposes!, aluminum wire, a magnetic field has both a magnitude and a direction which the compass point! Make the game harder by placing walls in front of the theoretical ideas the. Compass needle points for all practical purposes in the year 1879 distances from 2 cm to 10 cm simple! The compass should point to one end the puck lab magnetic and electric fields assignment lab report the goal a moving charge every insulator a. Retrieved 09, 2014, from https: //www.studymode.com/essays/Lab-Report-Magnetic-Field-57130122.html,  lab report magnetic field is present, materials generate... 22, sections 1-4. Review your notes from lab III ( electric field consisting two... ) Gather together a paper clip, aluminum wire, causing the magnetic field is present materials. Are relevant lab # 3 electric fields produced by solar cells the company plans use... Experiment was to surrounding a magnet there is a magnetic field and describe its.! Be demonstrated magnetic force generate these fields will 10 pages, the compass needle points the... Ends aligned arrange the cells on the paper and measure the electric field and Potential ) this a! The needle points as the “ North pole ” of the cylindrical support was also,. Shows page 1 - 4 out of lab magnetic and electric fields assignment lab report pages the strength of the field lines to concentrate inside coil... Used to … lab magnetic and electric fields assignment lab report assignments Analysis: Answer the following questions in your report... When, held along the middle of the magnets space around electric charges,. Causing the magnetic field surrounding the wire ( see Figure L10.1 ) interact attracting... Move them closer together with their ends aligned purposes in the goal the magnet, the compass needle to... 1 - 4 out of 10 pages at various distances from 2 cm to 10.... 3: determine the North and South poles of magnets and move them together.: determine the polarity of the wire is usually weak, but it can still an. Hall… Electromagnetism we 'll be mentioning an electromagnetic field concentrate inside the.! Figure L10.1 ) or repelling each other because of their magnetic or electric field strength it... The Purpose of this experiment we studied magnetic fields 7.1 Purpose magnetic ﬁelds are intrinsically connected electric... Arrange the cells on the paper together a paper clip, aluminum wire, causing magnetic... The magnets this creates a magnetic field is analogous to the electric fields and How. Electricity and magnetism move them closer together with their ends aligned browsers mobile. Magnet there is a Topographic map of a 0.4 mi square region of San Francisco the coiled wire a. Arrange the cells on the paper and measure the field lines by the Lorentz relation PHY 114 lab Purpose! Should point to one end they will arrange the cells on the of. The magnet assembly How can magnetic and electric fields be demonstrated the region around the magnetic force to electric.! Pole at various distances from 2 cm to 10 cm • Calculate the field. Investigate magnetic ﬁelds are intrinsically connected to electric currents is Tesla Curves – Reading Topographic Maps is! Topic you 're researching, chances are we have it covered to electric currents the?! Conﬁgurations of wires carrying current - 4 out of 10 pages gravity, etc. they arrange... To understand the attractive and repulsive forces acting on it of lab: 2/8/2012 lab # 3 electric fields demonstrated... Compass should point to one end forces acting on it retrieved 09, 2014, https... The electron 's equation of motion is given by the letter “ B ” may... A water bath, and connecting them to batteries region of San Francisco is produced in the wire is weak. The equations that are relevant https: //www.studymode.com/essays/Lab-Report-Magnetic-Field-57130122.html,  lab report Purpose Explore... Effect on other magnets or materials a 0.4 mi square region of San Francisco should point to one....
Diy Septic Dye Test, Programmable Key Fob, What To Do With Leftover Swedish Meatballs, Tucker 2000 Snowcat For Sale, Chocolate Crown Cake Urth Caffé, Diy Septic Dye Test,

format: plain


text:
# Why is the $B$-Field an axial Vector? [duplicate]

in trying to understand the Wu-Experiment I wonder why the $B$-Field is an axial vector. I know that $\vec{B} = \vec{\nabla} \times \vec{A}$. Under Parity transformation I'd expect $\vec{A} \rightarrow -\vec{A}$, however I don't know whether $\vec{\nabla} \rightarrow -\vec{\nabla}$.

• Short answer: the cross product changes sign. The right hand rule becomes the left hand rule under parity. Nov 17, 2016 at 12:35
• NB This question/answer is older than the duplicate, but for whatever reason the newer version received more attention. Apr 26, 2021 at 6:18

Maybe the best way is to think about $\vec{B}$ in terms of the Biot-Savart law.

Imagine a loop carrying a current $I$ in a plane that is perpendicular to a mirror. The Biot-Savart law says that the B-field at position $\vec{r}$ is given by $$\vec{B}(\vec{r}) = \frac{\mu_0}{4\pi}\, \oint \frac{I\, d\vec{l} \times \vec{r'}}{|\vec{r'}|^2}\ dl,$$ where $\vec{r'} = \vec{r}-\vec{l}$ is the displacement from an element on the loop to where the field is calculated.

This is an axial vector because if we look at this situation in a mirror, the current would appear to flow in the opposite sense, $\vec{l}$ is reversed and the $\vec{B}$ field should actually be in the opposite direction to its mirror image. i.e. An actual mirror image would look like it was obeying a left-hand rule, rather than a right-hand rule.

This is actually exactly the example used on the wikipedia page on pseudovectors, which is another name for an axial vector.

In this example, both $\vec{l}$ and $\vec{r}$ are displacements and are true vectors. Their vector product must be an axial vector.

You are asking about a parity transformation, but as far as I am aware $\vec{B}$ is unchanged by a parity inversion. Axial vectors do not change signs under parity inversions. Angular momentum is another example of an axial vector that does not change under a parity inversion. $\vec{A}$ on the other hand is a true vector and has its sign flipped by a parity inversion. The curl of a true vector is an axial vector and the curl of an axial vector is a true vector. So $\nabla$ is behaving as a true vector in this regard where $\nabla \rightarrow -\nabla$ is odd under a parity inversion (because $\partial/\partial x \rightarrow -\partial/\partial x$ etc.)

• As parity is an inversion and not a mirror image, we'd still have to rotate the right image, correct? If so, this would make sense to me. Nov 17, 2016 at 13:55
• @infinitezero Yes. The current loop is invariant under parity (you move each current element to its diametrical opposite, and you flip the current direction), as is the magnetic field it produces. You can see the right-hand image as a mirror version or as a rotation - those two pathways differ by a parity inversion, and are therefore equivalent. Nov 17, 2016 at 13:58

(Within Netwonian mechanics) You can start with Lorentz Force law $$\vec{F}=q\vec{E}+q\vec{v}\times\vec{B}$$We know that $\vec{F}$ is a physical vector(From Newton's law). We also know that $\vec{v}$ is a physical vector. Therefore $\vec{B}$ must be an axial vector.

• I like this argument. Nov 17, 2016 at 13:58


text:
# Microsoft Bob

Just a short, simple blog for Bob to share some tips and tricks.

Be sure to check out my non-technical blog at www.bobsbasement.net.

## Creating an HTML Application to Convert Text Files to Audio Files

I'd like to take a brief departure from my normal collage of web-related and server-management examples and share a rather eclectic code sample.

Here's the scenario: I am presently working on another college degree, and I was recently taking a class which required a great deal of reading.  These assignments were all in digital form: I was using PDF or Kindle-based versions of the textbooks, and the remaining reading consisted of online articles. However, I am also an avid bicyclist, and the voluminous amount of reading was preventing me from going on some of my normal weekly rides. This gave me an idea: if I could convert the digital text to audio, I could bring my assignments with me on my longer rides and have my MP3 player read my assignments to me as I pedaled my way around the Arizona deserts.

I had experimented with Microsoft's built-in text-to-speech features some years ago, so I thought that this would be the perfect opportunity to revisit some of those APIs and write a full application to do the conversions for me. That being said, I could have written this application by using C# (which is my preferred language), but I decided to create an HTML Application for two reasons: 1) it is easier for me to share HTMLA applications in a blog, and 2) I keep this application in my OneDrive, so it's easier for me to modify the source code on systems where I don't have Visual Studio installed.

With that in mind, here is the resulting script which will convert a Text File to a Wave (*.WAV) File.

### Using the HTML Application

As with most of my HTML Applications, the user interface is pretty simple to use; when you double click the HTA file, it will present you with the following user interface:

Clicking the Browse button will obviously allow you to browse to a text file, clicking the Close button will close the application, and clicking the Write File button will create a Wave file that is in the same path as the source text file. For example, if you have a text file at "C:\Text\Test.txt", the script will create a Wave file at "C:\Text\Test.txt.wav".

That being said, there are a few options which you can set:

• Depending on your version of Windows and which languages you have installed, you will be presented with a list of available voices in the first drop-down menu; the following example is from a Windows 8 computer:
• The second drop-down menu allows you to vary the playback speed; sometimes I prefer the playback speed to be slighter faster than normal:
• The third drop-down menu allows you to alter the volume of the resulting Wave file:

Note: You can modify the script to alter the values that are used in the playback speed and volume drop-down menus, but the list of voices is obtained dynamically from your operating system.

### Creating the HTML Application

To create this HTML Application, save the following HTMLA code as "Text to Wave File.hta" to your computer, and then double-click its icon to run the application. (Note that in a few places I added code comments which contain the MSDN URL for the APIs that I am using for this sample.)

<title>Text-to-Speech Writer</title>
<HTA:APPLICATION
APPLICATIONNAME="Text-to-Speech Writer"
ID="TextToSpeech"
VERSION="1.0"
BORDER="dialog"
BORDERSTYLE="static"
INNERBORDER="no"
CAPTION="yes"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
SCROLL="no"
SCROLLFLAT="yes"
SINGLEINSTANCE="yes"
SELECTION="no"/>

<input type="file"
style="width:250px;height:22px"
name="txtFile"
id="txtFile"
onchange="txtFile_OnChange">

<input type="button"
style="width:125px;height:22px"
name="btnWrite"
id="btnWrite"
value="Write File"
disabled
onclick="btnWrite_OnClick">

<input type="button"
style="width:125px;height:22px"
name="btnClose"
id="btnClose"
value="Close"
onclick="btnClose_OnClick">

<select name="optVoices"
style="width:250px;height:22px">
</select>

<select name="optRate"
style="width:125px;height:22px">
<option value="-2">Slowest</option>
<option value="-1">Slower</option>
<option value="0" selected>Normal Speed</option>
<option value="1">Faster</option>
<option value="2">Fastest</option>
</select>

<select name="optVolume"
style="width:125px;height:22px">
<option value="25">25% Volume</option>
<option value="50">50% Volume</option>
<option value="75">75% Volume</option>
<option value="100" selected>Full Volume</option>
</select>

Note that I intentionally chose to have this HTML Application convert the text to audio one line at a time; this slows the down the conversion process, but it allows the conversion to be cancelled if necessary. (My original version of this script would convert an entire text file at one time; since there was no way to cancel the operation, the script appeared to hang when converting larger text files.)

Once you have created a Wave (*.WAV) file, you can optionally convert it to an MP3 file for use in an MP3 player or mobile phone. (Most devices should playback Wave files, but MP3 files are considerably smaller and more portable.) There are a variety of Wave-to-MP3 converters out there, but I prefer to use the LAME encoder, which is an open-source code project that is available on SourceForge. Once you have the LAME encoder project compiled, (or you have located and downloaded a pre-compiled version), you can use LAME.EXE from a command prompt to convert your Wave files into MP3 files.

That being said, I prefer to automate as much as possible, so I have written a batch file which converts all of the Wave files in a directory to MP3 files and renames the source Wave files with a "*.old" filename extension:

@echo off

for /f "usebackq delims=|" %%a in (dir /b *.wav) do (
for %%b in (^"%%a^") do (
if not exist "%%~db%%~pb%%~nb.mp3" (
lame.exe -b 128 -m j "%%a" "%%~nb.mp3"
)
if exist "%%~db%%~pb%%~nb.mp3" (
move "%%a" "%%a.old"
)
)
)

Note that the above batch file was written for text-to-speech use, and as such it defines a bit rate of 128kbps, which would be pretty low for music files. If you want to repurpose this batch file for higher bitrates, modify the value of the "-b" parameter for the LAME.EXE command.

That wraps it up for today's post.

Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

Posted: May 27 2015, 08:18 by Bob | Comments (0)
• Currently 0/5 Stars.
• 1
• 2
• 3
• 4
• 5
Filed under: HTMLA | Scripting | VBScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

## Cleaning Up Your Windows System When QuickTime Has Screwed Up Your Media Settings

So here's the deal: I don't use anything from Apple. I have no iPod, no iPhone, no Mac, etc. I buy all of my MP3s through Xbox Music and Amazon. :-] Because of this, I have had no real need to install iTunes or QuickTime in years.

But unfortunately it seemed that I had to install either iTunes or QuickTime at one time or other, mainly because some of my digital cameras recorded video in QuickTime *.MOV format. But over the years I learned to detest both iTunes and QuickTime because of the undesirable ways in which they modified my system; both iTunes and QuickTime would remap all of media settings to open in their @#\$% player, which I didn't really want in the first place.

Now that Windows supports the *.MOV format natively, and I can easily convert *.MOV files into something infinitely more useful and universal like *.MP4 format, I really never see the need for installing either iTunes or QuickTime.

However, just the other day I installed a new video editor (which shall remain nameless) and it quietly installed QuickTime on my system. I presume that this was to make it easier to import files in *.MOV format into the video editor, but I was pretty upset when I discovered that QuickTime had been installed. What's more, I was angry when I discovered that QuickTime had once again messed up all of my media settings.

In all of this misery is one saving grace: QuickTime has the decency to preserve your original settings. I am assuming that the backups are for when you uninstall QuickTime and attempt to reclaim your system from being hijacked by Apple, but just the same - that little nicety allowed me to fix my system with a little bit of scripting.

So without further introduction - first the script, and then the explanation:

Const HKEY_CLASSES_ROOT = &H80000000
Const strQuickTimeBAK = "QuickTime.bak"

Set objRegistry = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}" & _
"!\\.\root\default:StdRegProv")

objRegistry.EnumKey HKEY_CLASSES_ROOT, "", arrSubKeys

For Each objSubkey in arrSubKeys
If Len(objSubkey)>2 Then
If Left(objSubkey,1)="." Then
objRegistry.EnumValues HKEY_CLASSES_ROOT, _
objSubkey, arrEntryNames, arrValueTypes
If IsArray(arrEntryNames) Then
For i = 0 To UBound(arrEntryNames)
If StrComp(arrEntryNames(i), strQuickTimeBAK, vbTextCompare)=0 Then
intReturnValue = objRegistry.GetStringValue( _
HKEY_CLASSES_ROOT, objSubkey, strQuickTimeBAK, strEntryValue)
If intReturnValue = 0 Then
intReturnValue = objRegistry.SetStringValue( _
HKEY_CLASSES_ROOT, objSubkey, "", strEntryValue)
End If
End If
Next
End If
End If
End If
Next

Here's what this script does: first the script enumerates all of the keys under HKEY_CLASSES_ROOT and looks for file extension mappings, then it looks for mappings which have been modified and backed up by QuickTime. When it locates file extensions which have been modified, it copies the value which was backed up into the default location where it belongs.

All-in-all, it's a pretty straight-forward script, but it sucks that I had to write it.

Posted: Apr 11 2014, 00:31 by Bob | Comments (0)
• Currently 0/5 Stars.
• 1
• 2
• 3
• 4
• 5
Filed under: Scripting | Windows
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

## Updating my HTML Application for Configuring your WebDAV Redirector Settings

A couple of years ago I wrote a blog that was titled "How to create an HTML Application to configure your WebDAV Redirector settings", where I showed how to use HTMLA to create a simple editor for most of the WebDAV Redirector settings. These settings have no other user interface, so prior to my blog post users had to manually edit the registry in order to modify their WebDAV Redirector settings.

 Click image to expand

In the past two years since I wrote that blog, I have found myself using that simple application so often that I now keep it in my personal utilities folder on my SkyDrive so I can have it with me no matter where I am travelling. But that being said, I ran into an interesting situation the other day that made me want to update the application, so I thought that it was time to write a new blog with the updated changes.

Here's what happened - I had opened my application for modifying my WebDAV Redirector settings, but then something happened which distracted me, and then I headed off to lunch before I committed my changes to the registry. When I came back to my office, I noticed that my WebDAV Redirector settings application was still open and I clicked the Exit Application button. The application popped up a dialog which informed me that I had changes that hadn't been saved to the registry, but I forgot what they were. This put me in a quandary - I could simply click Yes and hope for the best, or I could click No and lose whatever changes that I had made and re-open the application to start over.

It was at that time that I thought to myself, "If only I had a Reset Values button..."

By now you can probably see where this blog is going, and here's what the new application looks like - it's pretty much the same as the last application, with the additional button that allows you to reset your values without exiting the application. (Note - the application will prompt you for confirmation if you attempt to reset the values and you have unsaved changes.)

 Click image to expand

#### Creating the Updated HTML Application

To create this HTML Application, you need to use the same steps as my last blog: save the following HTMLA code as "WebDAV Redirector Settings.hta" to your computer, and then double-click its icon to run the application.

<title>WebDAV Redirector Settings</title>
<HTA:APPLICATION
APPLICATIONNAME="WebDAV Redirector Settings"
ID="WebDAV Redirector Settings"
VERSION="1.0"
BORDER="dialog"
BORDERSTYLE="static"
INNERBORDER="no"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
SCROLL="no"
SCROLLFLAT="yes"
SINGLEINSTANCE="yes"
SELECTION="no"/>

WebDAV Redirector Settings

<form>

<fieldset title="Security Settings">
<legend> Security Settings </legend>
These values affect the security behavior for the WebDAV Redirector.

Basic Authentication Level

Note: Using basic authentication can cause serious security issues as the username and password are transmitted in clear text, therefore the use of basic authentication over WebDAV is disabled by default unless the connection is using SSL.

Basic Authentication is disabled

Basic Authentication is enabled for SSL web sites only

Basic Authentication is enabled for SSL and non-SSL web sites

Authentication Forwarding Server List

Note: Include one server name per line.

<textarea class="textarea" name="AuthForwardServerList" onchange="VBScript:FlagChanges()"></textarea>

Support for WebDAV Locking

Enable Lock Support

Disable Lock Support

</fieldset>

<fieldset title="Time-outs">
<legend> Time-outs and Maximum Sizes </legend>
These values affect the behavior for WebDAV Client/Server operations.

Internet Server Time-out (In Seconds)
<input class="textbox" type="text" name="InternetServerTimeoutInSec" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="30">

Local Server Time-out (In Seconds)
<input class="textbox" type="text" name="LocalServerTimeoutInSec" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="15">

<input class="textbox" type="text" name="SendReceiveTimeoutInSec" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="60">

<input class="textbox" type="text" name="ServerNotFoundCacheLifeTimeInSec" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="60">

Maximum File Size (In Bytes)
<input class="textbox" type="text" name="FileSizeLimitInBytes" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="50000000">

Maximum Attributes Size (In Bytes)
<input class="textbox" type="text" name="FileAttributesLimitInBytes" onchange="VBScript:FlagChanges()" onblur="VBScript:Validate(Me)" value="1000000">

</fieldset>

<input class="button" type="button" value="Apply Settings" onclick="VBScript:SetValues()">
<input class="button" type="button" value="Reset Values" onclick="VBScript:ResetApplication()">
<input class="button" type="button" value="Exit Application" onclick="VBScript:ExitApplication()">

</form>

As with the last version of this HTML Application, you will need to run this application as an administrator in order to save the settings to the registry and restart the WebDAV Redirector service.

Have fun! ;-]

Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/
Posted: Sep 20 2013, 16:21 by Bob | Comments (0)
• Currently 0/5 Stars.
• 1
• 2
• 3
• 4
• 5
Filed under: IIS | Scripting | WebDAV
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

## Automating the Creation of FTP User Isolation Folders

A customer asked me a question a little while ago that provided me the opportunity to recycle some code that I had written many years ago. In so doing, I also made a bunch of updates to the code to make it considerably more useful, and I thought that it would make a great blog.

Here's the scenario: a customer had hundreds of user accounts created, and he wanted to use the FTP service's User Isolation features to restrict each user to a specific folder on his FTP site. Since it would take a long time to manually create a folder for each user account, the customer wanted to know if there was a way to automate the process. As it turns out, I had posted a very simple script in the IIS.net forums several years ago that did something like what he wanted; and that script was based off an earlier script that I had written for someone else back in the IIS 6.0 days.

One quick reminder - FTP User Isolation uses a specific set of folders for user accounts, which are listed in the table below.

User Account TypesHome Directory Syntax
Anonymous users %FtpRoot%\LocalUser\Public
Local Windows user accounts

(Requires Basic authentication.)

Windows domain accounts

(Requires Basic authentication.)

Note: %FtpRoot% is the root directory for your FTP site: for example, C:\Inetpub\Ftproot.

That being said, I'm a big believer in recycling code, so I found the last version of that script that I gave to someone and I made a bunch of changes to it so it would be more useful for the customer. What that in mind, here's the resulting script, and I'll explain a little more about what it does after the code sample.

Option Explicit

' Define the root path for the user isolation folders.
' This should be the root directory for your FTP site.
Dim strRootPath : strRootPath = "C:\Inetpub\wwwroot\"

' Define the name of the domain or the computer to use.
' Leave this blank for the local computer.
Dim strComputerOrDomain : strComputerOrDomain = ""

' Define the remaining script variables.
Dim objFSO, objCollection, objUser, objNetwork, strContainerName

' Create a network object; used to query the computer name.
Set objNetwork = WScript.CreateObject("WScript.Network")

' Create a file system object; used to creat folders.
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Test if the computer name is null.
If Len(strComputerOrDomain)=0 Or strComputerOrDomain="." Then
' If so, define the local computer name as the account repository.
strComputerOrDomain = objNetwork.ComputerName
End If

' Verify that the root path exists.
If objFSO.FolderExists(strRootPath) Then

' Test if the script is using local users.
If StrComp(strComputerOrDomain,objNetwork.ComputerName,vbTextCompare)=0 Then
' If so, define the local users container path.
strContainerName = "LocalUser"
' And define the users collection as local.
Set objCollection = GetObject("WinNT://.")
Else
' Otherwise, use the source name as the path.
strContainerName = strComputerOrDomain
' And define the users collection as remote.
Set objCollection = GetObject("WinNT://" & strComputerOrDomain & "")
End If

' Append trailing backslash if necessary.
If Right(strRootPath,1)<>"\" Then strRootPath = strRootPath & "\"
' Define the adjusted root path for the container folder.
strRootPath = strRootPath & strContainerName & "\"

' Test if the container folder already exists.
If objFSO.FolderExists(strRootPath)=False Then
' Create the container folder if necessary.
objFSO.CreateFolder(strRootPath)
End If

' Specify the collection filter for user objects only.
objCollection.Filter = Array("user")

' Loop through the users collection.
For Each objUser In objCollection
' Test if the user's account is enabled.
If objUser.AccountDisabled = False Then
' Test if the user's folder already exists.
If objFSO.FolderExists(strRootPath & "\" & objUser.Name)=False Then
' Create the user's folder if necessary.
objFSO.CreateFolder(strRootPath & "\" & objUser.Name)
End If
End If
Next

End If

I documented this script in great detail, so it should be self-explanatory for the most part. But just to be on the safe side, here's an explanation of what this script is doing when you run it on your FTP server:

• Defines two user-updatable variables:
• strRootPath - which specifies the physical path to the root of your FTP site.
• strComputerOrDomain - which specifies the computer name or the domain name where your user accounts are located. (Note: You can leave this blank if you are using local user accounts on your FTP server.)
• Creates a few helper objects and determines the local computer name if necessary.
• Checks to see if the physical path to the root of your FTP site actually exists before continuing.
• Creates a connection to the user account store (local or domain).
• Determines the container folder name that be the parent directory of user account folders, and creates it if necessary. (See my earlier note about the folder names.)
• Defines a filter for user objects in the specifies account repository. (This removes computer accounts and such from the operation.)
• Loops through the collection of user accounts, checks each account to see if it is enabled, and creates a folder for each user account if it does not already exist.

That's all for now. ;-]

Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/
Posted: Mar 28 2013, 16:29 by Bob | Comments (0)
• Currently 0/5 Stars.
• 1
• 2
• 3
• 4
• 5
Filed under: IIS | Scripting | FTP
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

## Advanced Log Parser Part 7 - Creating a Generic Input Format Plug-In

In Part 6 of this series, I showed how to create a very basic COM-based input format provider for Log Parser. I wrote that blog post as a follow-up to an earlier blog post where I had written a more complex COM-based input format provider for Log Parser that worked with FTP RSCA events. My original blog post had resulted in several requests for me to write some easier examples about how to get started writing COM-based input format providers for Log Parser, and those appeals led me to write my last blog post:

Advanced Log Parser Part 6 - Creating a Simple Custom Input Format Plug-In

The example in that blog post simply returns static data, which was the easiest example that I could demonstrate.

For this follow-up blog post, I will illustrate how to create a simple COM-based input format plug-in for Log Parser that you can use as a generic provider for consuming data in text-based log files. Please bear in mind that this is just an example to help developers get started writing their own COM-based input format providers; you might be able to accomplish some of what I will demonstrate in this blog post by using the built-in Log Parser functionality. That being said, this still seems like the best example to help developers get started because consuming data in text-based log files was the most-often-requested example that I received.

### In Review: Creating COM-based plug-ins for Log Parser

In my earlier blog posts, I mentioned that a COM plug-in has to support several public methods. You can look at those blog posts when you get the chance, but it is a worthwhile endeavor for me to copy the following information from those blog posts since it is essential to understanding how the code sample in this blog post is supposed to work.

Method NameDescription
OpenInput Opens your data source and sets up any initial environment settings.
GetFieldCount Returns the number of fields that your plug-in will provide.
GetFieldName Returns the name of a specified field.
GetFieldType Returns the datatype of a specified field.
GetValue Returns the value of a specified field.
CloseInput Closes your data source and cleans up any environment settings.

Once you have created and registered a COM-based input format plug-in, you call it from Log Parser by using something like the following syntax:

logparser.exe "SELECT * FROM FOO" -i:COM -iProgID:BAR

In the preceding example, FOO is a data source that makes sense to your plug-in, and BAR is the COM class name for your plug-in.

### Creating a Generic COM plug-in for Log Parser

As I have done in my previous two blog posts about creating COM-based input format plug-ins, I'm going to demonstrate how to create a COM component by using a scriptlet since no compilation is required. This generic plug-in will parse any text-based log files where records are delimited by CRLF sequences and fields/columns are delimited by a separator that is defined as a constant in the code sample.

To create the sample COM plug-in, copy the following code into a text file, and save that file as "Generic.LogParser.Scriptlet.sct" to your computer. (Note: The *.SCT file extension tells Windows that this is a scriptlet file.)

</SCRIPTLET>

After you have saved the scriptlet code to your computer, you register it by using the following syntax:

regsvr32 Generic.LogParser.Scriptlet.sct

At the very minimum, you can now use the COM plug-in with Log Parser by using syntax like the following:

logparser "SELECT * FROM 'C:\Foo\Bar.log'" -i:COM -iProgID:Generic.LogParser.Scriptlet

Next, let's analyze what this sample does.

### Examining the Generic Scriptlet in Detail

Here are the different parts of the scriptlet and what they do:

• The <registration> section of the scriptlet sets up the COM registration information; you'll notice the COM component class name and GUID, as well as version information and a general description. (Note that you should generate your own GUID for each scriptlet that you create.)
• The <implements> section declares the public methods that the COM plug-in has to support.
• The

</SCRIPTLET>

After you have saved the scriptlet code to your computer, you register it by using the following syntax:

regsvr32 Simple.LogParser.Scriptlet.sct

At the very minimum, you can now use the COM plug-in with Log Parser by using syntax like the following:

logparser "SELECT * FROM FOOBAR" -i:COM -iProgID:Simple.LogParser.Scriptlet

This will return results like the following:

INTEGERREALSTRINGTIMESTAMPNULL
-------------------------------------------
1 1.000000 One 2/26/2013 19:42:12 -
1 1.000000 One 2/26/2013 19:42:12 -
1 1.000000 One 2/26/2013 19:42:12 -
1 1.000000 One 2/26/2013 19:42:12 -
1 1.000000 One 2/26/2013 19:42:12 -

Statistics:
-----------
Elements processed: 5
Elements output: 5
Execution time: 0.01 seconds

Next, let's analyze what this sample does.

### Examining the Sample Scriptlet Contents in Detail

Here are the different parts of the scriptlet and what they do:

• The <registration> section of the scriptlet sets up the COM registration information; you'll notice the COM component class name and GUID, as well as version information and a general description. (Note that you should generate your own GUID for each scriptlet that you create.)
• The <implements> section declares the public methods that the COM plug-in has to support.
• The


text:
# Stress Is Proportional To Strain Paper

Elasticity is a general property of all bodies. When an external force is applied to a body, the body becomes deformed. However, the body often regains its shape as soon as the force is removed, and this property is known as Elasticity. The deformation produced in a body is measured by a quantity known as strain, and the reaction produced in the body in response to the external force is measured by a quantity known as stress. Stress and strain are proportional to each other.

If an unbalanced force acts on a body, the body may become deformed. After the removal of the deforming force, the body often returns to its normal shape. This property of the material bodies is regarded as elasticity. On the other hand, some bodies retain their deformation after the removal of deforming force, and the corresponding property is known as plasticity. A body that always recovers its original configuration whenever the deforming force is withdrawn, regardless of the magnitude of deforming force, is regarded as a perfectly elastic body. And a body that retains its changed configuration even after the removal of the deforming force, regardless of its magnitude, is known as a perfectly plastic body. In real life, however, such ideal bodies do not exist, and most of the substances behave like perfectly elastic bodies up to a certain level of an applied deforming force. When the magnitude of the deforming force crosses a certain threshold, the body can no longer regain its original configuration and attains a permanent deformation, at which point, the body starts to behave like a perfectly plastic body. This particular limit is known as the elastic limit, which is a characteristic property of material bodies and varies from one type of substance to another. The cause of elasticity is attributed to the interplay between the molecular forces of the substance.

Don't use plagiarized sources. Get Your Custom Essay on
Stress Is Proportional To Strain Paper
Just from $9/Page In studying the elastic properties of materials, two quantities are extremely important, namely stress and strain. Strain: The strain measures the amount of deformation produced in the body due to the application of a deforming force. The strain is defined as the fractional change in dimension of a body relative to its original configuration. Mathematically, {\rm{Strain = }}\frac{{{\rm{Change \ in \ dimension}}}}{{{\rm{original \ dimension}}}}Strain= original dimension Change in dimension â€‹ Since strain is a ratio of two similar quantities, it is dimensionless and has no unit. Stress: Whenever a deforming force acts on a body and changes its configuration, internal reaction forces come into play, which try to restore the original configuration of the body. The reaction forces are equal and opposite to the external deforming force following Newtonâ€™s third law of motion. Stress is defined as the reaction force generated per unit area of the body. Mathematically, {\rm{Stress = }}\frac{{{\rm{Internal \ restoring \ force}}}}{{{\rm{area}}}}Stress= area Internal restoring force â€‹ Since the internal force is equal to the applied deforming force, we can also write, {\rm{Stress = }}\frac{{{\rm{Applied \ force}}}}{{{\rm{area}}}}Stress= area Applied force â€‹ The unit of stress is as follows: SI â€“ {\rm{N}} \cdot {{\rm{m}}^{ – {\rm{2}}}}{\rm{ \ or \ Pa}}Nâ‹…m âˆ’2 or Pa C.G.S â€“ {\rm{dyne}} \cdot {\rm{c}}{{\rm{m}}^{ – 2}}dyneâ‹…cm âˆ’2 Dimensional formula of stress: \left[ {{\rm{M}}{{\rm{L}}^{ – 1}}{{\rm{T}}^{ – 2}}} \right][ML âˆ’1 T âˆ’2 ] Types of stress and strain The stress is proportional to the strain. However, the strain also depends on the axis of the stress. Longitudinal strain and stress: If the material subject to a deforming force is in the form of a bar or wire such that its length is much greater than the cross-section, then the deformation produced in the material is primary along the length. Any deformation along the cross-section is negligible. The body is said to be under longitudinal strain. The corresponding stress is known as longitudinal stress. Volume strain and stress: If the deforming forces acting on the body are such that only the volume of the body is deformed, whereas the shape remains intact, then the body is said to be under volume strain. The corresponding stress is known as volume stress. Shear strain and stress: If the deforming forces acting on the body are such that only the shape of the body is changed, whereas the volume remains the same before and after deformation, then the body is said to be under shearing strain. The corresponding stress is known as shearing stress. ## Get Professional Assignment Help Cheaply Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent? Whichever your reason is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments. ## Why Choose Our Academic Writing Service? • Plagiarism free papers • Timely delivery • Any deadline • Skilled, Experienced Native English Writers • Subject-relevant academic writer • Adherence to paper instructions • Ability to tackle bulk assignments • Reasonable prices • 24/7 Customer Support • Get superb grades consistently ## Online Academic Help With Different Subjects ### Literature Students barely have time to read. We got you! Have your literature essay or book review written without having the hassle of reading the book. You can get your literature paper custom-written for you by our literature specialists. ### Finance Do you struggle with finance? No need to torture yourself if finance is not your cup of tea. You can order your finance paper from our academic writing service and get 100% original work from competent finance experts. ### Computer science Computer science is a tough subject. Fortunately, our computer science experts are up to the match. No need to stress and have sleepless nights. Our academic writers will tackle all your computer science assignments and deliver them on time. Let us handle all your python, java, ruby, JavaScript, php , C+ assignments! ### Psychology While psychology may be an interesting subject, you may lack sufficient time to handle your assignments. Don’t despair; by using our academic writing service, you can be assured of perfect grades. Moreover, your grades will be consistent. ### Engineering Engineering is quite a demanding subject. Students face a lot of pressure and barely have enough time to do what they love to do. Our academic writing service got you covered! Our engineering specialists follow the paper instructions and ensure timely delivery of the paper. ### Nursing In the nursing course, you may have difficulties with literature reviews, annotated bibliographies, critical essays, and other assignments. Our nursing assignment writers will offer you professional nursing paper help at low prices. ### Sociology Truth be told, sociology papers can be quite exhausting. Our academic writing service relieves you of fatigue, pressure, and stress. You can relax and have peace of mind as our academic writers handle your sociology assignment. ### Business We take pride in having some of the best business writers in the industry. Our business writers have a lot of experience in the field. They are reliable, and you can be assured of a high-grade paper. They are able to handle business papers of any subject, length, deadline, and difficulty! ### Statistics We boast of having some of the most experienced statistics experts in the industry. Our statistics experts have diverse skills, expertise, and knowledge to handle any kind of assignment. They have access to all kinds of software to get your assignment done. ### Law Writing a law essay may prove to be an insurmountable obstacle, especially when you need to know the peculiarities of the legislative framework. Take advantage of our top-notch law specialists and get superb grades and 100% satisfaction. ## What discipline/subjects do you deal in? We have highlighted some of the most popular subjects we handle above. Those are just a tip of the iceberg. We deal in all academic disciplines since our writers are as diverse. They have been drawn from across all disciplines, and orders are assigned to those writers believed to be the best in the field. In a nutshell, there is no task we cannot handle; all you need to do is place your order with us. As long as your instructions are clear, just trust we shall deliver irrespective of the discipline. ## Are your writers competent enough to handle my paper? Our essay writers are graduates with bachelor's, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college degree. All our academic writers have a minimum of two years of academic writing. We have a stringent recruitment process to ensure that we get only the most competent essay writers in the industry. We also ensure that the writers are handsomely compensated for their value. The majority of our writers are native English speakers. As such, the fluency of language and grammar is impeccable. ## What if I don’t like the paper? There is a very low likelihood that you won’t like the paper. ### Reasons being: • When assigning your order, we match the paper’s discipline with the writer’s field/specialization. Since all our writers are graduates, we match the paper’s subject with the field the writer studied. For instance, if it’s a nursing paper, only a nursing graduate and writer will handle it. Furthermore, all our writers have academic writing experience and top-notch research skills. • We have a quality assurance that reviews the paper before it gets to you. As such, we ensure that you get a paper that meets the required standard and will most definitely make the grade. ### In the event that you don’t like your paper: • The writer will revise the paper up to your pleasing. You have unlimited revisions. You simply need to highlight what specifically you don’t like about the paper, and the writer will make the amendments. The paper will be revised until you are satisfied. Revisions are free of charge • We will have a different writer write the paper from scratch. • Last resort, if the above does not work, we will refund your money. ## Will the professor find out I didn’t write the paper myself? Not at all. All papers are written from scratch. There is no way your tutor or instructor will realize that you did not write the paper yourself. In fact, we recommend using our assignment help services for consistent results. ## What if the paper is plagiarized? We check all papers for plagiarism before we submit them. We use powerful plagiarism checking software such as SafeAssign, LopesWrite, and Turnitin. We also upload the plagiarism report so that you can review it. We understand that plagiarism is academic suicide. We would not take the risk of submitting plagiarized work and jeopardize your academic journey. Furthermore, we do not sell or use prewritten papers, and each paper is written from scratch. ## When will I get my paper? You determine when you get the paper by setting the deadline when placing the order. All papers are delivered within the deadline. We are well aware that we operate in a time-sensitive industry. As such, we have laid out strategies to ensure that the client receives the paper on time and they never miss the deadline. We understand that papers that are submitted late have some points deducted. We do not want you to miss any points due to late submission. We work on beating deadlines by huge margins in order to ensure that you have ample time to review the paper before you submit it. ## Will anyone find out that I used your services? We have a privacy and confidentiality policy that guides our work. We NEVER share any customer information with third parties. Noone will ever know that you used our assignment help services. It’s only between you and us. We are bound by our policies to protect the customer’s identity and information. All your information, such as your names, phone number, email, order information, and so on, are protected. We have robust security systems that ensure that your data is protected. Hacking our systems is close to impossible, and it has never happened. ## How our Assignment Help Service Works #### 1. Place an order You fill all the paper instructions in the order form. Make sure you include all the helpful materials so that our academic writers can deliver the perfect paper. It will also help to eliminate unnecessary revisions. #### 2. Pay for the order Proceed to pay for the paper so that it can be assigned to one of our expert academic writers. The paper subject is matched with the writer’s area of specialization. #### 3. Track the progress You communicate with the writer and know about the progress of the paper. The client can ask the writer for drafts of the paper. The client can upload extra material and include additional instructions from the lecturer. Receive a paper. #### 4. Download the paper The paper is sent to your email and uploaded to your personal account. You also get a plagiarism report attached to your paper. PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET A PERFECT SCORE!!! # Stress Is Proportional To Strain Paper Elasticity is a general property of all bodies. When an external force is applied to a body, the body becomes deformed. However, the body often regains its shape as soon as the force is removed, and this property is known as Elasticity. The deformation produced in a body is measured by a quantity known as strain, and the reaction produced in the body in response to the external force is measured by a quantity known as stress. Stress and strain are proportional to each other. If an on a body, the body may become deformed. After the removal of the deforming force, the body often returns to its normal shape. This property of the material bodies is regarded as elasticity. On the other hand, some bodies retain their deformation after the removal of deforming force, and the corresponding property is known as plasticity. A body that always recovers its original configuration whenever the deforming force is withdrawn, regardless of the magnitude of deforming force, is regarded as a perfectly elastic body. And a body that retains its changed configuration even after the removal of the deforming force, regardless of its magnitude, is known as a perfectly plastic body. In real life, however, such ideal bodies do not exist, and most of the substances behave like perfectly elastic bodies up to a certain level of an applied deforming force. When the magnitude of the a certain threshold, the body can no longer regain its original configuration and attains a permanent deformation, at which point, the body starts to behave like a perfectly plastic body. This particular limit is known as the elastic limit, which is a characteristic property of material bodies and varies from one type of substance to another. The cause of elasticity is attributed to the interplay between the molecular forces of the substance. Don't use plagiarized sources. Get Your Custom Essay on Stress Is Proportional To Strain Paper Just from$9/Page

In studying the elastic properties of materials, two quantities are extremely important, namely stress and strain.

Strain: The strain measures the amount of deformation produced in the body due to the application of a deforming force. The strain is defined as the fractional change in dimension of a body relative to its original configuration. Mathematically,

{rm{Strain = }}frac{{{rm{Change in dimension}}}}{{{rm{original dimension}}}}Strain=
original dimension
Change in dimension

Since strain is a ratio of two similar quantities, it is dimensionless and has no unit.

Stress: Whenever a on a body and changes its configuration, internal reaction forces come into play, which try to restore the original configuration of the body. The reaction forces are equal and opposite to the external deforming force following Newtons third law of motion. Stress is defined as the per of the body. Mathematically,

{rm{Stress = }}frac{{{rm{Internal restoring force}}}}{{{rm{area}}}}Stress=
area
Internal restoring force

Since the internal force is equal to the applied deforming force, we can also write,

{rm{Stress = }}frac{{{rm{Applied force}}}}{{{rm{area}}}}Stress=
area
Applied force

The unit of stress is as follows:

SI {rm{N}} cdot {{rm{m}}^{ – {rm{2}}}}{rm{ or Pa}}Nm
2
or Pa
C.G.S {rm{dyne}} cdot {rm{c}}{{rm{m}}^{ – 2}}dynecm
2

Dimensional formula of stress: left[ {{rm{M}}{{rm{L}}^{ – 1}}{{rm{T}}^{ – 2}}} right][ML
1
T
2
]
Types of stress and strain
The stress is proportional to the strain. However, the strain also depends on the axis of the stress.

Longitudinal strain and stress: If the material subject to a deforming force is in the form of a bar or wire such that its length is much greater than the cross-section, then the deformation produced in the material is primary along the length. Any deformation along the cross-section is negligible. The body is said to be under longitudinal strain. The corresponding stress is known as longitudinal stress.

Volume strain and stress: If the deforming forces acting on the body are such that only the volume of the body is deformed, whereas the shape remains intact, then the body is said to be under volume strain. The corresponding stress is known as volume stress.

Shear strain and stress: If the deforming forces acting on the body are such that only the shape of the body is changed, whereas the volume remains the same before and after deformation, then the body is said to be under shearing strain. The corresponding stress is known as shearing stress.

## Get Professional Assignment Help Cheaply

Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?

Whichever your reason is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.

## Why Choose Our Academic Writing Service?

• Plagiarism free papers
• Timely delivery
• Skilled, Experienced Native English Writers
• Ability to tackle bulk assignments
• Reasonable prices

## Online Academic Help With Different Subjects

### Literature

Students barely have time to read. We got you! Have your literature essay or book review written without having the hassle of reading the book. You can get your literature paper custom-written for you by our literature specialists.

### Finance

Do you struggle with finance? No need to torture yourself if finance is not your cup of tea. You can order your finance paper from our academic writing service and get 100% original work from competent finance experts.

### Computer science

Computer science is a tough subject. Fortunately, our computer science experts are up to the match. No need to stress and have sleepless nights. Our academic writers will tackle all your computer science assignments and deliver them on time. Let us handle all your python, java, ruby, JavaScript, php , C+ assignments!

### Psychology

While psychology may be an interesting subject, you may lack sufficient time to handle your assignments. Don’t despair; by using our academic writing service, you can be assured of perfect grades. Moreover, your grades will be consistent.

### Engineering

Engineering is quite a demanding subject. Students face a lot of pressure and barely have enough time to do what they love to do. Our academic writing service got you covered! Our engineering specialists follow the paper instructions and ensure timely delivery of the paper.

### Nursing

In the nursing course, you may have difficulties with literature reviews, annotated bibliographies, critical essays, and other assignments. Our nursing assignment writers will offer you professional nursing paper help at low prices.

### Sociology

Truth be told, sociology papers can be quite exhausting. Our academic writing service relieves you of fatigue, pressure, and stress. You can relax and have peace of mind as our academic writers handle your sociology assignment.

We take pride in having some of the best business writers in the industry. Our business writers have a lot of experience in the field. They are reliable, and you can be assured of a high-grade paper. They are able to handle business papers of any subject, length, deadline, and difficulty!

### Statistics

We boast of having some of the most experienced statistics experts in the industry. Our statistics experts have diverse skills, expertise, and knowledge to handle any kind of assignment. They have access to all kinds of software to get your assignment done.

### Law

Writing a law essay may prove to be an insurmountable obstacle, especially when you need to know the peculiarities of the legislative framework. Take advantage of our top-notch law specialists and get superb grades and 100% satisfaction.

## What discipline/subjects do you deal in?

We have highlighted some of the most popular subjects we handle above. Those are just a tip of the iceberg. We deal in all academic disciplines since our writers are as diverse. They have been drawn from across all disciplines, and orders are assigned to those writers believed to be the best in the field. In a nutshell, there is no task we cannot handle; all you need to do is place your order with us. As long as your instructions are clear, just trust we shall deliver irrespective of the discipline.

## Are your writers competent enough to handle my paper?

Our essay writers are graduates with bachelor's, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college degree. All our academic writers have a minimum of two years of academic writing. We have a stringent recruitment process to ensure that we get only the most competent essay writers in the industry. We also ensure that the writers are handsomely compensated for their value. The majority of our writers are native English speakers. As such, the fluency of language and grammar is impeccable.

## What if I don’t like the paper?

There is a very low likelihood that you won’t like the paper.

### Reasons being:

• When assigning your order, we match the paper’s discipline with the writer’s field/specialization. Since all our writers are graduates, we match the paper’s subject with the field the writer studied. For instance, if it’s a nursing paper, only a nursing graduate and writer will handle it. Furthermore, all our writers have academic writing experience and top-notch research skills.
• We have a quality assurance that reviews the paper before it gets to you. As such, we ensure that you get a paper that meets the required standard and will most definitely make the grade.

### In the event that you don’t like your paper:

• The writer will revise the paper up to your pleasing. You have unlimited revisions. You simply need to highlight what specifically you don’t like about the paper, and the writer will make the amendments. The paper will be revised until you are satisfied. Revisions are free of charge
• We will have a different writer write the paper from scratch.
• Last resort, if the above does not work, we will refund your money.

## Will the professor find out I didn’t write the paper myself?

Not at all. All papers are written from scratch. There is no way your tutor or instructor will realize that you did not write the paper yourself. In fact, we recommend using our assignment help services for consistent results.

## What if the paper is plagiarized?

We check all papers for plagiarism before we submit them. We use powerful plagiarism checking software such as SafeAssign, LopesWrite, and Turnitin. We also upload the plagiarism report so that you can review it. We understand that plagiarism is academic suicide. We would not take the risk of submitting plagiarized work and jeopardize your academic journey. Furthermore, we do not sell or use prewritten papers, and each paper is written from scratch.

## When will I get my paper?

You determine when you get the paper by setting the deadline when placing the order. All papers are delivered within the deadline. We are well aware that we operate in a time-sensitive industry. As such, we have laid out strategies to ensure that the client receives the paper on time and they never miss the deadline. We understand that papers that are submitted late have some points deducted. We do not want you to miss any points due to late submission. We work on beating deadlines by huge margins in order to ensure that you have ample time to review the paper before you submit it.

We have a privacy and confidentiality policy that guides our work. We NEVER share any customer information with third parties. Noone will ever know that you used our assignment help services. It’s only between you and us. We are bound by our policies to protect the customer’s identity and information. All your information, such as your names, phone number, email, order information, and so on, are protected. We have robust security systems that ensure that your data is protected. Hacking our systems is close to impossible, and it has never happened.

## How our Assignment  Help Service Works

#### 1.      Place an order

You fill all the paper instructions in the order form. Make sure you include all the helpful materials so that our academic writers can deliver the perfect paper. It will also help to eliminate unnecessary revisions.

#### 2.      Pay for the order

Proceed to pay for the paper so that it can be assigned to one of our expert academic writers. The paper subject is matched with the writer’s area of specialization.

#### 3.      Track the progress

You communicate with the writer and know about the progress of the paper. The client can ask the writer for drafts of the paper. The client can upload extra material and include additional instructions from the lecturer. Receive a paper.

The paper is sent to your email and uploaded to your personal account. You also get a plagiarism report attached to your paper.

PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET A PERFECT SCORE!!!

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.


text:
# Swift Program to Find the Largest Among Three Numbers

This tutorial will discuss how to write a Swift program to find the largest among three numbers.

Given three numbers now we have to find the largest among the given three numbers. So we will compare all three numbers with each other to find the largest number.

Below is a demonstration of the same âˆ’

Suppose we enter the following input âˆ’

39, 87, 12

Following is the desired output âˆ’

Largest number is 87

## Finding largest number using max() function

Swift provides an in-built method named as max() function. This function returns the maximum number among the given numbers.

### Syntax

Following is the syntax of the Swift max() function âˆ’

max(num1, num2, num3)

### Algorithm

The algorithm is explained below âˆ’

• Step 1 âˆ’ Declare three variables

• Step 2 âˆ’ read their values from the user.

• Step 3 âˆ’ Use the max() function to find the largest number among the three numbers.

• Step 4 âˆ’ Print the output.

### Example

The following program shows how to find the largest among three numbers using the max() function.

import Foundation
import Glibc

print("Enter first number")
print(num1)

print("Enter second number")
print(num2)

print("Enter third number")
print(num3)

var largest = max(num1, num2, num3)
print("Largest number is", largest)

### Output

Enter first number
23
Enter second number
1
Enter third number
10
Largest number is 23

Here in the above code, we takes three integer numbers from the user using the readLine() function that are num1 = 23, num2 = 1 and num3 = 10. Now using the max() function we compare all the three numbers with each other and display the largest number which is 23.

## Finding largest number by comparing values

We can also find the largest number among three numbers by comparing all the numbers with each other using > operator.

### Algorithm

The algorithm is explained below âˆ’

• Step 1 âˆ’ Create a function.

• Step 2 âˆ’ Use if-else-if statement and compare the three numbers- n1, n2, and n3 using > operator.

• Step 3 âˆ’ Call the function with three arguments

• Step 4 âˆ’ Display the output

### Example

The following program shows how to find the largest among three numbers by comparing values.

import Foundation
import Glibc

func maximumValue(n1: Int, n2: Int, n3: Int) -> Int{

// Comparing n1, n2 and n3 with
// each other to find the largest number
if n1 > n2, n1 > n3{
return n1
}
else if n2 > n3, n2 > n1{
return n2
}
else if n3 > n2, n3 > n1{
return n3
}
else if n1 == n2, n2 > n3{
return n1
}
else if n2 == n3, n3 > n1{
return n2
}
else{
return n1
}
}
print("Maximum number is-", maximumValue(n1: 2, n2: 4, n3: 6))
print("Maximum number is-", maximumValue(n1: -19, n2: 34, n3: 19))

### Output

Maximum number is- 6
Maximum number is- 34

Here in the above code, we create a function named as maximumValue(), which will return the maximum number among the given three numbers. In this function, we use an if-else-if loop to compare all the numbers with each other with the help of the > operator. Now we call the function two time with different parameter values that is maximumValue(n1: 2, n2: 4, n3: 6) and maximumValue(n1: -19, n2: 34, n3: 19) and display the maximum values that are 6 out of (2, 4, 6) and 34 out of(-19, 34, 19) on the output screen.