Basic Unix Commands
Objective:
The objective of this lab is to work with files of UNIX file
system.
Procedure:
1. OpenyourUnixshellandtrythesecommands:
Ø Create a new file and add some text in it vcat > filename
Ø View a file
vcat /etc/passwd vmore /etc/passwd vmore filename
Ø Copy file, making file2 vcp file1 file2
Ø Move/rename file1 as file2 vmv file1 file2
Ø Delete file1 as file2 vrm file
//Deletefile //Double-checkfirst
vrm -i file
Ø Counts the lines, words, characters in file
vwc file
Ø Search file for a string
v Grep lubuntu /etc/passwd v grep 'else' /etc/profile
v grep ^united ~/myFile
// List lines containing ‘lubuntu’ in /etc/passwd
//Lines containing ‘else‘ in /etc/profile
//Lines starting with ‘united’ in ~/myFile
1
Ø Output can be redirected to a file with’>’ vls >
dir.txt
vcal 1997 > year1997
Ø Output can be appended to a file with ’>>’ vcal 1997
> years
vcal 1998 >> years
Ø Concatenate two files vcat f1 f2 > fs
Ø Input redirection (less common) uses ‘<‘ vwc < years
Ø Combine input and output redirection vwc < years > year-counts
*Do screenshot of each steps you have completed* ((using lubuntu))
In: Computer Science
Problem 5. The aquifer source water used by the town of Pandarwin, IL contains 32 mg/L Fe2+ and 97 µg/L arsenic, predominantly in the form of As(III). To meet the new MCL of 10 µg/L the local water utility is considering several strategies. One strategy involves adding hydrogen peroxide (H2O2) to the water. Arsenic removal occurs indirectly as a byproduct of the reaction between Fe2+ and H2O2. When H2O2 reacts with Fe2+, hydroxyl radical intermediates (•OH) are produced which can rapidly oxidize As(III) to As(V). The As(V) can then be removed by coprecipitation with and adsorption onto Fe(OH)3(s) precipitates during sand filtration. The source water is well buffered at pH 8.0 by dissolved carbonate species.
(a) Write the balanced redox reaction between Fe2+ and H2O2. Fe2+ is converted to Fe(OH)3(s) and H2O2 is converted to H2O.
(b) The treatment plant flow rate is 107 L/day. If we assume that the reaction from part (a) goes to completion as written, calculate the mass of H2O2 that will be required each day to consume all the dissolved Fe2+ in the source water entering the plant.
(c) If we assume that each H2O2 molecule generates a single ⋅OH intermediate when it reacts with Fe2+, estimate the fraction of ⋅OH intermediates that will be used to convert As(III) to As(V) in the source water. Assume that each As(III) molecule reacts with only a single ⋅OH intermediate
In: Civil Engineering
The program ( stack-ptr.c ) implements stack using a linked list, however, it contains a race condition and is not appropriate for a concurrent environment. Using Pthreads mutex locks, fix the race condition. For reference, see Section 7.3.1 of SGG book.(Section 7.3.1 is about mutex and semaphores it does explain how to implement I'm just having a hard time finding the race condition within the code)
/*
* Stack containing race conditions
*/
#include
#include
#include
typedef int value_t;
// Node structure
typedef struct Node
{
value_t data;
struct Node *next;
} StackNode;
// function prototypes
void push(value_t v, StackNode **top, pthread_mutex_t
*mutex);
value_t pop(StackNode **top, pthread_mutex_t *mutex);
int is_empty(StackNode *top);
void push(value_t v, StackNode **top, pthread_mutex_t *mutex)
{
StackNode *new_node;
new_node = (StackNode *)malloc(sizeof(StackNode));
new_node->data = v;
// mutex lock and unlock code
}
value_t pop(StackNode **top, pthread_mutex_t *mutex)
{
StackNode *temp;
pthread_mutex_lock(mutex);
// mutex lock and unlock code based on empty or full stack
}
int is_empty(StackNode *top) {
if (top == NULL)
return 1;
else
return 0;
}
int main(void)
{
StackNode *top = NULL;
// pthread_mutex variable declarion and verify push/pop operation
for 4 inputs (5, 10, 15, 20)
return 0;
}
In: Computer Science
In: Electrical Engineering
Problem 1a: Velocity Selector: Show that with the right ratio of electric to magnetic field strength a particle of velocity v will proceed through both fields in a straight line at constant speed (hint: you will need an equation containing v. Also: what does the straight line at constant speed give you?). Assume that the angle of the velocity vector relative to the magnetic field vector is 90 degrees.
b: Show mathematically that the charge magnitude and sign do not matter.
c: Draw and label the electric field vector, the electric force vector, the magnetic field vector, the velocity vector and the magnetic force vector. Hint: start with the two force vectors. They have to add to zero. Then use the vector nature of the Eq = F(E) equation and the right hand rule to get the other vectors.) Assume that the particle is negatively charged. Use into and out of the page vector notation where necessary.
d. Explain in terms of what happens with the force vectors when the charge sign changes to allow a particle of either charge sign pass through the velocity selector at constant velocity v. In other words, explain physically why the particle charge sign makes no difference.
e. Explain in terms of what happens with the force vectors when the charge magnitude changes. In other words, explain physically why the charge magnitude makes no difference in the velocity selector.
In: Physics
Kit Requirements:
Lab 3a:
Procedure:
· Watch the videos:
o Tutorial 03 for Arduino: Electrical Engineering Basics(https://www.youtube.com/watch?v=abWCy_aOSwY)
o Tutorial 04 for Arduino: Analog Inputs (https://www.youtube.com/watch?v=js4TK0U848I)
o TechBits 13 - Analog and Digital Signals (https://www.youtube.com/watch?v=Z3rsO912e3I)
· Construct the breadboard circuit and implement the program presented in the video to create an adaptable night light and detailed in Chapter 2 (pp.35-39) of your textbook.
Lab 3b:
Procedure:
This week’s lab will simulate the coffee maker heater functionality we saw in Week 1. The difference in our program and the actual coffee maker is that instead of turning on a heating element, our program will blink an LED.
· Design a circuit and Arduino program that expands the concepts explained in Chapter 3 ( pp. 52- 59) of your textbook and accomplishes the following:
o Blinks an LED when the temperature of a temperature sensor is at or below room temperature for more than 5 seconds
o If the temperature exceeds room temperature for more than 5 seconds, the LED will turn off.
·
In: Electrical Engineering
n Jacobson v. Massachusetts (1905), the United States Supreme Court upheld the right of states to enact compulsory vaccination laws—one of the most challenging constitutional dimensions of public health. It also provided the terms for what would eventually become a core question of public health ethics.
This case has become the precedent for many cases that have challenged vaccination laws. Both majority and dissenting opinions in numerous decisions have cited this case in reference to states’ authority to constrain individual behavior. These cases have involved issues ranging from fluoridation of municipal water supplies, to abortion, to the right to die. In Buck v. Bell (1927), the Supreme Court usedJacobson v. Massachusetts (1905) to uphold a forced-sterilization law using the reasoning that society must be protected from the burdens imposed by the offspring of “imbeciles.” Despite the troubling uses to which this decision has been put, public health law texts continue to cite the case as an example of the ways that public health practices must resolve the tensions between individual rights and the collective well-being.
Based on these Supreme Court decisions, respond to the following:
In: Nursing
|
The controller of the Red Wing Corporation is in the process of preparing the company’s 2016 financial statements. She is trying to determine the correct balance of cash and cash equivalents to be reported as a current asset in the balance sheet. The following items are being considered: |
| a. | Balances in the company’s accounts at the First National Bank; checking $15,300, savings $23,900. |
| b. | Undeposited customer checks of $7,000. |
| c. | Currency and coins on hand of $760. |
| d. |
Savings account at the East Bay Bank with a balance of $580,000. This account is being used to accumulate cash for future plant expansion (in 2018). |
| e. |
$56,000 in a checking account at the East Bay Bank. The balance in the account represents a 20% compensating balance for a $280,000 loan with the bank. Red Wing may not withdraw the funds until the loan is due in 2019. |
| f. | U.S. Treasury bills; 2-month maturity bills totaling $33,000, and 7-month bills totaling $38,000. |
| Required: |
| 1. |
Determine the correct balance of cash and cash equivalents to be reported in the current asset section of the 2016 balance sheet. |
|
Cash and cash equivalents includes: |
||
|
a |
Balance in checking account |
|
|
Balance in savings account |
||
|
b |
Undeposited customer checks |
|
|
c |
Currency and coins on hand |
|
|
d |
Balance in savings account |
|
|
e |
Balance in checking account |
|
|
f |
U.S. treasury bills |
|
|
Total |
||
In: Accounting
The following is a summary of the May 2016 operations of Reagan Company that makes and sells airplane models. Suppose that the company uses the FIFO method.
|
Physical Units |
Direct Materials |
Conversion Costs |
|
|
WIP, beginning inventory |
28,000 |
$39,200 |
$30,800 |
|
Degree of completion for BI |
100% |
25% |
|
|
Started in May |
60,000 |
||
|
Completed and transferred out in May |
66,000 |
||
|
WIP, ending inventory |
22,000 |
||
|
Degree of completion for EI |
100% |
50% |
|
|
Costs added in May |
$90,000 |
$280,000 |
1.What is the amount of direct materials cost assigned to ending WIP at the end of May?
Group of answer choices
$44,000
$39,200
$33,000
$22,000
2.What is the cost of goods transferred out during May?
Group of answer choices
$293,000
$517,000
$363,000
$447,000
In: Accounting
23-2. December 31
2017 2016
33,500 13,000 Cash
12,250 10,000 Accounts Receivable
12,000 9,000 Inventory
0 3,000 Long-Investments
0 29,750 Building
0 (6,000) Accumalted depreciation on building
45,000 20,000 Equipment
(2,000) (4,500) Accumlated depreciation on equipment
5,000 9,250 Patents
105,750 83,500 Total Assets
5,000 3,000 Accounts Payable
1,000 5,000 Dividends Payable
4,000 8,500 Short-term Notes Payables
32,000 25,000 Long term notes payable
39,000 30,000 Common stock
6,000 3,000 Pain-in capital excess of par
18,750 9,000 Retained Earnings
105,750 83,500 Total
Additional data related to 2017 are as follows:
1. A long term note for $16,000 was issued for the acquisition of equipment.
2. On January 1, 2017 the building was completely destroyed by a flood. Insurance proceeds on the building were $30,000.
3. Equipment that had cost 11,000 and was 40% depreciated was sold for 2,500.
4. Common stock with a par value of 5,000 and a market value of 6,000 was issued to pay off part of the long-term note.
5. A new long-term note was issued for the acquisition of equipment.
6. Equipment was purchased for cash.
7. Dividends were of 7,000 were declared during 2017.
Prepare the statement of cash flows, including any significant non-cash transactions after the reconciliation. (SHOW ALL OF YOUR WORK PLEASE)
In: Accounting