The vi text editor can be a bit challenging to use at first, but once you have familiarized yourself with how it works you will find it an efficient way to create and edit text files in Linux, and UNIX as well. The key thing to remember is that vi has two operational modes: insert mode and command mode. In insert mode, everything you type is entered into your file. You can use the backspace, delete and the arrow keys. You must press Enter at the end of each line. In command mode, everything you type is processed as a command. Most commands are single-letter commands, and some will accept a number before the command to indicate how many times you wish the command to be performed. You can use also specialized cursor movement commands (forward a page, back a page, go to a specific line, etc.) while in command mode. Creating and Saving a File 1. In this part of the lab, you will copy out one of William Shakespeare’s sonnets (fourteen-line poems). To find which one of his poems you are to type in, go to https://www.opensourceshakespeare.org/views/sonnets/sonnets.php Take the last two digits of your student number, and click on the sonnet number that matches that part of your student number. For example, if your student number is 100012345, choose sonnet 45. 2. Log into . 3. To create a new file in Linux, you type vi followed by the new file’s name. Type vi sonnet 4. You will see an empty text file. The ~ characters on the left indicate empty (non-existent) lines of text. When you start vi you are in command mode, so you cannot enter text yet. To get into regular insert mode, press the i key and type in your sonnet (do not include the title or the line numbers at the ends of lines 5, 10 and 14, but do include the spaces at the start of lines 13 and 14). Remember to press Enter at the end of each line. 5. To save the file, you must enter command mode. Press Esc to do so. You can always press Esc at any time to enter command mode. To save the file and exit vi, press ZZ (that is, two capital Z’s). 6. You should now be back at the Linux prompt. Use cat sonnet to verify that you have saved your file and that it contains the correct text. Obtain a screenshot. Editing a Text File 7. Use vi sonnet to open your text file again. Notice that you again start off in command mode, which you can check by using cursor movement keys. Write down a brief description of what each of the following nine keys does. You may have to move the cursor into the centre of your poem before using the keys, to make the purpose of each character more obvious. a. Each of the letters h, j, k, l. b. The letters b, w. c. The symbols $, ^. d. The control code ^g, and a number followed immediately by G. 8. You will now add a line to the end of the document. Remember that you are still in command mode. You can enter insert mode in a number of ways. When you want to add text below an existing line of text, use the o command (think “o” for “open”). Move the cursor down to the last line of the document, then press o. Then type the following text: This is the end of the file. Press Esc to get back into command mode. 9. You will now add a line to the top of the document. When you want to add text above an existing line of text, use the O (capital O, not zero) command. Move the cursor to the top of the document and press O. Type the following: My own sonnet and press Enter. Press Esc to get back into command mode. 10. You will now insert lines in the middle of the document. To do so, move the cursor to the position in your document where you want to insert a line. Press o or O depending on whether you want to add the line below or above your cursor position. Use this information to add a row of about ten dashes (the exact number isn’t important) just above the line reading This is the end of the file. Get back into command mode. 11. Copying and pasting a line of text is done using the “yank” and “put” commands in vi. What you will do next is to copy the row of dashes that you just added, and paste it underneath the title line at the top of the document. In command mode, move the cursor to the line of dashes. Press yy to copy the entire line to the buffer. Now, move the cursor to the top line of your file, which should be the title line. There are two ways to paste the contents of the buffer: p pastes the contents below the current cursor position, and P pastes the contents above the current position. Since we would like the dashes to go below the title line, press lowercase p. Obtain a screenshot. 12. At this point, you can save the file and exit vi as you did earlier (by pressing ZZ), but you can also simply save the file and carry on editing. To save the file, make sure you’re in command mode (using Esc), and type :w (colon and w) to write the file to disk. 13. As well as knowing how to enter new lines of text, you will also need to know how to insert text at the start, in the middle of a line, or at the end of a line. a. To add text to the start of a line, move the cursor to the beginning of the line, press i to enter insert mode, type the text, and press Esc to exit insert mode. Use this technique to add the text Lab 3: to the beginning of the first line of the file. b. To add text in the middle of a line, move the cursor to the spot where you want your new text to start, press i, type the text, and then exit insert mode. Use this technique to insert ***** (five asterisks) in the middle of the fifth line of the sonnet. c. To add text at the end of a line, move the cursor to any position in the line and press A (think “after”). Type the text, then press Esc. Use this technique to add The end! at the end of the last line of the very last line of the file. Obtain a screenshot. 14. There are several ways to delete text while in command mode. a. Use x to delete the character under the cursor. b. Use dw to delete from the cursor position to the end of the current word. c. Use dd to delete the current line. Note that methods (b) and (c) also copy the deleted text to the buffer, so you can paste what you have deleted to another part of your file. d. Using the above information plus what you learned earlier, delete the lines of dashes and each line with a blank line instead. Delete the word own from the first line. Replace the word file with poem. e. Sometimes it is useful to be able to delete the entire last part of a line of text, or to replace the last part of a line with new text. You would use D to delete everything from the cursor position to the end of the line; you would use R to enter replace mode, where everything you type overwrites the current text on the line. Make sure you’re in command mode, and move the cursor to the T in The end! Press R, and type the text Wasn't it great? to replace the previous text. Then press Esc to enter command mode. 15. As you can see, files in vi consist of individual lines. Unlike in the Windows programs Word or Notepad, you must press Enter at the end of each line rather than just continue typing. Sometimes you may find that after you created two separate lines of text, that you would now like to join them together as one line of text. a. Go to the last line of your document. Press o to add text to the file. b. Type the following four words, making sure to put each on a separate line: These are four words. c. In command mode, move the cursor to the line reading These. Press J (for “join”), and notice that the word are moves up and becomes part of the current line. Press J twice more to complete the sentence. 16. To search for text, you use the / command. In command mode, type /a to find the next occurrence of the letter a in the file. Once you have found the first occurrence, you can press n or N to find the next or previous occurrence of the same text. Press n repeatedly to cycle through all the occurrences of a in the file. 17. Searching and replacing is a bit more complicated. a. To search for text and replace it with new text, use :s/old/new/ while in command mode. For example (but don’t do it yet), to replace the next occurrence of the with THE, you would type :s/the/THE/ while in command mode. b. If you wish to replace all occurrences of a text string throughout the entire file, you use :%s/old/new/ in command mode. You would do the following to capitalize occurrences of a in the file: :%s/a/A/ Here, only the first a in each line is capitalized. If you wanted to change every a on each line, you would have to put the code g (for “global”) after the last / in the command, as in: :%s/a/A/g c. If you ever do an edit which you don’t like you can undo the change. Simply press u to undo the last command. If you press u repeatedly now, you will undo the last number of commands. To redo the commands, press Ctrl-r. d. Obtain a screenshot showing the file with all a’s changed to capital A’s. e. Save the file and exit vi. Create and Modify a Text File Now you will get to enter a text file and make changes as directed. Follow the steps, using what you have learned in the earlier part of this lab. 1. Using vi, create a new file called lab3. Enter the text that you see below, keeping the line breaks as shown. This is a test to see what you have learned. Here are some lines of text to enter. When you have entered them all, you will do a few editing commands. I hope that you have learned well. 2. Obtain a screenshot, then save the file. 3. Change the words a test to read an exercise. 4. Add the title My Awesome File by as the top line of the document. Put your name at the end of the line. 5. Edit the document so that each full sentence (ending with a “.” period) is on its own individual line of text. 6. Delete the word editing. 7. Put a blank line in between the title and the first sentence. 8. Change all the lowercase e’s in the document to capital E’s. 9. Use cut and paste to change the order of the sentences in the document, so that they appear in alphabetical order “Here are…”, “I hope…”, “This is…”, and “When you…”. 10. At the end of the document, add a line of dashes and a line that reads AAAKKK and your section number. 11. Obtain a screenshot, then save the file and exit vi.
In: Computer Science
State the appropriate graphic or statistical procedure for each procedure.
Group of answer choices
To investigate how weight loss changes according to fat intake. the graphical method is
[ Choose ] ANOVA segmented bar chart test of association goodness of fit test regression/correlation analysis scatterplot z or t test statistic based hypothesis test side by side boxplot
To investigate how weight loss changes according to fat intake . the statistical procedure is is is
[ Choose ] ANOVA segmented bar chart test of association goodness of fit test regression/correlation analysis scatterplot z or t test statistic based hypothesis test side by side boxplot
To investigate how annual income varies according to gender. The statistical procedure is
[ Choose ] ANOVA segmented bar chart test of association goodness of fit test regression/correlation analysis scatterplot z or t test statistic based hypothesis test side by side boxplot
To study the preference of travel method (auto, train, bus , ail plane) among different seasons (spring, summer, fall , winter) the appropriate graphic is
[ Choose ] ANOVA segmented bar chart test of association goodness of fit test regression/correlation analysis scatterplot z or t test statistic based hypothesis test side by side boxplot
To compare the winter beach temperatures among the 3 different locations, Florida east and west coasts, and the California western coast, the appropriate statistical procedure is
[ Choose ] ANOVA segmented bar chart test of association goodness of fit test regression/correlation analysis scatterplot z or t test statistic based hypothesis test side by side boxplot
In: Statistics and Probability
q1 Which of the following is true about graphic rating scales?
Select one:
a. They exclude behavioral dimensions.
b. They are useful tools but difficult to develop.
c. They encourage rater errors.
d. They are rarely used in large organizations
q2 Employers should use caution in gathering external pay data from the Internet because_______________.
Select one:
a. salary data bases are offered by subscription only
b. The information may be inaccurate and may not fit the organization's jobs
q3 If injured while working from home, employees ____________
Select one:
a. Waive the wage replacement portion of workers compensation, but the employer is responsible for their medical bills
b. Waive their right to collect workers compensation
c. Can generally collect workers compensation benefits
d. Must have their workspace inspected in order to receive workers compensation benefits
c. HR staff may lack computer literacy
d. computer hackers can track an employers internet usage
q4 In an organization with a performance-oriented philosophy, _______________.
Select one:
a. no one is guaranteed increased compensation just for completing another year of service
b. all employees can at least count on an annual cost-of-living adjustment to their salaries
c. commissions and piece-rate incentives replace traditional salaries
d. fairness concerns dominate compensation decisions
q5 Paul is an Accounting Manager for a large pharmaceutical company in New York. The salary range for the Accounting Manager position is $60,000 to $80,000. If Paul is paid $75,000 per year, then Pauls comparatio is _______________.
Select one:
a. 107
b. 100
c. 125
d. 93
In: Operations Management
In: Nursing
Q16. The Ralston Company manufactures a special line of graphic tubing items. The company estimates it will sell 75,000 units of this item for the next several years. The beginning 2020 finished goods inventory contains 15,000 units. The target for each year's ending inventory is 10,000 units. Each unit requires five feet of plastic tubing. The tubing inventory currently includes 70,000 feet of the required tubing. Materials on hand are targeted to equal three months’ production. Any shortages of materials are made up by the immediate purchase of materials. Sales take place evenly throughout the year. What are the total feet of tubing budgeted to be used in manufacturing for 2020?
Q17. Rocket Plating Company plans to sell 120,000 units of its GidgetSpinners at a price of $6 per unit. There are 10,000 units in finished goods inventory on January 1 and management wants to increase this inventory by 20% during the year. What is the budgeted number of units to be manufactured in the upcoming year?
Q18. The following data pertains to the month of October for ElmCo. when production was budgeted to be 5,000 units of P90. P90 has standard costs per unit of: 3lbs. of Direct Materials at a cost of $7.00 per lb; 0.20 hours of Direct Labor at $18.00 per hour; and Variable Overhead assigned on the basis of 0.05 machine hours at a rate of $50 per machine hour. Actual production of P90 for October was 4,600 units. In October the production of P90 totaled 4,600 units, using 828 direct labor hours costing a total of $15,732. Determine the direct labor variance. (Negative numbers indicate a favorable variance.)
In: Accounting
A clinic tests patients for the novel Zombie virus. A patient is likely to be tested positive with probability 0.25. If each patient testing is independent, answer the questions below:
1. What is the probability that the 6th patient is tested positive?
2. What is the probability that the 6th patient is the first one to be tested positive? Use an appropriate random variable family and the provide a PMF.
In: Statistics and Probability
Imagine you work for an industrial chemical company and you have been asked to design a novel cleaning agent against a group of microorganisms. Select a specific organism representative of the group you chose, gather information about it, and identify the potential "target" within the organism suitable for your cleanser to attack, discussing how your chemical will control the growth of the organism.
In: Biology
Suppose a novel respiratory disease has a 2% mortality rate. If 1,000 people catch the disease, how many would you expect to die from it? Give the distribution of the r.v. you’re using to model this situation, including parameter values. How many people would have to catch the disease for the number of expected deaths to rise to 100,000? To rise to 1,000,000?
In: Statistics and Probability
A major theme that runs through Thornton Wilder’s work is how people move on from catastrophic loss. In The Bridge of San Luis Rey, two characters in particular – Brother Juniper, and the Abbess – focus on surviving loss in very different ways. How do you characterize their approaches – and what is your own take-away from Wilder’s novel?
In: Psychology
In: Physics