Questions
What properties would make a buffer overflow condition in a program exploitable or useful to an...

What properties would make a buffer overflow condition in a program exploitable or useful to an attacker?

In: Computer Science

PYTHON def find_treasure(mapfile): with open (mapfile, 'r') as f: data = f.readlines() for i, row in...

PYTHON

def find_treasure(mapfile):
with open (mapfile, 'r') as f:
data = f.readlines()
for i, row in enumerate(data):
for j, column in enumerate(row):
if 'S' in column:

print((i,j))
return (i,j)
#This is what mapfile contains   
#AAASAAA
#AASSSAA
#AAASAAA
#Need to find the coordinate of the middle S

In: Computer Science

Develop a function to read a document in the MongoDB database “city” in the collection “inspections.”...

Develop a function to read a document in the MongoDB database “city” in the collection “inspections.” Be sure it can handle error conditions gracefully.
a. Input -> arguments to function should be the key/value lookup pair to use with the MongoDB driver find API call
b. return -> result in JSON format if successful else MongoDB returned error message

In: Computer Science

(1) Discuss the rules involving actual parameter lists, including matching data types and a one-to-one correspondence...

(1) Discuss the rules involving actual parameter lists, including matching data types and a one-to-one correspondence with the formal parameter list. Note that the parameter list can be empty, but the function call will still require parentheses after the function name.

(2) Discuss scope rules with respect to global and local identifiers, nested blocks, and functions.

(3) Discuss how local declarations are stored in computer memory. Are there any reasons to avoid using local declarations if it is possible to achieve the same result without them?

In: Computer Science

Define a class to represent a Temperature. Your class should contain Instance variable int fahrenheit A...

Define a class to represent a Temperature. Your class should contain

  • Instance variable int fahrenheit
  • A parameterized constructor;
  • Member method to calculate the equivalent temperature in Celsius unit toCelsius() with decimal value.
    • double toCelsius()
    • Conversion formula: celsius= (fahrenheit - 32) * 5/9
  • Method definition to override the equals() method
    • boolean equals(Object obj)

In: Computer Science

QUESTION 38 The ITEM table contains these columns: COST NUBMER(7,2) RETAIL NUMBER(7,2) The RETAIL and COST...

QUESTION 38

  1. The ITEM table contains these columns:
    COST NUBMER(7,2)
    RETAIL NUMBER(7,2)
    The RETAIL and COST columns must have a value that is greater than zero.
    Evaluate these two SQL Statements:
    1. SELECT retail – cost * 1.25 * .10
    FROM item;
    2. SELECT (retail – (cost *1.25 )*.10)
    FROM item;
    What will be the results?

    Statement 1 will return a low value than statement 2.

    Statement 1 and statement 2 will return the same values.

    Statement 1 will return a higher value than statement 2.

    Only one of the statements will execute.

2.5 points   

QUESTION 39

  1. Using a second SELECT query in the same overall query is a

    subquery

    join query

    cross join

    aggregate function

2.5 points   

QUESTION 40

  1. select SAL from EMP where SAL between 1000 and 10000; results in (table rows are 1 to 10099)

    rows 1001 to 9999 returned

    rows 1 to 10001 returned

    rows 1001 to 10000 returned

    rows 1000 to 10000 returned

In: Computer Science

Create a console app c#. Using a List, ask the user to enter all of their...

Create a console app c#. Using a List, ask the user to enter all of their favorite things. Once they

are done, randomly pick a value from the list and display it.

In: Computer Science

QUESTION 26 For more efficient SQL, replace a series of OR clauses with IN AND NULL...

QUESTION 26

  1. For more efficient SQL, replace a series of OR clauses with

    IN

    AND

    NULL

    DISTINCT

2.5 points   

QUESTION 27

  1. SELECT ADD_MONTHS('01-FEB_2016', 3) from dual; results in

    04-FEB-2016

    01-MAY-2016

    31-MAY-2016

    04-MAY-2016

2.5 points   

QUESTION 28

  1. joining a table to itself is refered to as

    an equijoin

    a self join

    an outer join

    a non equi-join

2.5 points   

QUESTION 29

  1. SELECT MIN(NAME) from Customer; will return which of the following rows

    ALICE

    WILLIAM

    BLAKE

    JAMAL

2.5 points   

QUESTION 30

  1. To obtain all the rows from two tables regardless of matches which join should be used

    RIGHT OUTER

    LEFT OUTER

    EQUIJOIN

    FULL OUTER

2.5 points   

QUESTION 31

  1. To sort data returned from a SQL statement, which clause should be used

    ORDER BY

    WHERE

    GROUP BY

    HAVING

Its a multiple question answer.I donot have any more database

In: Computer Science

Hacktivism is the use of hacking to promote a political cause. Is there an ethical justification...

Hacktivism is the use of hacking to promote a political cause. Is there an ethical justification for such hacking?

Should penalties for 'hacktivists' differ from penalties for other hackers?

In: Computer Science

Seminar on Oct 5: Operating Systems 1. List one or more A. Stand-alone operating system B....

Seminar on Oct 5: Operating Systems

1. List one or more

A. Stand-alone operating system

B. Network operating system

C. Embedded operating system

