When creating the Academic Database, there were several instances of data validation. Data types were assigned to each field in the table to stop undesirable values from being placed into certain fields. A presence check was used on fields that were listed as NOT NULL, requiring some data to be input. Uniqueness validation was automatically assigned for fields that were primary keys. Describe at least one field in the Academic Database a table where range validation could have been used and describe at least one field in the Academic Database where choice validation could have been used. Your answer should be addressed in 100 to 150 words.
In: Computer Science
OpenGL problem
Draw the entire scene composed with more than 5 objects. Scene should Include rigid transformations such as scale, rotate, translate, etc.
And please write down the code of the application program.cpp file (files containing main, render, etc). Also, show the picture of captured result screen.
you should give 1. code of the application program.cpp, 2. picture of captured result screen(entire scene). Please don't give incomplete answer.
In: Computer Science
suppose i have a list in python that is [hello,yo,great,this,cool,fam]
how do I get all the possible 2 combination that I can have from this list in tuples for example output
[ {hello,hello},{hello,yo},{hello,great},....... {yo,hello},{yo,yo} and so on and son}
no packages allowed
In: Computer Science
5.25. The following pseudocode (next page) is a correct implementation of the producer/consumer problem with a bounded buffer:
Labels p1, p2, p3 and c1, c2, c3 refer to the lines of code shown above (p2 and c2 each cover three lines of code). Semaphores empty and full are linear semaphores that can take unbounded negative and positive values. There are multiple producer processes, referred to as Pa, Pb, Pc, etc., and multiple consumer processes, referred to as Ca, Cb, Cc, etc. Each semaphore maintains a FIFO (first-in-first-out) queue of blocked processes. In the scheduling chart below, each line represents the state of the buffer and semaphores after the scheduled execution has occurred. To simplify, we assume that scheduling is such that processes are never interrupted while executing a given portion of code p1, or p2, . . . , or c3. Your task is to complete the following chart.
|
item[3] buffer; // initially empty semaphore empty; // initialized to +3 semaphore full; // initialized to 0 binary_semaphore mutex; // initialized to 1 |
|
|
void producer() |
void consumer() |
|
{ |
{ |
|
... |
... |
|
while (true) { |
while (true) { |
|
item = produce(); |
c1: wait(full); |
|
p1: wait(empty); |
/ wait(mutex); |
|
/ wait(mutex); |
c2: item = take(); |
|
p2: append(item); |
\ signal(mutex); |
|
\ signal(mutex); |
c3: signal(empty); |
|
p3: signal(full); |
consume(item); |
|
} |
} |
|
} |
} |
|
Scheduled Step of Execution |
full’s State and Queue |
Buffer |
empty’s State and Queue |
|
Initialization |
full=0full=0 |
OOO |
empty=+3empty= +3 |
|
Ca executes c1 |
full=−1full= −1 (Ca) |
OOO |
empty=+3empty= +3 |
|
Cb executes c1 |
full=−2full= −2 (Ca, Cb) |
OOO |
empty=+3empty= +3 |
|
Pa executes p1 |
full=−2full= −2 (Ca, Cb) |
OOO |
empty=+2empty= +2 |
|
Pa executes p2 |
full=−2full= −2 (Ca, Cb) |
X OO |
empty=+2empty= +2 |
|
Pa executes p3 |
full=−1full= −1 (Cb) Ca |
X OO |
empty=+2empty= +2 |
|
Ca executes c2 |
full=−1full= −1 (Cb) |
OOO |
empty=+2empty= +2 |
|
Ca executes c3 |
full=−1full= −1 (Cb) |
OOO |
empty=+3empty= +3 |
|
Pb executes p1 |
full= full= |
empty= empty= |
|
|
Pa executes p1 |
full= full= |
empty= empty= |
|
|
Pa executes __ |
full= full= |
empty= empty= |
|
|
Pb executes __ |
full= full= |
empty= empty= |
|
|
Pb executes __ |
full= full= |
empty= empty= |
|
|
Pc executes p1 |
full= full= |
empty= empty= |
|
|
Cb executes __ |
full= full= |
empty= empty= |
|
|
Pc executes __ |
full= full= |
empty= empty= |
|
|
Cb executes __ |
full= full= |
empty= empty= |
|
|
Pa executes __ |
full= full= |
empty= empty= |
|
|
Pb executes p1-p3 |
full= full= |
empty= empty= |
|
|
Pc executes __ |
full= full= |
empty= empty= |
|
|
Pa executes p1 |
full= full= |
empty= empty= |
|
|
Pd executes p1 |
full= full= |
empty= empty= |
|
|
Ca executes c1-c3 |
full= full= |
empty= empty= |
|
|
Pa executes __ |
full= full= |
empty= empty= |
|
|
Cc executes c1-c2 |
full= full= |
empty= empty= |
|
|
Pa executes __ |
full= full= |
empty= empty= |
|
|
Cc executes c3 |
full= full= |
empty= empty= |
|
|
Pd executes p2-p3 |
full= full= |
empty= |
In: Computer Science
In: Computer Science
Scenario:
Startup company established on 01/01/20XX has 12 people personnel of which one executive director, one CIO one manager of software one manager of hardware one CFO and 5 engineers and one secretary, which plays role of public relations as well apart from day to day data management duties.
The company develops hardware and software for resolvers which sells on larger companies. Some of the contracts include the company to be supplier of a larger company which has government contracts.
The company exploits one central server with 100 nodes, shared storage, shared data space similar to DropBox, shared scanner and 10 printers.
All workstations were placed in cubicles in main room and the secretary desk and workstation along with 2 printers was set up at main entrance hallway.
Q1. On March 10/20XX the new server was delivered and mangers along with CIO and executive director made a meeting to establish a policy of use of the resource. It was decided that:
Do you think this set up have security risks? Describe these risks if any and propose a better solution and describe why your solution is better.
In: Computer Science
C++ give some examples of where you could use the stream manipulators to format output.
In: Computer Science
Demonstrate, with a program, if this is true or false
:Scope is the portion of a program that can refer to an entity by its simple name
In: Computer Science
I need the following code completed:
#include <iostream>
#include <time.h>
#include "CSVparser.hpp"
using namespace std;
//============================================================================
// Global definitions visible to all methods and classes
//============================================================================
// forward declarations
double strToDouble(string str, char ch);
// define a structure to hold bid information
struct Bid {
string bidId; // unique identifier
string title;
string fund;
double amount;
Bid() {
amount = 0.0;
}
};
// FIXME (1): Internal structure for tree node
struct Node {
Bid data; Node *left; Node *right;
};
//============================================================================
// Binary Search Tree class definition
//============================================================================
/**
* Define a class containing data members and methods to
* implement a binary search tree
*/
class BinarySearchTree {
private:
Node* root;
void addNode(Node* node, Bid bid);
void inOrder(Node* node);
Node* removeNode(Node* node, string bidId);
public:
BinarySearchTree();
virtual ~BinarySearchTree();
void InOrder();
void Insert(Bid bid);
void Remove(string bidId);
Bid Search(string bidId);
};
/**
* Default constructor
*/
BinarySearchTree::BinarySearchTree() {
// initialize housekeeping variables
}
/**
* Destructor
*/
BinarySearchTree::~BinarySearchTree() {
// recurse from root deleting every node
}
/**
* Traverse the tree in order
*/
void BinarySearchTree::InOrder() {
}
/**
* Insert a bid
*/
void BinarySearchTree::Insert(Bid bid) {
Node p = Insert(root, bid);
p->data.bidId = bid.bidId;
p->data.title = bid.title;
p->data.fund = bid.fund;
p->data.amount = bid.amount;
}
/**
* Remove a bid
*/
void BinarySearchTree::Remove(string bidId) {
deleteNode(root,bidid);
}
/**
* Search for a bid
*/
Bid BinarySearchTree::Search(string bidId) {
// FIXME (3) Implement searching the tree for a bid
Bid bid;
if (root == NULL || root->data.bidId == bidId)
{
bid.bidId = bidId;
bid.title = root->data.title;
bid.fund = root->data.fund;
bid.amount = root->data.amount;
return bid;
}
if (root->data.bidId < bidId)
return search(root->right, bidId);
return search(root->left, bidId);
return bid;
}
/**
* Add a bid to some node (recursive)
*
* @param node Current node in tree
* @param bid Bid to be added
*/
void BinarySearchTree::addNode(Node* node, Bid bid) {
// FIXME (2b) Implement inserting a bid into the tree
Node p = insertNode(node, bid);
p->data.bidId = bid.bidId;
p->data.title = bid.title;
p->data.fund = bid.fund;
p->data.amount = bid.amount;
}
void BinarySearchTree::inOrder(Node* node) {
}
//============================================================================
// Static methods used for testing
//============================================================================
/**
* Display the bid information to the console (std::out)
*
* @param bid struct containing the bid info
*/
void displayBid(Bid bid) {
cout << bid.bidId << ": " << bid.title << "
| " << bid.amount << " | "
<< bid.fund << endl;
return;
}
/**
* Load a CSV file containing bids into a container
*
* @param csvPath the path to the CSV file to load
* @return a container holding all the bids read
*/
void loadBids(string csvPath, BinarySearchTree* bst) {
cout << "Loading CSV file " << csvPath <<
endl;
// initialize the CSV Parser using the given path
csv::Parser file = csv::Parser(csvPath);
// read and display header row - optional
vector<string> header = file.getHeader();
for (auto const& c : header) {
cout << c << " | ";
}
cout << "" << endl;
try {
// loop to read rows of a CSV file
for (unsigned int i = 0; i < file.rowCount(); i++) {
// Create a data structure and add to the collection of
bids
Bid bid;
bid.bidId = file[i][1];
bid.title = file[i][0];
bid.fund = file[i][8];
bid.amount = strToDouble(file[i][4], '$');
//cout << "Item: " << bid.title << ", Fund: " << bid.fund << ", Amount: " << bid.amount << endl;
// push this bid to the end
bst->Insert(bid);
}
} catch (csv::Error &e) {
std::cerr << e.what() << std::endl;
}
}
/**
* Simple C function to convert a string to a double
* after stripping out unwanted char
*
* credit: http://stackoverflow.com/a/24875936
*
* @param ch The character to strip out
*/
double strToDouble(string str, char ch) {
str.erase(remove(str.begin(), str.end(), ch), str.end());
return atof(str.c_str());
}
/**
* The one and only main() method
*/
int main(int argc, char* argv[]) {
// process command line arguments
string csvPath, bidKey;
switch (argc) {
case 2:
csvPath = argv[1];
bidKey = "98109";
break;
case 3:
csvPath = argv[1];
bidKey = argv[2];
break;
default:
csvPath = "eBid_Monthly_Sales_Dec_2016.csv";
bidKey = "98109";
}
// Define a timer variable
clock_t ticks;
// Define a binary search tree to hold all bids
BinarySearchTree* bst;
Bid bid;
int choice = 0;
while (choice != 9) {
cout << "Menu:" << endl;
cout << " 1. Load Bids" << endl;
cout << " 2. Display All Bids" << endl;
cout << " 3. Find Bid" << endl;
cout << " 4. Remove Bid" << endl;
cout << " 9. Exit" << endl;
cout << "Enter choice: ";
cin >> choice;
switch (choice) {
case 1:
bst = new BinarySearchTree();
// Initialize a timer variable before loading bids
ticks = clock();
// Complete the method call to load the bids
loadBids(csvPath, bst);
//cout << bst->Size() << " bids read" << endl;
// Calculate elapsed time and display result
ticks = clock() - ticks; // current clock ticks minus starting
clock ticks
cout << "time: " << ticks << " clock ticks"
<< endl;
cout << "time: " << ticks * 1.0 / CLOCKS_PER_SEC
<< " seconds" << endl;
break;
case 2:
bst->InOrder();
break;
case 3:
ticks = clock();
bid = bst->Search(bidKey);
ticks = clock() - ticks; // current clock ticks minus starting clock ticks
if (!bid.bidId.empty()) {
displayBid(bid);
} else {
cout << "Bid Id " << bidKey << " not
found." << endl;
}
cout << "time: " << ticks << " clock ticks"
<< endl;
cout << "time: " << ticks * 1.0 / CLOCKS_PER_SEC
<< " seconds" << endl;
break;
case 4:
bst->Remove(bidKey);
break;
}
}
cout << "Good bye." << endl;
return 0;
}
In: Computer Science
The goal of this problem is to design a system to manage a moving company.
Customers who are planning to move (e.g., moving from a house to another one) call the moving assistant at the company to schedule their moving. The customer provides potential moving dates as well as the moving-from address and moving-to address. The assistant replies with a list of available dates. The customer picks a moving date and time. The assistant then schedules a virtual tour (with a date and time) with the customer (typically within the following 3 days) to provide a more accurate estimate about the moving price.
At the virtual tour date and time, the assistant calls the customer (e.g., via Zoom). The customer shows the major items to be moved. At the end of the virtual tour, the assistant gives the hourly rate, estimated total price, and estimated moving duration (number of hours). The assistant also emails a contract to the customer. If interested, the customer signs the contract and emails it back to the assistant. To validate the contract, the assistant calls the customer back. The customer provides credit card information to pay a deposit. Payment information is sent to the credit card company for authorization. If authorized, a deposit receipt is given to the customer.
At moving date, a crew of the company’s movers starts the actual moving. The head of the moving crew records the start time and share it with the customer. At the end of the moving, the head of the moving crew records the end time and calculates the actual total price. The customer provides credit card information. Payment information is sent to the credit card company for authorization. If authorized, a final receipt is given to the customer.
One week after the moving, the customer receives a survey form by email to evaluate the moving experience. The customer emails back the filled out form.
In: Computer Science
What is the difference between Green IT and Green IS? Discuss TWO recent advancements in development of green data centres?
A report that includes answers to the questions on the given topic. The report should have at least two references (if one reference is a website, the other should be a scientific/formal reference).
Format of the report to answer the questions • The report that has answers to the questions of the given topics. • The report should be between 1000 to 1250 words. • The report must use 12pt font, 1.5 spacing, Arial font.
In: Computer Science
Using CrypTool2, display the results of encrypting the following plain text using the Caesar Cipher method and a left shift value of 3.
MEET YOU AT THE FOOTBALL MATCH
In: Computer Science
The Model View Controller (MVC) and Tier architecture are two of the most widely used web design architectures currently in use.
a. Explain both concepts to a team of research who want you to build a website and publish their work.
b. Make a case by thoroughly explaining why one of the architectures in ‘a’ should be chosen over the other.
c. Brief the researchers on the dangers of using the internet and the necessary steps that you would put in place to curtail such dangers.
In: Computer Science
Is it possible to improve the performance of KNN using an AdaBoost ensemble classifier that uses KNN as the base classifier? Give the detailed (qualitative) reasons on your assertions.
In: Computer Science
The title of the course is ARTIFICIAL INTELLIGENCE AND EXPERT SYSTEMS I. All answers should be based on that. Please do not copy and paste answers on chegg or on google for me. All answers should be based on your understanding on the course. Please try as much to answer the questions based on what is asked and not setting your own questions and answering them. Let it be if you want to copy and paste answers.
*********************************************************************************************************************************************************************************************************************
(a) AI concentrates on developing systems which enables the
computer to
perform human-like activities through 'reasoning' based on
programmed rules. Explain how this ‘reasoning’ is factored in
developing simple expert system for medical diagnosis that is
based
on interview and for suggesting a list of ten common drugs.
(b) The subject area of expert (knowledge based) systems is a
branch
of artificial intelligence (AI); which in turn is a branch of
computer
science that attempts to understand the nature of intelligence
and
produce new classes of intelligent machines. Considering the fields
of
engineering or business, demonstrate with five (5) practical
diagrams
and explain how they represent new classes of
intelligence.
(c) As compared to humans, computers can process more
information at a
faster rate. For instance, if the human mind can solve a
mathematics
problem in 5 minutes, AI can solve 10 problems in less than a
minute.
What could be the reasons, if rather; a computer solves 5
mathematics
problems in a minute whiles human solves 10 problems in 5
minutes.
NOTE: There is already an answer here and I'm not satisfied with it so don't copy and paste it to me again or else will have no option than discredit you.
In: Computer Science