IT-244: Introduction to Database
*Please, i need Unique answer, use your own words (do not copy and paste).
*Please, do not use handwriting. (no need for picture)
Type your ideas/definitions/examples into the message field to the following discussion prompt:
Discussion Topics:
Assume that you have a Saudi football league player database. In this database, you have a table containing players’ attributes such as (Name, age, position, etc.) and you decided to add information about players’ agents. Would you represent the agent information as attributes in the player table or would you create an entity set for players’ agents? Justify your answer.
Note: Provide answers in your own words. Read the comments of your classmates and post at least TWO responses to their comments.
Marking Criteria:
For your Original Post: Maximum 1 mark
For your Two Responses: Maximum 0.5 mark (0.25 for each response)
In: Computer Science
What are a transaction and the SQL statements associated with transaction Management?
In: Computer Science
There is a serial program (single thread, single core) that performs a given task in 47 hours. The core operation of this program is a nested loop doing matrix multiplication.
We would like to get a faster result
We have access to a new multi-core, multi-processor machine with the following characteristics. 4-cores 3-processors. Not only does this new machine have multiple processors with multiple cores, but the single core processing speed is also 25% faster than that of the other single core machine.
8.a. What is the theoretical speedup of this new machine over the old?
8.b. What is the theoretical efficiency of this new machine over the old?
8.c. How many more core operations will this new machine have to do compared to that of the old machine?
8.d. How long will it take the new machine to perform the task that took the old 47 hours?
In: Computer Science
Implement a generic queue. Use the code below for main().
main()
{
int i, x;
float y;
char z;
Queue<int> A;
Queue<float> B;
Queue<char> C;
ifstream in;
in.open("int.txt");
for (i = 0; i < 100; i++){
in >> x;
A.enqueue(x);
}
cout << A.dequeue() << endl;;
for (i = 0; i < 12; i++)
A.enqueue(i);
cout << A.dequeue() << endl;
cout << A.dequeue() << endl;
cout << "Dequeueing: "<< A.dequeue()<< endl;
while (!A.isEmpty())
cout << A.dequeue() << " ";
if (A.isEmpty())
cout << "Integer Queue Is Empty " << endl;
in.close();
cout << endl << "Now for the floating point numbers...." << endl;
in.open("float.txt");
for (i = 0; i < 100; i++){
in >> y;
B.enqueue(y);
}
cout << "Here are the first ten:" << endl;
for (i = 0; i < 10; i++){
cout << B.dequeue() << endl;
}
in.close();
in.open("char.txt");
for (i = 0; i < 100; i++){
in >> z;
C.enqueue(z);
}
cout << "Here are the characters" << endl;
while (!C.isEmpty()){
cout << C.dequeue();
}
in.close();
}
In: Computer Science
\To make the most of programming, you need to deeply understand the principles that underly the paradigm that you are using. For this task you must explain the principles of object oriented programming and relate these to the programs you have created. Create an article / blog post / letter to a friend / comic / movie / podcast / etc that explains the principles of object oriented programming, as you understand them, and outline what qualities you should look for in good object oriented programs. 1. Keep it to about 1 or 2 pages of text (if text based) 2. Videos or podcasts should be kept as short — but still demonstrate depth of understanding. 3. Creativity will be valued Make sure your explanation covers the following: Relate these to programs you have written in this unit. Note: Explain is more than just a description, you want to convey a deeper understanding that can be achieved with a simple description. Try to relate the principles together and express the depth of your understanding. Tip: A deep explanation does not need to be a long one. Aim to convey your understanding in a concise fashion. Tip: Including references to textbooks (not wikipedia) or research papers can help you strengthen your explanation. Remember to reference other peoples work. Concepts and Principles Programming Artefacts Abstraction Encapsulation Class Method Inheritance Polymorphism Object Fields Roles Responsibilities Interface Collaborations Coupling Cohesion
Relate these to programs you have written in this unit.
In: Computer Science
This is the code that needs to be completed... Thank you!
public class MultiplicationTable
{
private int[][] table;
private int rows;
private int cols;
/* Instantiate the two dimensional array named table.
* Assign the numRows parameter to the rows field.
* Assign the numCols parameter in the cols field.
*/
public MultiplicationTable(int numRows, int numCols)
{
}
/* Using nested for loops, fill the table array with
* the values shown in the Multiplication Table document.
*/
public void fillArray()
{
}
/* Using nested for loops, print the table so it looks like
the
* table shown in the Multiplication Table document.
*/
public void printArray()
{
}
}
In: Computer Science
Compare and contrast the three techniques of dealing with critical sections of code in (1) busy-wait, (2) mutex, and (3) semaphore.
In: Computer Science
A program must execute 1012 instructions to solve a problem. A single processor system can solve the problem in 106 seconds. Thus on average the single processor system executes 106 or 1-million instructions per second.
We have a new program that has been parallelized for execution on a distributed-memory system. This parallel program uses (p) processors. Here each processor will execute 1012/p instructions and each processor must send 109(p-1) messages. We will assume there is not additional overhead for the parallel program and that the program will complete after each processor has executed all of its instructions and sent all of its messages (there are no delays for things like waiting for messages).
2.a. If it takes 10-3 seconds to send a message, how long will it take the program to run with 1000 processors if each processor is as fast as the single processor where the serial program was run?
2.b. If we upgrade our network and it now takes only 10-9 seconds to send a message. Same question – how long to run on the same 1000 processors now?
In: Computer Science
Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors. 1.1) Using two-dimensional parity check show what will be transmitted
Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors.
1.1) Using two-dimensional parity check show what will be transmitted codeword using datawords of size 3bits.
1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits.
1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.
codeword using datawords of size 3bits.
1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits.
1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.
MY digits is 732
binary 1011011100
In: Computer Science
Part 1: Image effects
Your first task is to write two functions that manipulate digital images.
You will write two functions that take an image object, create a copy, perform a pixel-by-pixel manipulation, and return the manipulated copy. We have provided three helper functions (open_image, display_image, and save_image) that you can use to test your code. You may write any additional helper functions that you find useful. Below there are descriptions and sample images for each of the required manipulations.
The best way to test your image functions is to modify the main function at the bottom of hw7_images.py. You can add calls to the various image functions and use the helper functions to display and save the new/modified image.
The code for an example function, red_filter, is provided in hw7_images.py; images to show the effect of this filter are shown below.
The two functions you must write are as follows:
1. negative
Create a negative of the image by inverting all of the color values. Recall that the minimum color value is 0 and the maximum is 255. So a color value of 255 becomes 0 and a value of 33 becomes 222.
In: Computer Science
Let us consider applications of parity checks in error correction codes. (a) A Mind at Play: How Claude Shannon Invented the Information Age is a biography of Shannon, who is generally considered the architect of the information age. The ISBN-10 code for the book can be obtained by removing the prefix 978 from its ISBN13 code and then recalculating the check digit (the last digit). Recall that the 10 digits for the ISBN-10 code satisfy X 10 i=1 ixi = 0 mod 11, whereas the 13 digits for the ISBN-13 code satisfy x1 + 3x2 + x3 + 3x4 + ... = 0 mod 10 You are given 978-147676?690 as the ISBN-13 code. Please find the missing digit, and then derive the corresponding ISBN-10 version. (b) Please explain that if a (15,11)-Hamming code is used but the channel makes 2 or more errors, the decoder, using minimum distance decoding, is always wrong. (c) Consider a (15,11)-Hamming code you just designed in the practice exam, with syndromes designed to indicate bit error positions. Say we now extend each 15-bit codeword by one more parity check, x16, such that x16 = P15 i=1 xi mod 2. (c1) Please explain whether it is still useful to use the four syndromes defined for the original (15,11) code to check for single bit errors. (Hint: Consider which bit error positions the four syndromes can detect. You care most about the data bits.) (c2) Write down any additional syndrome(s) you would add. If not, please briefly explain why. (c3) What is the rate of this new 16-bit code? (1 point only here. Don’t overthink!) (c4) How many errors can we correct now with the 16-bit code? Briefly explain whether adding this 16th bit is worthwhile. (d) If we were to design a Hamming code with 5 check bits per codeword, how many data bits can we have per codeword? Please briefly explain why. What is the minimum distance of this code? Can we now correct 2 errors?
In: Computer Science
8.16 LAB: Mileage tracker for a runner
Given the MileageTrackerNode class, complete main() to insert nodes into a linked list (using the InsertAfter() function). The first user-input value is the number of nodes in the linked list. Use the PrintNodeData() function to print the entire linked list. DO NOT print the dummy head node.
Ex. If the input is:
3 2.2 7/2/18 3.2 7/7/18 4.5 7/16/18
the output is:
2.2, 7/2/18 3.2, 7/7/18 4.5, 7/16/18
_____________________________
The given code that i need to use is:
______________________________
Main.cpp
#include "MileageTrackerNode.h"
#include <string>
#include <iostream>
using namespace std;
int main (int argc, char* argv[]) {
// References for MileageTrackerNode objects
MileageTrackerNode* headNode;
MileageTrackerNode* currNode;
MileageTrackerNode* lastNode;
double miles;
string date;
int i;
// Front of nodes list
headNode = new MileageTrackerNode();
lastNode = headNode;
// TODO: Read in the number of nodes
// TODO: For the read in number of nodes, read
// in data and insert into the linked list
// TODO: Call the PrintNodeData() method
// to print the entire linked list
// MileageTrackerNode Destructor deletes all
// following nodes
delete headNode;
}
___________________________________________________
MileageTrackerNode.h
#ifndef MILEAGETRACKERNODEH
#define MILEAGETRACKERNODEH
#include <string>
using namespace std;
class MileageTrackerNode {
public:
// Constructor
MileageTrackerNode();
// Destructor
~MileageTrackerNode();
// Constructor
MileageTrackerNode(double milesInit, string dateInit);
// Constructor
MileageTrackerNode(double milesInit, string dateInit,
MileageTrackerNode* nextLoc);
/* Insert node after this node.
Before: this -- next
After: this -- node -- next
*/
void InsertAfter(MileageTrackerNode* nodeLoc);
// Get location pointed by nextNodeRef
MileageTrackerNode* GetNext();
void PrintNodeData();
private:
double miles; // Node data
string date; // Node data
MileageTrackerNode* nextNodeRef; // Reference to the next
node
};
#endif
______________________________________________
MileageTrackerNode.cpp
#include "MileageTrackerNode.h"
#include <iostream>
// Constructor
MileageTrackerNode::MileageTrackerNode() {
miles = 0.0;
date = "";
nextNodeRef = nullptr;
}
// Destructor
MileageTrackerNode::~MileageTrackerNode() {
if(nextNodeRef != nullptr) {
delete nextNodeRef;
}
}
// Constructor
MileageTrackerNode::MileageTrackerNode(double milesInit, string
dateInit) {
miles = milesInit;
date = dateInit;
nextNodeRef = nullptr;
}
// Constructor
MileageTrackerNode::MileageTrackerNode(double milesInit, string
dateInit, MileageTrackerNode* nextLoc) {
miles = milesInit;
date = dateInit;
nextNodeRef = nextLoc;
}
/* Insert node after this node.
Before: this -- next
After: this -- node -- next
*/
void MileageTrackerNode::InsertAfter(MileageTrackerNode* nodeLoc)
{
MileageTrackerNode* tmpNext;
tmpNext = nextNodeRef;
nextNodeRef = nodeLoc;
nodeLoc->nextNodeRef = tmpNext;
}
// Get location pointed by nextNodeRef
MileageTrackerNode* MileageTrackerNode::GetNext() {
return nextNodeRef;
}
void MileageTrackerNode::PrintNodeData(){
cout << miles << ", " << date <<
endl;
}
In: Computer Science
How is a technical report different from a news report? Mention their differences.
In: Computer Science
IF YOU HAVE ANSWERED THIS QUESTION BEFORE THEN PLEASE DONOT ANSWER AGAIN.
Your task for this assignment is to implement a stack data structure in C++. This may be accomplished by utilizing the C++ standard template library (STL) or by utilizing a user-defined class.
Implement a transaction-based stack data structure using C++. The program will be interactive. Data transactions will be entered at the command line and results will be displayed on the console.
Each input transaction will contain an arithmetic expression in post-fix format. Assume that operands and operations are separated by a space on an input line that contains one arithmetic expression. An operand will be a positive or negative float number. An operation may be +, -, * or /. You may assume that each arithmetic expression is correctly formatted. However, your program should not allow an attempt to divide by zero. Instead of dividing by zero, your program should display an error message and then begin evaluating a new input transaction.
Sample input transactions are these:
2.0 3.3 + (result = 5.3)
34*-2.5/ (result=-4.8)
9.5 8 3.0 2 * 6 - / + (result= “error: division by zero”)
An input transaction containing “end-of-file” indicates there are no more transactions to be processed. Implement a stack to evaluate each expression and display the result. Use the C++ built-in class or a user-defined class to implement stack functions.
The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. The program should display a prompt requesting input, such as “Please enter an expression in post-fix notation:”.
5. You are encouraged to add additional comments throughout the program that your feel might be helpful to the reader of your source code.
In: Computer Science
A consultant has recommended your organization look to increase its security profile in relation
to SMTP traffic. Management has asked you devise a firewall-specific strategy to address the
recommendation. What strategy would you recommend, and why?
Your answer should be approximately 200-250 words in length.
In: Computer Science