D. Possible applications of embedded system

E. Open-source operating system

F. Single-tasking operating system

G. Operating system based on Unix/Linux

H. Multitasking operating system

I. Multithreading operating system

J. Mobile-device operating system

2. What is:

(a) boot sector

(b) bootstrap loader

(c) partition

In: Computer Science

What are the additional elements required of a network architecture if the enclave is to support...

What are the additional elements required of a network architecture if the enclave is to support remote access through the public Internet?

True or false: A thin client is a PC or laptop without a hard drive or storage space.

What are the five elements of a Remote Access Security Readiness Review

In: Computer Science

Program 5A: Determine which student has the highest grade Write a Java program that determines which...

Program 5A: Determine which student has the highest grade Write a Java program that determines which student has the highest grade. You will ask the user to enter the number of students. Then you will ask for each student and their grade. You will output the name and grade of the student with the highest grade. You will NOT use an array for this assignment.

Call your class Program5A, so your filename will be Program5A.java. It is essential for grading purposes that everyone have the same class name. 2. Create several lines of comments of identification and description at the top of the file (it doesn’t have to look exactly like this, in particular, if your editor wants to put * in front of every line, that’s fine):

Use comments liberally to document exactly what you are doing in the program. 4. Use descriptive variable names in camel-case with the first letter in lowercase. 5. Ask the user for the number of students and assign that to a variable of type int called numStudents using the nextInt method of Scanner.

At this point, try to compile and run your program. Don’t move on until this part is working. It would be good to enter a temporary print statement just to make sure this is working: System.out.printf("numStudents = %d\n", numStudents); It should be commented out before turning in the program (put // in front of it) or delete the line.

We need variables for highestName and highestScore of types String and int, respectively. Set highestName to the empty string and highestScore to 0.

Create a for loop. (Do NOT put a semi-colon after the for statement. Put an open curly brace instead, and go ahead and put the closing brace if your IDE doesn’t do it automatically, then put all the statement to be repeated BETWEEN the curly braces):

for (int i = 0; i < numStudents; i++) { a. As the first statement in the loop, add an extra line that reads to the end of the line: input.nextLine(); This is needed after a nextInt if you are going to then read a String. This basically burns the rest of the line (it ignores everything else to and including the end of the line which in this case will just be an end-of-line character '\n'), even though there is nothing there that you can see. You will need to do this any time that you have read in an int as you did for the number of students. (You could have done it right after you read the number of students, but then you would have to do it again in the loop right after reading the score. Doing it here takes care of both with one line of code.) b. Ask the user for name and score, which will be String and int types, respectively, which will require nextLine and nextInt. c. Compare score to highestScore. If score is greater than highestScore, then assign highestScore equal to score and highestName equal to name. There will not be an else. (If they are equal, we are NOT going to change the highest score so that in the event of a tie, the first one wins. However, in real life we would deal with ties in a better manner.) d. This is the end of the for loop, so put the closing brace if it’s not already there.

Outside of the for loop, print highestName and highestScore

ample Runs: (Enter this data exactly and make screen-prints to paste into a Word document that you will turn in to prove that your program works correctly. On the last one, just hit the Enter key without entering anything; it should sit there still waiting for integer input; if you then enter an integer, everything is fine and works like normal.):

Please enter number of students:4

Enter student name:Gus

Enter score:70

Enter student name:Suzy

Enter score:80

Enter student name:Allie

Enter score:100

Enter student name:Robert

Enter score:90

Highest score: Allie 100

Process finished with exit code 0

In: Computer Science

Given an int b, set the variable answer to equal "negative" if b is less than...

Given an int b, set the variable answer to equal "negative" if b is less than 0; set answer to "positive" if b is greater than 0; and set it to "zero" if b equals zero

in python

In: Computer Science

1.What are the two fundamental models of inter-process communication?  What are the two system calls used with...

1.What are the two fundamental models of inter-process communication?  What are the two system calls used with message-passing systems?

2.How do processes communicate? What are blocking and non-blocking communication primitives?

3.Explain Remote Procedure Calls with the help of diagram.

4.Are function callback and inter-process communication same?

In: Computer Science

JAVA /**    * posOfLargestElementLtOeT returns the position of the largest element in the    *...

JAVA

/**
   * posOfLargestElementLtOeT returns the position of the largest element in the
   * array that is less than or equal to the limit parameter if all values are
   * greater than limit, return -1;
   *
   * Precondition: the array is nonempty and all elements are unique. Your
   * solution must go through the array exactly once.
   *
   * <pre>
   * 0 == posOfLargestElementLtOeT(3, new double[] { -7 }) // value:-7 is in pos 0
   * 5 == posOfLargestElementLtOeT(3, new double[] { 11, -4, -7, 7, 8, 1 }), // value:1 is in pos 5
   * -1 == posOfLargestElementLtOeT(-7, new double[] { 1, -4, -5, 7, 8, 11 }), // all elements are > -7
   *
   * The code below is a stub version, you should replace the line of code
   * labeled TODO with code that achieves the above specification
   * </pre>
   */
   public static int posOfLargestElementLtOeT(double limit, double[] list) {
       return -2; // TODO 2: fix this code
   }

In: Computer Science