We consider the dining philosophers problem. If all philosophers pick up their left fork, that causes deadlock.
Question: If one (and only one) of the philosophers instead tries to pick up their right fork first, can this system still deadlock? Why/ why not?
In: Computer Science
Question 1
Argue any SIX (6) factors that will cause the unsuccessful of Sahana software project in offering an effective timely access to comprehensive, relevant and reliable information for humanitarian operations today.
In: Computer Science
Create a table called product containing a product number, company name, model number, product name. What is my primary key? Which datatypes should I use? Please submit a printout of the commands used for creating the above table and the results of your queries/commands.
PLEASE USE JAVA & H2DATABASE
In: Computer Science
Python Q1. def silly(stuff, more_stuff=None): data = [] for i, thing in enumerate(stuff): if thing >= 0 or i < 2: data.append(thing + i) print(len(stuff)) if more_stuff is not None: data += more_stuff print(data)
Write a Python statement that calls silly and results in the output (from within silly):
4 [5, 3, 1, 5, -3]
stuff = [5, 2, 0, 2]
more_stuff = [-3]
silly(stuff, more_stuff)
Q2.
Function silly2 is defined as:
def silly2(nums, indices, extra=None): print(len(nums), len(indices)) new_indices = [] for i in indices: if i >= 0 and i < len(nums): new_indices.append(i) if extra: new_indices.append(extra) try: for index in new_indices: if index < len(nums): print(nums[index]) except IndexError: print("We're dead, Fred")
Write a single Python statement that calls silly2 and results in the output:
2 2 We're dead, Fred
In: Computer Science
The Department of Administrative Services (DAS) provides a number of services to other departments in an Australian State Government. These services include HR and personnel management, payroll, contract tendering management, contractor management, and procurement. These services have all been provided from the Department’s own data centres.
As a result of a change in Government policy, DAS is moving to a “Shared Services” approach. This approach will mean that DAS will centralise a number of services for the whole of Government (WofG). The result of this move will be that each Department or Agency that runs one of these services for its own users, will be required to migrate its data to DAS so that it can be consolidated into one of the DAS centralised databases. DAS will then provide these consolidated services to all other Departments and Agencies within the Government.
Another Government policy mandates a “Cloud first” approach to the process of updating or acquiring software or services. Following these strategic policy changes from Government, DAS has decided to:
Tasks
After your successful engagement to provide a security and privacy risk assessment for the DAS, you have again been engaged to consider some additional questions that DAS management has raised.
Prepare a presentation for DAS Management using the TRA you recently completed on the security and privacy of employee data. Your presentation is to show:
Your presentation is to be completed in either PowerPoint or Google slides. Your presentation must not exceed 25 slides of content.
Your presentation should highlight the significant points of your argument, but you should include the detail in the speaking notes section of your slides.
Rationale
back to top
This assessment task will assess the following learning outcome/s:
In: Computer Science
In this exercise, you will create two external style sheet files and a web page. You will experiment with linking the web page to the external style sheets and note how the display of the page is changed.
Create an external style sheet (call it format1.css) to format as follows: document background color of white, document text color of #000099, and document font family of Arial, Helvetica, or sans-serif. Hyperlinks should have a background color of gray (#CCCCCC). Configure the h1 selector to use the Times New Roman font with red text color.
Create an external style sheet (call it format2.css) to format as follows: document background color of yellow and document text color of green. Hyperlinks should have a background color of white. Configure the h1 selector to use the Times New Roman font with white background color and green text color.
Create a web page about your favorite movie that displays the movie name in an <h1> tag, a description of the movie in a paragraph, and an unordered (bulleted) list of the main actors and actresses in the movie. The page should also have a hyperlink to a website about the movie. Place an e-mail link to yourself on the web page, email link. This page should be associated with the format1.css file. Save the page as moviecss1.html. Be sure to test your page in more than one browser. Modify the moviecss1.html page to link to the format2.css external style sheet instead of the format1.css file. Save the page as moviecss2.html and test it in a browser. Notice how different the page looks!
In: Computer Science
Write a C++ program, all the answers so far on this site have been wrong when I compiled them.. Desired outputs at the end.
--In this exercise, you are to modify the Classified Numbers programming example in this chapter. As written, the program inputs the data from the standard input device (keyboard) and outputs the results on the standard output device (terminal screen). The program can process only 20 numbers. Rewrite the program to incorporate the following requirements:
a) Data to the program is input from a file of an unspecified length named Ch06_Ex20Data.txt; that is , the program does not know in advance how many numbers are in the file.
b) Save the output of the program in a file named Ch06_Ex20Out.txt.
c) Modify the void function getNumber so that it reads a number from the input file (opened in the function main), outputs the number to the output file (opened in the function main), and sends the number read to the function main. Print only 10 numbers per line. Assume all numbers are between -9999 and 9999.
d) Have the program find the sum and average of the numbers.
e) Modify the function printResult so that it outputs the final results to the output file (opened in the function main). Other than outputting the appropriate counts, this new definition of the function printResult should also output the sum of the numbers
Outputs in the program should look like this:
Processing Data
There are 27 evens, which includes 12 zeros
Total number of odds are: 16
The sum of numbers = 558
The average is 12
press any key to exit.
The OutFile should look like this
E:\FolderName\Lab\Ch06_Ex20> type Ch06_Ex20Out.txt
43 67 82 0 35 28 -64 7 -87 0
0 0 0 12 23 45 7 -2 -8 -3
-9 4 0 1 0 -7 23 -24 0 0
12 62 100 101 -203 -340 500 0 23 0
54 0 76
There are 27 evens, which includes 12 zeros
Total number of odds are: 16
The sum of numbers = 558
The average is 12
E:\FolderName\Lab\Ch06_Ex20>
In: Computer Science
CS 430 Internet Multimedia Program
This individual project is open-topic. Games, Animations, Commercial business sites, Blogs, anything is acceptable! Use the knowledge we have learned, your creativity and imagination!
I need to write a code for creating a website of my own
Please provide the links to the picture
In: Computer Science
Do a bit of research on the hearsay rule in legal proceedings. In your own words, explain the hearsay rule and describe how it relates to the concept of an expert witness. Write a short paper, 300-400 words
In: Computer Science
(Linear time algorithm for finding duplicates of two sorted arrays, 20pt)
Devise a linear time O(m+n) algorithm to find the duplicates between two sorted arrays (m, n are the sizes of two arrays). For instance, for inputs {1,3,5,7} and {1,2,3,4}, the correct outputs should be {1,3
In: Computer Science
Python 3:
Write a function called Interest with floating point parameters Amount and InterestPercent that calculates the simple interest on Amount using InterestPercent as the interest rate.The function should return the interest amount.
In: Computer Science
In Visual Studio in C#, you will create a simple calculator that performs addition, subtraction, multiplication, and division. Your program should request a numerical input from the user, followed by the operation to be performed, and the second number to complete the equation. The result should be displayed to the user after each equation is performed. For example, if the user performs 3+3, the program should display 6 as the result.
The program should continue running so the user can perform multiple operations. For example, if the user wants to add, subtract, and then multiply they should be able to do each of these without exiting the program. If you need a reference use the simple calculator on your computer. You do not need to include a function for clearing the result.
In: Computer Science
In this program, there are 3 bugs and 2 syntax errors. Please identify them! The source code is below.
The source code is in C:
/*------------------------------------------------------------------
File: CylinderVolume.c (Lab 3)
Author: Gilbert Arbez, Fall 2018
Description: Calculates how the volume changes for different depths
in a horizontal cylinder.
------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Define symbolic constant
#define N 50 // number of points to compute
#define TRUE 1
#define FALSE 0
// Prototypes
void computeDisplayVolume(double, double);
/*--------------------------------------------------------------------
Function: main
Description: Gets from the user the radius and length of the cylinder,
calls computeDisplayVolume to compute and display a table
of how the volume changes with depth of a liquid in
the cylinder.
----------------------------------------------------------------------*/
void main()
{
// Variable declarations
double radius; // cylinder radius
double length; // cylinder length
int flag; // sentinelle for controlling data input
// Get input from user, the cylinder radius and length
do
{
flag = TRUE;
printf("Please give cylider radius and length: ");
scanf("%lf %lf",&radius, &length);
if(radius <= 0.0 || length <= 0.0)
{
printf("Both values must be greater than zero.\n");
flag = FALSE;
}
} while(flag == TRUE)
// Compute/display depth/volume data
computeDisplayVolume(radius, length);
}
/*------------------------------------------------------------------------
Function: computeDisplayVolume
Parameter
radius - radius of the horizontal cylinder
length - length of the horizontal cylinder
Description: Computes and displays depth/volume data points in a table
that varies the depth of the liquid from 0 to the cylinder diameter.
N such data points are computed (i.e. the increment in the
value of h is 2r/N).
------------------------------------------------------------------------*/
void computeDisplayVolume(double radius, double length)
{
// Declaration of variables
double increment; // how to increment the depth
double h; // depth value
double volume; // volume value
int i ; // loop counter
// setup the variables
increment = radius/N;
h = 0.0;
// Table Header
printf("The change in liquid volume of the cylinder with radius %.2f \nand length %.2f as depth changes is as follows.\n",
radius, length);
printf("%10s %10s\n","Depth", "Volume");
printf("------------------------\n");
// Loop for calculating each of the n depth/volume points.
for(i = 0 i < N; i = i + 1)
{
volume = pow(radius,2)*acos((radius-h)/radius);
volume = volume - (radius - h)*sqrt(2.0*radius*h - pow(h,2));
volume = volume*length;
// Display the row with ocmputed values
printf("%10.2f %10.2f\n", h, volume);
}
}
In: Computer Science
In: Computer Science
An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a python program that takes as input the hourly wage, total regular hours, and total overtime hours and displays an employee’s total weekly pay.
The script must start with comments about the author, assignment and submission date. Save the script using the following naming convention: Name_SID_Assignment#.py. Please submit pseudocode, flow chart and screenshot of the output.
In: Computer Science