Select/identify 20 programming languages
1)Draw a graph, a chart or a table that shows the
history/timeline of the development of the chosen 20
programming languages over years.
2)Identify the domain (area) that each one of the 20 programming
languages is used in. The well known
programming domains are:
a. Scientific Applications
b. Business Applications
c. Artificial Intelligence
d. Systems Programming
e. Web Software
In: Computer Science
im getting this
Error: Main method not found in class Tuple, please define the
main method as:
public static void main(String[] args)
or a JavaFX application class must extend
javafx.application.Application
please modify the code
import java.io.InvalidClassException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class Tuple {
private List<Object> fields; // stores the fields(s) of the tuple in the original sequence
public Tuple(List<Object> fields) throws
InvalidClassException {
this.fields = fields;
}
// gets the fields of this tuple
public List<Object> getFields() {
return fields;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tuple tuple = (Tuple) o;
return Objects.equals(fields, tuple.fields);
}
@Override
public int hashCode() {
return Objects.hash(fields);
}
@Override
public String toString() {
return "Tuple{" +
"fields=" + fields +
'}';
}
}
In: Computer Science
Research one attack of transport layer of TCP/IP model
and answer the following questions
what was the attack?
what layer the attack is done
describe the attack what it is
what does attack hope to achieve
Relate to CIA train
what network vulnerabilities does attack take advantage of
what can be done to mitigate the attack
please attach the reference with answer
In: Computer Science
Furnish definitions and descriptions for:
▪ IP address and Subnet mask
In: Computer Science
Assignment – 1
1- The DISTINCT(X) operator is used to return only distinct (unique) values for datatype (or column) X in the entire dataset .
As an example, for the following table A:
A.ID |
A.ZIPCODE |
A.AGE |
1 |
12345 |
30 |
2 |
12345 |
40 |
3 |
78910 |
10 |
4 |
78910 |
10 |
5 |
78910 |
20 |
DISTINCT(A.ID) = (1, 2, 3, 4, 5)
DISTINCT(A.ZIPCODE) = (12345, 78910)
DISTINCT(A.AGE) = (30, 40, 10, 20)
Implement the DISTINCT(X) operator using Map-Reduce. Provide the algo-
rithm pseudocode. You should use only one Map-Reduce stage, i.e. the algorithm should
make only one pass over the data.
2-The SHUFFLE operator takes a dataset as input and randomly re-orders it.
Hint: Assume that we have a function rand(m) that is capable of outputting a random integer between [1, m].
Implement the SHUFFLE operator using Map-Reduce. Provide the algorithm pseudocode.
3-What is the communication cost (in terms of total data flow on the network between mappers and reducers) for following query using Map-Reduce:
Get DISTINCT(A.ID from A WHERE A.AGE > 30 )
The dataset A has 1000M rows, and 400M of these rows have A.AGE <= 30. DISTINCT(A.ID) has 1M elements. A tuple emitted from any mapper is 1 KB in size.
4-Consider the checkout counter at a large supermarket chain. For each item sold, it generates a record of the form [ProductId, Supplier, Price]. Here, ProductId is the unique identifier of a product, Supplier is the supplier name of the product and Price is the sales price for the item. Assume that the supermarket chain has accumulated many terabytes of data over a period of several months.
The CEO wants a list of suppliers, listing for each supplier the average sales price of items provided by the supplier. How would you organize the computation using the Map-Reduce computation model?
For the following questions give short explanations of your answers.
5-True or False: Each mapper/reducer must generate the same number of output key/value pairs as it receives on the input.
6-True or False: The output type of keys/values of mappers/reducers must be of the same type as their input.
7-True or False: The input to reducers is grouped by key.
8-True or False: It is possible to start reducers while some mappers are still running.
In: Computer Science
April 107 90 29
31 66 0.344
May 106 94 23
35 72 0.372
June 77 62 12
18 29 0.29
July 115 103 20
34 59 0.33
August 124 102 25
36 63 0.353
September 85 69 20
26 44 0.377
(PYTHON)
Using the attached stats.txt, generate a report of a player’s batting average using hits / at bats by month and slugging percent by dividing total bases by at bats. Print out each month, number hits, number of at bats , BA (batting average) and slugging percent (). The input file is organized by month, plate appearances, at bats, runs, hits and total bases.
In: Computer Science
Discuss hyper-social organizations and their growing popularity.
Discuss the reasons for globalization and for using global information systems, including e-business and Internet growth.
Discuss the obstacles that organizations face in implementing and using global information systems.
In: Computer Science
Khan Academy (2019) Measures of Central Tendency and Khan Academy (2019) Measures of Dispersion what is the difference between and common?
In: Computer Science
Can you add code to this so that it finishes the combine function. Given two words as input, the output of the program should be the two words combined together with a space between them. Not allowed to use any external libraries for this assignment.
#include <stdio.h>
#include <stdlib.h>
void combine(char* p, char* q){
/* Add the necesary logic here to combine the strings
in the dynamic array p and q by inserting a space
between two words
and write the result back to p */
}
int main(){
/* No changes should be done in this part */
char* word1 = malloc(sizeof(char) * 128);
char* word2 = malloc(sizeof(char) * 128);
printf("Enter your first word:\t");
scanf("%s", word1);
printf("Enter your second word:\t");
scanf("%s", word2);
combine(word1, word2);
printf("%s\n", word1);
}
In: Computer Science
Verify Login Page that either gives error when not meeting the requirement or directing it to "blogs.php" when it's a successful log in..
Hi, so this is actually my html code for the log in and sign up page and I just needed help creating a verify log in/ sign up page with exception handling. Username has to be at least 6 character long. Password has to be 6 characters long and end with a number.
Blogs.com
"
"index.html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Blogs.com</title>
</head>
<body>
<h2>Sign in </h2>
<p> Enter your username and password to sign
in!</p>
<form method="POST" action ="blogs.php">
<p> User Name <input type ="text"
name="username"/></p>
<p> Password <input type="text" name ="passwordname"
/></p>
<input type="submit" value= "Sign in"/></p>
</form>
<p> Sign up if you're a first time user!</p>
<form method="POST" action ="UserRegistration.php">
<input type="submit" value= "Sign up!"/></p>
<br /><br />
<script>
var date =new Date();
document.write("Today " ,date);
</br>
</script>
</body>
</html>
"UserRegistration"
<?php
session_start();
$_SESSION = array();
session_destroy();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Registration</title>
<meta
http-equiv="content-type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
<h1>User
Registration</h1>
<h2>Register / Log In</h2>
<p>New
user's, please complete the top form to register as a new user.
Returning user's, please complete
the second form to log in.</p>
<hr
/>
<h3>User
Registration</h3>
<form
method="post" action="Register.php?<?php echo SID;
?>">
<p>Enter your Name:
First <input type="text"
name="first" />
Last <input type="text"
name="last" />
</p>
<p>Enter your e-mail address:
<input type="text"
name="email" />
</p>
<p>Enter your password:
<input type="password"
name="password" />
</p>
<p>Confirm your password:
<input type="password"
name="password2" />
</p>
<p>
<em>(Passwords are
case-sensitive and must be at least 6 characters
long)</em>
</p>
<input type="reset" name="reset" value="Reset
Registration Form" />
<input type="submit" name="register"
value="Register" />
</form>
<hr
/>
<?php
$nag_counter = 0;
if(isset($_COOKIE['userVisit']))
$UserVisit = "<p>Your
visit number is $nag_counter was on " .
$_COOKIE['userVisit'];
else
$UserVisit = "<p>This
is your first visit!</p>\n";
++$nag_counter;
setcookie("userVisit", date("F j, Y, g:i a"),
time()+60*60*24*365);
?>
<?php
echo $UserVisit;
?>
</body>
</html>
"
In: Computer Science
1. Add the function int getNodeLevel (T value) to the Binary Search Tree class provided below. The function should return the level of the node value in the Binary Search Tree.
Hint:
Set currentNode to root
Initialize level = 0
while currentNode != Null
if currentNode element = value return level
else move to either the right child or the left child of the currentNode, update the loop, and repeat the loop
Function should return -1 if value is not in the tree
#include <iostream> #include <vector> using namespace std; //****** The Node class for the Binary Search Tree ****** template<typename T> class Node { public: Node(); Node(T e, Node<T>* r, Node<T>* l); T element; // holds the node element Node<T>* right; Node<T>* left; }; //============ implementation of the constructors of the Node template<typename T> Node<T>::Node() { right = left = NULL; } template<typename T> Node<T>::Node(T e, Node<T>* r, Node<T>* l) { element = e; right = r; left = l; } //=============== Binart Searct Tree (BST) class =========== template<typename T> class BTree { public: BTree() { root = NULL; } BTree(Node<T>* rt) { root = rt; } void BSTInsert(T value); void BSTRemove(T value); Node<T>* & getRoot() { return root; } // returns the pointer to the root Node<T>* BSTsearch(T value); private: Node<T>* root; // a pointer to the root of the tree }; template<typename T> Node<T>* BTree<T>::BSTsearch(T value) { // set cur to the tree root, traverse down the tree to find the element. // Do not use the root, if you move the root the tree will be lost. Node<T>* cur = root; while (cur != NULL) { if (value == cur->element) return cur; else if (value < cur->element) cur = cur->left; else cur = cur->right; } return NULL; } // traverse down the tree and inserts at the bottom of the tree as a new leaf template<typename T> void BTree<T>::BSTInsert(T value) { Node<T>* newNode = new Node<T>(value, NULL, NULL); // dynamically create a node with the given value if (root == NULL) //Empty tree, fisrt node. root = newNode; else { Node<T>* r = root; while (r != NULL) { if (value < r->element) { if (r->left == NULL) { r->left = newNode; //insert the node r = NULL; // end the loop. } else r = r->left; // keep going to the left child } else { if (r->right == NULL) { r->right = newNode; r = NULL; } else r = r->right; } } } } //Three cases to consider when removing an element from a BST template<typename T> void BTree<T>::BSTRemove(T value) { Node<T>* parent = NULL; // Need to track the parent of the node to be deleted Node<T>* current = root; // current will point to the node to be deleted //find the node to be removed while (current != NULL && current->element != value) { if (value < current->element) { parent = current; current = current->left; } else { parent = current; current = current->right; } } if (current != NULL) // The node to be deleted is found { //Case A : the node is a leaf node if (current->left == NULL && current->right == NULL) { if (parent->right == current) parent->right = NULL; else parent->left = NULL; delete current; } //Case B: the node has two children // Must find the smalles element in the right subtree of the node, which is //found by going to the right child of the node then all the way to the left. else if (current->left != NULL && current->right != NULL) { Node<T>* succ = current->right; // go to the right child of the node to be removed parent = current; // initialize parent node if (succ->left == NULL) // right child of the node has no left child { parent->right = succ->right; current->element = succ->element; delete succ; } else //otherwise keep going left { while (succ->left != NULL) // then find the smallest element in the left subtree { parent = succ; succ = succ->left; } current->element = succ->element; //Replace the node to be deleted by the succ node parent->left = NULL; // skip the succ node delete succ; } } else // Case C: Node has one child { if (root->element == value) //if the node is the root node treat differently { cout << "here\n"; if (root->right != NULL) root = root->right; else root = root->left; } else // a non root node with one child to be removed { if (current->left != NULL) parent->left = current->left; else parent->right = current->right; } delete current; } } } int main() { BTree<int> bst; bst.BSTInsert(29); bst.BSTInsert(50); bst.BSTInsert(78); bst.BSTInsert(39); bst.BSTInsert(21); return 0; }
In: Computer Science
Method: DoublyLinkedList reverse(DoublyLinkedList list) Reverse() method accepts a DoublyLinkedList of Character as the argument, reverses the elements in the list, and returns the resulting list. For example:
The given list is
'a' 'b' 'c' 'd' 'e'
The return list should be
'e' 'd' 'c' 'b' 'a'
In: Computer Science
In: Computer Science
Consider the Minimum Spanning Tree Problem on an undirected graph G=(V,E), with a cost ce ≥0 on each edge, where the costs may not all be different. If the costs are not all distinct, there can in general be many distinct minimum-cost solutions. Suppose we are given a spanning tree T ⊆ E with the guarantee that for every e ∈ T, e belongs to some minimum-cost spanning tree in G. Can we conclude that T itself must be a minimum-cost spanning tree in G? Give a proof or a counterexample with explanation.
In: Computer Science
In: Computer Science