Questions
Use any C program without using PTHREADS calculate time taken to execute program. Write same program...

Use any C program without using PTHREADS calculate time taken to execute program.

  1. Write same program of question 1 using PTHREADS. Calculate time taken to execute program.
  2. Identify data races in above program and explain why this situation occurred with an example
  3. Rewrite the code to avoid data races should use any of the THREE techniques.

critical section

mutex solution

semaphore functions

Barriers

Read-Write Locks

Run program using 1, 2, 4, and 8 threads Comparison study

Number of threads

Implementation

1

2

4

8

critical section

mutex solution

semaphore functions

Barriers

Read-Write Locks

  1. Rewrite the program using OPENMP. Run on 4 processors. Calculate time taken.
  2. At the end calculate speed up.  

In: Computer Science

Draw a Schema Diagram using the information. Signum Libri (SL) is a publishing company. SL Operations...

Draw a Schema Diagram using the information.

Signum Libri (SL) is a publishing company.

SL Operations Database will keep track of the following:

  • For each book SL publishes: a book name, genre, date of publication, and number of pages;
  • For each writer: a unique writer identifier as well as the writer’s name;
  • For each agent: a unique agent identifier as well as the agent’s name;
  • For each editor: a unique editor identifier as well as the editor’s name;
  • Each SL book is written by one writer, and each writer can write many SL books. SL will not keep track of writers who did not write a book for SL. All books written by the same writer have a different book name. However, two writers can write two different books with the same book name.
  • Each writer is represented by one agent. Each agent represents at least one writer, but can represent many.
  • Each book has one editor. Each editor edits at least one book, but can edit many books.
  • Each editor can mentor one or more other editors, but does not have to mentor any. Each editor can have at most one mentor editor, but does not have to have any

In: Computer Science

Write a C++ program that involves implementing the RSA cryptosystem. In practice for the encryption to...

Write a C++ program that involves implementing the RSA cryptosystem. In practice for the encryption to be secure and to handle larger messages you would need to utilize a class for large integers. However, for this assignment you can use built-in types to store integers, e.g., unsigned long long int. Also, rather than using the ASCII table for this assignment use BEARCATII, which restricts the characters to the blank character and the lower-case letters of the alphabet as follows: blank character is assigned the value 0. A, …, Z are assigned the values 1, …, 26, respectively. The message M will be represented by replacing each character in the message with its assigned integer base 27. For example, the message M = “TEST” will be represented as N = 20 5 19 20 Translating this to decimal we obtain: D = 20 + 19*27 + 5*272 + 20*273 = 397838 Note that to convert back to base 27, we simply apply the algorithm we discussed in class, i.e., the least significant digit (rightmost) is obtained by performing the operations D mod 27 and performing a recursive call with D/27. For the example above we obtain, 397838 / 27, 397838 mod 27 = 14734, 20 → 14734 / 27, 14734 mod 27, 20 = 545, 19, 20 → 545/27, 545 mod 20, 19, 20 = 20, 5, 19, 20 = N Find primes p and q by choosing positive integers at random and testing for primality using Miller-Rabin probabilistic algorithm. Your program should prompt the user to input a positive integer representing the public key e. If the user enters a number that is not relatively prime to n = pq, then have the user reenter and keep doing this until e and n are coprime, i.e., gcd(e,φ(n)) = 1. Also prompt the user to enter the message M (as a character string). For handing purposes, run your program with M = “TEST”. Output p, q, n, M, C, P where C is the encrypted message, i.e., cyber text, and P is the decrypted message, i.e., plaintext. If your program is working correctly then M should be equal to P.

In: Computer Science

you can see in the following​ table, demand for heart transplant surgery at Washington General Hospital...

you can see in the following​ table, demand for heart transplant surgery at Washington General Hospital has increased steadily in the past few​ years:

Year 1 2 3 4 5

Heart Transplants 48.0 48.0 53.0 57.0 57.0  

Year 1 2 3 4 5

Heart Transplants 44.0

The director of medical services predicted 6 years ago that demand in year 1 would be 44.0 sureries.

A) using exponential smoothing with a of 60.0 anf the given forecast for year 1, the forecasts for 2 years through 6 are? (round your answers to one decimal place)

