What are the differences and similarities in Bing and Google Webmaster Guidelines?
In: Computer Science
In: Computer Science
language: python
A local biologist needs a program to predict population growth. The inputs would be:
For example, one might start with a population of 500 organisms, a growth rate of 2, and a growth period to achieve this rate of 6 hours. Assuming that none of the organisms die, this would imply that this population would double in size every 6 hours. Thus, after allowing 6 hours for growth, we would have 1000 organisms, and after 12 hours, we would have 2000 organisms.
Write a program that takes these inputs and displays a prediction of the total population.
An example of the program input and output is shown below:
Enter the initial number of organisms: 10 Enter the rate of growth [a real number > 1]: 2 Enter the number of hours to achieve the rate of growth: 2 Enter the total hours of growth: 6 The total population is 80
also make sure it test for these cases
Test Case 1
Test for 100 organisms with growth rate of 5 over 2 hrs over 25 hrs total
Test Case 2
Test for 10 organisms with growth rate of 2 over 2 hrs over 6 hrs total
Test Case 3
Test for 0 organisms with growth rate of 5 over 1 hr over 6 hrs total
Test Case 4
Test for 7 organisms with growth rate of 7 over 7 hrs over 7 hrs total
In: Computer Science
Using C language
0. (3pts.)
Using opendir() and readdir(), open the current directory and
output all filenames until there are no more. Include a main that
does this below.
1. (4pts.)
Parse the dirent struct to see if an entry is a directory or a
file. If it is a directory, prepend "./" to the filename before
printing it out. Include a main that does this below.
2. (3pts.)
Open a file handle to each file, use lseek to determine the file's
size in bytes and print out the file's size in bytes next to its
name. Include a main that does this below.
EX. (3pts.)
Add a color formatting element. Print out executable binaries in
bold red, regular files in light green, directories in light blue
and anything else in white. Be careful - changing the console
printout color is a durable operation that is global in scope, so
once you change the color, anything printed from anywhere in your
Process will be in in that color. It is a good practice to always
presume the color is incorrectly set before you print and to set it
to what you want before you print anywhere (especially in
informational or error outputs). You will also need to find a way
to determine if a file is executable or not
In: Computer Science
Java Assignment:
The layout of Farmer John's farm is quite peculiar, with a large circular road running around the perimeter of the main field on which his cows graze during the day. Every morning, the cows cross this road on their way towards the field, and every evening they all cross again as they leave the field and return to the barn.
As we know, cows are creatures of habit, and they each cross the road the same way every day. Each cow crosses into the field at a different point from where she crosses out of the field, and all of these crossing points are distinct from each-other. Farmer John owns exactly 26 cows, which he has lazily named A through Z (he is not sure what he will do if he ever acquires a 27th cow...), so there are precisely 52 crossing points around the road. Farmer John records these crossing points concisely by scanning around the circle clockwise, writing down the name of the cow for each crossing point, ultimately forming a string with 52 characters in which each letter of the alphabet appears exactly twice. He does not record which crossing points are entry points and which are exit points.
Looking at his map of crossing points, Farmer John is curious how many times various pairs of cows might cross paths during the day. He calls a pair of cows (a,b)(a,b) a "crossing" pair if cow aa's path from entry to exit must cross cow bb's path from entry to exit. Please help Farmer John count the total number of crossing pairs.
INPUT FORMAT (file circlecross.in):
The input consists of a single line containing a string of 52 upper-case characters. Each letter of the alphabet appears exactly twice.
OUTPUT FORMAT (file circlecross.out):
Please print the total number of crossing pairs.
SAMPLE INPUT:
ABCCABDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ
SAMPLE OUTPUT:
1
In this example, only cows A and B are a crossing pair.
In: Computer Science
Write two Java programs and verify that they work.
Program 1 should:
Program 2 should do the same as program 1, except program 2 goes from UTF-16 to UTF-8
Note: we are supposed to write two java programs, the first program should read utf8 encoded text file and the second program should write utf16 text file. So, if you can give me the java code that can read and write utf8 and utf16 text files respectively , I would be happy. Thank you.
In: Computer Science
Linux project deployment Script
Create a script “setup.sh” to automate the deployment of a flask application. The script must install all software dependencies such as:
Python3
Pip3
Git
Use github to clone this repository.
Install the dependencies given in requirements.txt
Start the server by executing the following command “gunicorn wsgi:app”
requirements.txt
Click==7.0
Flask==1.0.2
Flask-Cors==3.0.7
Flask-JWT==0.3.2
Flask-SQLAlchemy==2.3.2
gunicorn==19.9.0
itsdangerous==1.1.0
Jinja2>=2.10.1
MarkupSafe==1.1.1
PyJWT==1.4.2
six==1.12.0
SQLAlchemy==1.3.1
werkzeug>=0.15.3
In: Computer Science
You have developed the overall Virtual Private Cloud (VPC) design for the cloud initiative for Get-Sole Shoes. Now it is time to examine the infrastructure that would be used within the VPC.
From this week’s reading, review the use of Elastic Compute Cloud (EC2) within a VPC for the servers that will be needed for the company.
Respond to the following in a minimum of 175 words:
In: Computer Science
1)If an algorithm performs N steps then we say it is O(N) ?
2) An example of something that is O(N) is(chose one)
A)printing to the screen.B)executing a conditional statement. C) initializing an integer variable. D) looping through an array of size N.
3)Suppose we found the run time of an algorithm was O(2N3 + 4N2 + 5N + 3). What is the Big O notation for the algorithm?
A) O(5N), B) O(4N^2), C) O(N^3), D) O(2N^3)
In: Computer Science
Multiplication of Matrix is one of the tasks that takes time to compute. Note that the time complexity of multiplying two square matrix is o(n^3) using the nested loops method, and Strassen algorithm improves it to O(n^2.8074). Multi-threading can be used to further enhance this.
Using the matrices below, write
(a) a serial program (the normal nested loops method) to perform the multiplication.
(b) a multithreaded program using pthreads to perform this computation.
(c) compare the execution times of (a) and (b) in a table.
In: Computer Science
In: Computer Science
Draw the red-black BST that results when you insert letters A through K int order into an initially empty tree, then describe what happens in general when trees are built by insertion of keys in ascending order. What about descending order?
In: Computer Science
1. Write the set { x | x ∈ R, x2 = 4 or x
2 = 9} in list form.
2. {x: x is a real number between 1 and 2} is an
a) finite set
b) empty set
c) infinite set
3. Write set {1, 5, 15, 25,…} in set-builder form.
4. What is the cardinality of each of these sets?
a) {{a}}
b) {a, {a}}
c) {a, {a}, {a, {a}}}
d) {∅}
e) {∅, {∅}, {∅, {∅}}}
5. Suppose that A is the set of sophomores at your school and B is
the set of students in
discrete mathematics at your school. Express the following set in
terms of A and B:
"the set of students at your school who either are not sophomores
or are not taking discrete
mathematics"
a. A
c ∩ Bc
b. A
c U B
c
c. B-A
d. A-B
6. Let A be the set of students who live within one mile of school
and let B be the set of
students who walk to classes. Describe the set B-A.
a. The set of students who walk to classes but live more than 1
mile away from school.
b. The set of students who walk to classes but live within 1 mile
away from school.
c. The set of students who walk to classes.
7. What is the power set of the set {1, a, b}?
8. Let S = {∅, ?,{?}}Determine whether each of these is an element
of S, a subset of S, neither,
or both.
a) {?}
b) {{?}}
c) ∅
d) { {∅ }, ?}}
8. Determine whether each of these statements is true or
false.
a) 0 ∈ ∅
b) ∅ ∈ {0}
c) {0} ⊂ ∅
d) ∅ ⊂ {0}
e) {0} ∈ {0}
f) {0} ⊂ {0}
g) {∅} ⊆ {∅}
9. Let A = {a, b, c}, B = {x, y}, and C = {0, 1}.
Find A × B × C.
10. Find A2
if A = {0, a, 3}.
In: Computer Science
You are experiencing issues when trying to transfer files between two computers using FTP. What could be the potential cause(s) of the issue? Select all that apply.
Server is not able to resolve the client IP address |
|
Inbound port UDP 21 is blocked in the server |
|
The remote host does not allow connections on high ports 49152 - 65535 |
|
Inbound port TCP 21 is blocked in the server |
|
Client is not able to resolve the remote IP address |
Which of the following best describes the function of the TTL/hop limit for IP packages?
Prevents a computer from keeping the same IP forever, which could potentially cause IP address conflicts in the network (perhaps due to incorrect DHCP configuration) |
|
Tells the client for how long it should cache the local ephemeral port used in a TCP connection to allow fast reconnections |
|
Indicates to the server for how long it should keep a TCP connection with a specific client to mitigate denial-of-service (DoS) attack |
|
Prevents IP packets from getting stuck in infinite routing loops (perhaps due to incorrect routing tables) |
In: Computer Science
Use VB.net to create a loop that posts the first 100 prime numbers. Then, write code to confirm the numbers are prime.
In: Computer Science