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
In this lab, you will implement Heap Sort algorithm in C++ and Report the number of steps and the CPU running time in a table,
Approximation the constant c in the complexity of heap sort (cnlgn) by inspecting the results
For each algorithm, and for each n = 100, 200, 300, 400, 500, 1000, 4000, 10000, measure its running time and number of steps when the input is (1) already sort, i.e. n, n-1, …, 3, 2,1; (2) reversely sorted 1, 2, 3, … n; (3) random permutation of 1, 2, …, n; (4) 50 instances of n random numbers generated in the range of [1..n].
In: Computer Science
Make a 20 by 20 matrix in which diagonal elements are 21, 22, 23, 24 … 40 and elements below the diagnol are ij = 2(i 2 j 2 ) and elements above the diagnol are 4×(i+j) Note: You must use if, elseif, else, end or/and if, end or/and if, else, end commands in MATLAB.
In: Computer Science
Write an algorithm to find the primary key and foreign key(s)?
(Every programming language is accepted.)
In: Computer Science
Design and construct a computer program in one of the approved languages (C, C++, C#, Java, Pascal, Python, etc.) that will illustrate the use of a fourth-order explicit Runge-Kutta method of your own design. In other words, you will first have to solve the Runge-Kutta equations of condition for the coefficients of a fourth-order Runge-Kutta method. See the Mathematica notebook on solving the equations for 4th order RK method. .DO NOT USE a[1] or a[2] = 1/2. Then, you will use these coefficients in a computer program to solve the ordinary differential equation below. Be sure to follow the documentation and programming style policies of the Computer Science Department. The initial value problem to be solved is the following: x'(t) = 2 x2 cos(4 t) subject to the initial condition: x(0) = 1.0 Obtain a numerical solution to this problem over the range from t=0.0 to t=2.0 for seven different values of the stepsize, h=0.1, 0.05 , 0.025 , 0.0125 , 0.00625 , 0.003125 , and 0.0015625 .
The answer at the end of the integration is about 1.978940602164785990777661.
Hint: It is often helpful to test your program on simple
differential equations (such as x' = 1 or x'=t or x'=x) as a part
of the debugging process.
Once you have worked these simple cases, then try working the
nonlinear differential equation given above for the assignment
(with a small stepsize).
Also, check your coefficients to make sure that they satisfy the
equations of condition and that you have assigned these correct
values to the
variables or constants in your program properly. For example, a
common error is to write something like: a2 =
1/2; when you meant to write
a2 = 1.0/2.0; so please be
careful.
Write down (in your output file or in a text file) any conclusions that you can make from these experiments (e.g., what happens as h is decreased?).
In: Computer Science
Java question: A rumor spreads in the following way: a person picks at random another person to inform of the rumor. If that person hasn't already been informed of the rumor, that person starts spreading the rumor as well. If that person had already been informed of the rumor, neither person spreads this rumor any further. Starting with 999 people who don't know the rumor and one who does and starts spreading it (1000 people in total), write a class in Java named RumorSpreading that simulates this situation and then prints the final percentage of the population that ends up knowing the rumor. Assume that we do NOT consider the case where more than one person spreads the rumor simultaneously.
In: Computer Science
a. what is digital code
b. explain why different types of codes are used to encode and decode data
c. discuss the reasons why hybrid codecs might be chosen over source codecs in voice over internet protocol communications
In: Computer Science
Hi, Java Question and thanks in advance.
// TODO once BoundingBox and Draw are implemented, change Fixtures.simpleCircle // to Fixtures.complexGroup and test the app on an emulator or Android device @Override @SuppressLint("DrawAllocation") protected void onDraw(final Canvas canvas) { final Shape shape = Fixtures.simpleCircle; final Location b = shape.accept(new BoundingBox()); canvas.translate(-b.getX(), -b.getY()); b.accept(new Draw(canvas, paint)); shape.accept(new Draw(canvas, paint)); canvas.translate(b.getX(), b.getY()); }
public class BoundingBox implements Visitor { // TODO entirely your job (except onCircle) @Override public Location onCircle(final Circle c) { final int radius = c.getRadius(); return new Location(-radius, -radius, new Rectangle(2 * radius, 2 * radius)); } @Override public Location onFill(final Fill f) { return null; } @Override public Location onGroup(final Group g) { return null; } @Override public Location onLocation(final Location l) { return null; } @Override public Location onRectangle(final Rectangle r) { return null; } @Override public Location onStrokeColor(final StrokeColor c) { return null; } @Override public Location onOutline(final Outline o) { return null; } @Override public Location onPolygon(final Polygon s) { return null; } }
mport android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Paint.Style; import edu.luc.etl.cs313.android.shapes.model.*; /** * A Visitor for drawing a shape to an Android canvas. */ public class Draw implements Visitor { // TODO entirely your job (except onCircle) private final Canvas canvas; private final Paint paint; public Draw(final Canvas canvas, final Paint paint) { this.canvas = null; // FIXME this.paint = null; // FIXME paint.setStyle(Style.STROKE); } @Override public Void onCircle(final Circle c) { canvas.drawCircle(0, 0, c.getRadius(), paint); return null; } @Override public Void onStrokeColor(final StrokeColor c) { return null; } @Override public Void onFill(final Fill f) { return null; } @Override public Void onGroup(final Group g) { return null; } @Override public Void onLocation(final Location l) { return null; } @Override public Void onRectangle(final Rectangle r) { return null; } @Override public Void onOutline(Outline o) { return null; } @Override public Void onPolygon(final Polygon s) { final float[] pts = null; canvas.drawLines(pts, paint); return null; } }
import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Paint.Style; import edu.luc.etl.cs313.android.shapes.model.*; import java.util.*; /** * A Visitor for drawing a shape to an Android canvas. */ public class Draw implements Visitor<Void> { // TODO entirely your job (except onCircle) private final Canvas canvas; private final Paint paint; public Draw(final Canvas canvas, final Paint paint) { this.canvas = canvas; // FIXED this.paint = paint; // FIXED paint.setStyle(Style.STROKE); } @Override public Void onCircle(final Circle c) { canvas.drawCircle(0, 0, c.getRadius(), paint); return null; } @Override public Void onStrokeColor(final StrokeColor c) { final int x = paint.getColor(); paint.setColor(c.getColor()); c.getShape().accept(this); paint.setColor(x); return null; } @Override public Void onFill(final Fill f) { final Style a = paint.getStyle(); paint.setStyle(Style.FILL_AND_STROKE); f.getShape().accept(this); paint.setStyle(a); return null; } @Override public Void onGroup(final Group g) { final Iterator<? extends Shape > shape = g.getShapes().iterator(); while (shape.hasNext()) { shape.next().accept(this); } return null; } @Override public Void onLocation(final Location l) { canvas.translate(l.getX(), l.getY()); l.getShape().accept(this); canvas.translate(-l.getX(), -l.getY()); return null; } @Override public Void onRectangle(final Rectangle r) { canvas.drawRect(0, 0, r.getWidth(), r.getHeight(), paint); return null; } @Override public Void onOutline(Outline o) { final Style before = paint.getStyle(); paint.setStyle(Style.STROKE); o.getShape().accept(this); paint.setStyle(before); return null; } @Override public Void onPolygon(final Polygon s) { List<? extends Point> points = s.getPoints(); final float[] pts = { points.get(0).getX(), points.get(0).getY(), points.get(1).getX(), points.get(1).getY(), points.get(1).getX(), points.get(1).getY(), points.get(2).getX(), points.get(2).getY(), points.get(2).getX(), points.get(2).getY(), points.get(3).getX(), points.get(3).getY(), points.get(0).getX(), points.get(0).getY(), }; canvas.drawLines(pts, paint); return null; } }
* A shape visitor for calculating the bounding box, that is, the smallest * rectangle containing the shape. The resulting bounding box is returned as a * rectangle at a specific location. */ public class BoundingBox implements Visitor<Location> { // TODO entirely your job (except onCircle) @Override public Location onCircle(final Circle c) { final int radius = c.getRadius(); return new Location(-radius, -radius, new Rectangle(2 * radius, 2 * radius)); } @Override public Location onFill(final Fill f) { return null; } @Override public Location onGroup(final Group g) { return null; } @Override public Location onLocation(final Location l) { return null; } @Override public Location onRectangle(final Rectangle r) { return null; } @Override public Location onStrokeColor(final StrokeColor c) { return null; } @Override public Location onOutline(final Outline o) { return null; } @Override public Location onPolygon(final Polygon s) { return null; } }
In: Computer Science
I need a couple sentences about Creating and testing JavaScript.
In: Computer Science
Please, how to construct a class template in Python?
Class name is animal:
give it a set of class variables called: gender, status
give it a set of class private variables: __heart, __lungs, __brain_size
construct methods to write and read the private class variables
in addition initiate in the constructor the following instance variables: name, location as well as initiate the variables status and gender all from constructor parameters
The variables meaning is as follows:
name is name
status is wild or domestic
location is location
gender is gender (M/F)
Private variables have all values Yes or NO only __brain_size should be a number
Be sure to provide a check on every variable that requires it.. Yes/No variables can only get values Yes/NO, Numeric variables only number. The rest does not need a check.
Finally provide a method that will print the class state on the output such as
Animal Name: Name
Animal Location: location
etc (print all parameters with the appropriate description)
All variables that you are initializing will depend on the user
In: Computer Science
You are implementing a brand new type of ATM that provides exact amounts of cash (bills only, no coins). In order to maximize potential revenue an algorithm is needed that will allow for using different denomination amounts as needed by the local currency (value of bills will vary, but are integers).
The program shall graphically prompt the user for a file.
The program shall read the selected file of which the first line will be a space separated list of the
bill denomination sizes.
The program shall then read each line in the rest of the file containing an integer and output the
number of different ways to produce that value using the denominations listed in the first line.
The program shall indicate after that the number of milliseconds the program spent calculating
the answer.
The program shall implement 2 different forms of the algorithm: 1 recursive and 1 using dynamic
programming.
The program shall have 2 sets of output, 1 for each implementation.
The program shall write the output to a file in the same directory as the input file.
The program must be written in Java.
In: Computer Science
In C++
ifdef QUESTION2
/*
2. Create a header and implementation for a class
named bottle. bottle objects should be able
to set and get their size in ounces, the type of
liquid it contains(as a string), the amount of
liquid it contains and whether they are less than
another bottle object(based on the amount
of liquid they contain). Do not comment your
code.
*/
std::cout << "QUESTION 2: " << std::endl << std::endl;
std::cout << std::boolalpha;
bottle myBottle;
bottle anotherBottle;
myBottle.setLiquidType("water");
myBottle.setSize(32.0);
myBottle.setFillAmount(20.0);
anotherBottle.setLiquidType(myBottle.getLiquidType());
anotherBottle.setSize(myBottle.getSize());
anotherBottle.setFillAmount(10.0);
std::cout << "myBottle is less than anotherBottle: " << myBottle.isLessThan(anotherBottle) << std::endl;
std::cout << std::endl << std::endl;
#endif
In: Computer Science
Are the existing laws and regulations sufficient to accommodate cloud computing towards the edge or ‘edge cloud’ or ‘edge cloud computing’ if so could you outline and or explain some of them Whatever your answer is please provide evidence as to why there needs to be a change or not maybe links to some articles or references to books where i can read more about it
In: Computer Science
In this case study, your task is to study different search algorithms to solve the N-Queens Problem which has been presented in class. We will focus on the incremental formulation in which we add a queen to any square in the leftmost empty column that is not attacked by any other queen.
Question: Using Depth-first Search (DFS) algorithms, how many steps are needed to find the solution for the 8-Queens Problem? What is it? Draw on an 8x8 table. Show your steps.
In: Computer Science
In: Computer Science