For the forecast made using expotienal smoothing with a=60.0 and the given forecasts for year 1, MAD= _ surgeries (round your response to one decimal place)

Using expotiental smoothing with a of 90.0 and the given forecast for year 1, the forcasts for years 2 through 6 are (round your responses to one decimal place)

For the forecast made using expotiental smoothing with a=0.90 and given forecast for year 1, MAD= _ surgeries (round your response to one decimal place)

b) forecasts for years 4 through 6 using a 3 year moving average are? (round your response to one decimal place)

For forecast made using a 3 year moving average MAD = _ surgeries (round your answer to one decimal place)

C) forecasts for years 1 through 6 using the trend-projection method are (round your response to one decimal place)

For forecasts made using the trend-projection method, MAD= _ surgeries (round your response to one decimal place)

D) based on the comparison of MAD, the best forecast is archived using the _ method

In: Operations Management

Scholarship Describe a meaningful volunteer experience you’ve had? How did this experience change you? From a...

Scholarship

  • Describe a meaningful volunteer experience you’ve had?
  • How did this experience change you?
  • From a financial standpoint, what impact would this scholarship have on your education?

In: Psychology

In ethical decision making. discuss about the important of fundamental principles and core values. (750 words)

In ethical decision making. discuss about the important of fundamental principles and core values. (750 words)

In: Operations Management

Laboratory Tasks public class LinkedList {              Node head;               class Node {    &nbsp

Laboratory Tasks

public class LinkedList {

             Node head;

              class Node {  

                    int data;

                    Node next;

                    Node(int d) {

                            data = d;

                            next = null;

                    }

                }

}

Complete the above java program by adding the following methods:

Part1:

  1. isEmpty() checks if the linked list is empty or not. (return type is boolean)
  2. printList() prints all data in the linked list. (void method)
  3. insertFirst(int newData) add newData at the head of the linked list. (void method)
  4. insertLasL(int newData) add newData at the tail of the linked list. (void method)
  5. findMiddle() finds the middle element in the list and displays its value. (void method)
  6. deleteFirst() deletes the first element of the list. (void method)
  7. sizeList() returns the number of elements in the list. (return type is int)
  8. Main method that calls all the previous seven methods.

In: Computer Science

Your group has the following equipment: An electroscope, a foam tube, fur, a small plastic cup,...

Your group has the following equipment: An electroscope, a foam tube, fur, a small plastic cup, a small metal cup. You perform the experiments described below and record the outcomes. For each of the experiments, use your understanding of the electric field to explain why each outcome happened.

-Make sure your explanations use the concept of the electric field rather than “opposite charges attract/same charges repel” ideas.

-Draw LARGE charge diagrams to illustrate your explanations. Show the shape of the electric field by including electric field lines.

Experiments:

a. Bring the charged end of a foam tube down toward the top of an uncharged electroscope without touching the electroscope. Outcome: The metal strips separate.

b. Take the charged end of the foam rod away from the top of the uncharged electroscope. Outcome: The metal strips come back together

c. Repeat the first two experiments, only this time a metal can covers the electroscope but doesn’t touch it. Outcome: The metal strips do not separate.

d. Repeat the first two experiments, only this time a glass beaker covers the electroscope but doesn’t touch it. Outcome: The metal strips separate then come back together, but much less significantly than in experiments a. and b.

In: Physics

Reasons that people disagree about public issues that involve science and technology

Reasons that people disagree about public issues that involve science and technology

In: Psychology

There is a wealth of information available on how companies can select projects which will be...

There is a wealth of information available on how companies can select projects which will be profitable, how to align projects with a company's strategic objectives, how to evaluate proposals, and in general, how to have a successful project.   Yet while projects today are more successful than ever, a substantial number still fail.

Consider some projects that you have worked on either at your job (e.g. office software upgrades, new accounting system, moving to a new location) or in your personal life (e.g. a wedding, modernizing a kitchen, an extensive vacation). Please try and explain why the project you worked on was successful or a failure.

In: Psychology

You are a community leader with a long experience in fighting for quality improvement in health...

You are a community leader with a long experience in fighting for quality improvement in health care. The new CEO of the most important hospital (nonprofit) in your city received the mandate from the Board of Directors (BOD) to set a formal patient and family advisory council (PAC). This council will report directly to the BOD. Additionally, the BOD has appointed you as the first Chair of the PAC.

You are told that the hospital has serious problems in quality and performance.

Following the Five C’s rationale

  • Identify at least two possible problems by each C (a total of 10 problems) that you presume the hospital might be having;
  • Discuss how the PAC could cooperate in solving those problems. If you think that the PAC would not have any role in addressing/solving the problem, please say so for each problem and mention who could address them.

please this is a health care system question not nursing or psychology.

In: Operations Management

For this discussion forum, conduct research on a current news event that has something to do...

For this discussion forum, conduct research on a current news event that has something to do with diversity in the workplace or in society at large. (Current means within the last 30 - 45 days.) Your current event can be about anything related to diversity, including positive stories of people doing good things. Diversityinc.com is a great source. You can also google and search using "diversity" + "news" and you will find an endless supply of news stories. Make sure the site you use is a reputable source. (Do not use information obtained from a blog.) Post a summary of the article and give us your opinion about the relevance of the article. Discuss how the issue is related to our class. Provide a link to the article so others can access the article and read it if they choose.

In: Psychology

Suppose your selected company(choose one of the two) just paid a dividend of $ 2.20 per...

Suppose your selected company(choose one of the two) just paid a dividend of $ 2.20 per share. The dividend are to calculate the share's expected return. You observe that the risk-free rate of return on us treasuries is 2% p.a, the market risk premium is 7 % and the company's equity has a current beta of 1.285. what is the market value of the company's shares? Compare the actual closing price of your selected company's share on the balance sheet date. Why might the actual share price differ from the calculated price? explain. I choose Woolworth ltd in australia and the other company is Wesfarmers Ltd

In: Finance

Convert this C++ code to Java code this code is to encrypt and decrypt strings of...

Convert this C++ code to Java code

this code is to encrypt and decrypt strings of characters using Caesar cipher

please attach samples run of the code

#include <iostream>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string>

#define MAX_SIZE 200

void encrypt_str(char xyz[], int key); // Function prototype for the function to encrypt the input string.
void decrypt_str(char xyz[], int key); // Function prototype for the function to decrypt the encrypted string.

using namespace std;

int main()
{
char input_str[MAX_SIZE];
int shift = 6; // This is the Caesar encryption key... You can change it to whatever value you wish!

system("cls"); // System call to clear the console screen!


cout<<"\nEnter the string to be encrypted :\t";
gets(input_str); // Getting the user to input the string to be encrypted!

cout<<"\nOriginal string:\t" << input_str;

// Function call to encrypt the input string
encrypt_str(input_str, shift);

return 0;
}


// Function Definition for the function to encrypt the input string


void encrypt_str(char xyz[], int key){
char crypted_str[MAX_SIZE]; // To store the resulting string
int k=0; // For indexing purpose
char str;

while(xyz[k] !='\0') // Processing each character of the string until the "end of line" character is met
{
str = toupper(xyz[k]); // Remove "toupper" from this line if you don't wish to see the
// result string in Uppercase...
if(str != ' ') str += key;
{
if(str > 'z') str -=26;
{
crypted_str[k] = str;
k++;
}
}
}
crypted_str[k]='\0';
cout << "\nEncrypted string is:\t" << crypted_str; // Displaying the Crypted String

// Function call to decrypt the encrypted string
decrypt_str(crypted_str, key);
}

// Function Definition for the function to decrypt the encrypted string.
void decrypt_str(char xyz[], int key){
char decrypted_str[MAX_SIZE];
char str;
int k=0;
while(xyz[k] !='\0')
{
str = xyz[k];
if(str != ' ') str -= key;
{
if(str < 'A' && str !=' ') str += 26;
{
decrypted_str[k] = str;
k++;
}
}
}
decrypted_str[k]='\0';
cout << "\n Decrypted string is:\t" << decrypted_str;
}

In: Computer Science

Write a program that performs a merge-sort algorithm without using a recursion. Only using pointers. C++...

Write a program that performs a merge-sort algorithm without using a recursion. Only using pointers.
C++ programming language; #include<iostream>

In: Computer Science