Questions
Describe the ISA memory format?


Describe the ISA memory format?

In: Computer Science

Write a Matlab/SciLab function that accepts inputs as degrees and computes the equivalent within the interval...

Write a Matlab/SciLab function that accepts inputs as degrees and computes the equivalent within the interval 0 to 360.

function de=equivalent(d) For example, equivalent(540) = 180 equivalent(-30) = 330

In: Computer Science

Sovle with python 3.8 please. 1, Write a function called same_without_ends that has two string parameters....

Sovle with python 3.8 please.

1, Write a function called same_without_ends that has two string parameters. It should return True if those strings are equal WITHOUT considering the characters on the ends (the beginning character and the last character). It should return False otherwise. For example, "last" and "bask" would be considered equal without considering the characters on the ends. Don't worry about the case where the strings have fewer than three characters. Your function MUST be called same_without_ends. You can write code in the main part of your program to test your function, but when you submit, your code must ONLY have the function definition!

2, Write a function called replace_es_with_threes that has a single string parameter. It should return a version of the string where all instances of the letter e have been replaced by the digit 3.

Your function MUST still be called replace_es_with_threes. You can write code in the main part of your program to test your function, but when you submit, your code must ONLY have the function definition!

In: Computer Science

Please answer with a fully detailed solution with examples. In Java, write a method to determine...

Please answer with a fully detailed solution with examples.

In Java, write a method to determine if a string contains only digit characters.
In Java, write a method on how to find each occurrence of a letter given a string.
In Java, given a list of numbers, write an algorithm to find all the triples and pairs of numbers in the list that equal exactly 13.
In Java, write a function to find the total number of each character in a given string.

In: Computer Science

What is the correct answer? Kindly explain Support Processor environment is one where: A) A computer...

What is the correct answer? Kindly explain

Support Processor environment is one where:

A) A computer uses network connections to distribute processing tasks to other CPUs on the network

B) A CPU environment where many complex but routine operations are hardwired into it

C) An environment where a single CPU has other single function processors to delegate specific tasks in

Parallel Processing Involves:

A) A computer that is linked to the CPUs of many other computers

B) A computer with many CPUs each processing a different instruction at any point in time

C) A Computer with a CPU that can share time between multiple processor

In: Computer Science

Discuss whether or not each of the following activities is a data mining task. Provide your...

Discuss whether or not each of the following activities is a data mining task. Provide your reasons as well in detail. Fill in your answers in the space provided below.

(a) Dividing the customers of a company according to their gender.


(b) Dividing the customers of a company according to their profitability.

(

c) Computing the total sales of a company.


(d) Sorting a student database based on student identification numbers.


(e) Predicting the outcomes of tossing a (fair) pair of dice.


(f) Predicting the future stock price of a company using historical records.


(g) Monitoring the heart rate of a patient for abnormalities.

(h) Monitoring seismic waves for earthquake activities.

In: Computer Science

How do you split a pandas column with floating numbers on a symbol. For example: COLUMN...

How do you split a pandas column with floating numbers on a symbol. For example:

COLUMN = Location

ROW = 44.567892, -83.783937

Split the numbers into two separate columns based off of the comma. Meaning 44.567892 would be in its own column and -83.783937 would be in its own column. In python

In: Computer Science

Define sockets

Define sockets

In: Computer Science

A limitation of the chat server is that it can handle only one client because it...

A limitation of the chat server is that it can handle only one client because it is a single threaded application. Using the pThread library, modify the chat server so that it can handle multiple clients simultaneously, i.e., by creating a new thread whenever a client is connected so that the client is handled individually with a new thread, and at the same time, by having the main thread (i.e., the thread that runs the main function) of the chat server continue to wait for an incoming connection from a client.

The current implementation of the chat server allows the server to exchange messages with a client individually. Modify the server code so that when the server sends a message, that message is sent to all connected clients. We will test your program with three clients.

Create another thread for the chat server that broadcasts current system time to all connected clients every 5 seconds. For example, all clients should receive a message containing current system time periodically and print it out.

Server.c

#include <stdio.h>

#include <netdb.h>

#include <netinet/in.h>

#include <stdlib.h>

#include <string.h>

#include <sys/socket.h>

#include <sys/types.h>

#define MAX 80

#define PORT 8080

#define SA struct sockaddr

#define MAX 80

#define PORT 8080

#define SA struct sockaddr

  

// Function designed for chat between client and server.

void func(int sockfd)

{

    char buff[MAX];

    int n;

    // infinite loop for chat

    for (;;) {

        bzero(buff, MAX);

  

        // read the message from client and copy it in buffer

        read(sockfd, buff, sizeof(buff));

        // print buffer which contains the client contents

        printf("From client: %s\t To client : ", buff);

        bzero(buff, MAX);

        n = 0;

        // copy server message in the buffer

        while ((buff[n++] = getchar()) != '\n')

            ;

  

        // and send that buffer to client

        write(sockfd, buff, sizeof(buff));

  

        // if msg contains "Exit" then server exit and chat ended.

        if (strncmp("exit", buff, 4) == 0) {

            printf("Server Exit...\n");

            break;

        }

    }

}

  

// Driver function

int main()

{

    int sockfd, connfd, len;

    struct sockaddr_in servaddr, cli;

  

    // socket create and verification

    sockfd = socket(AF_INET, SOCK_STREAM, 0);

    if (sockfd == -1) {

        printf("socket creation failed...\n");

        exit(0);

    }

    else

        printf("Socket successfully created..\n");

    bzero(&servaddr, sizeof(servaddr));

  

    // assign IP, PORT

    servaddr.sin_family = AF_INET;

    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);

    servaddr.sin_port = htons(PORT);

  

    // Binding newly created socket to given IP and verification

    if ((bind(sockfd, (SA*)&servaddr, sizeof(servaddr))) != 0) {

        printf("socket bind failed...\n");

        exit(0);

    }

    else

        printf("Socket successfully binded..\n");

  

    // Now server is ready to listen and verification

    if ((listen(sockfd, 5)) != 0) {

        printf("Listen failed...\n");

        exit(0);

    }

    else

        printf("Server listening..\n");

    len = sizeof(cli);

  

    // Accept the data packet from client and verification

    connfd = accept(sockfd, (SA*)&cli, &len);

    if (connfd < 0) {

        printf("server acccept failed...\n");

        exit(0);

    }

    else

        printf("server acccept the client...\n");

  

    // Function for chatting between client and server

    func(connfd);

  

    // After chatting close the socket

    close(sockfd);

}

Client.c

#include <netdb.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <sys/socket.h>

#define MAX 80

#define PORT 8080

#define SA struct sockaddr

void func(int sockfd)

{

    char buff[MAX];

    int n;

    for (;;) {

        bzero(buff, sizeof(buff));

        printf("Enter the string : ");

        n = 0;

        while ((buff[n++] = getchar()) != '\n')

            ;

        write(sockfd, buff, sizeof(buff));

        bzero(buff, sizeof(buff));

        read(sockfd, buff, sizeof(buff));

        printf("From Server : %s", buff);

        if ((strncmp(buff, "exit", 4)) == 0) {

            printf("Client Exit...\n");

            break;

        }

    }

}

  

int main()

{

    int sockfd, connfd;

    struct sockaddr_in servaddr, cli;

  

    // socket create and varification

    sockfd = socket(AF_INET, SOCK_STREAM, 0);

    if (sockfd == -1) {

        printf("socket creation failed...\n");

        exit(0);

    }

    else

        printf("Socket successfully created..\n");

    bzero(&servaddr, sizeof(servaddr));

  

    // assign IP, PORT

    servaddr.sin_family = AF_INET;

    servaddr.sin_addr.s_addr = inet_addr("127.0.0.1");

    servaddr.sin_port = htons(PORT);

  

    // connect the client socket to server socket

    if (connect(sockfd, (SA*)&servaddr, sizeof(servaddr)) != 0) {

        printf("connection with the server failed...\n");

        exit(0);

    }

    else

        printf("connected to the server..\n");

  

    // function for chat

    func(sockfd);

  

    // close the socket

    close(sockfd);

}

In: Computer Science

How does Emotet establish connection to the C&C infrastructure?

How does Emotet establish connection to the C&C infrastructure?

In: Computer Science

You would like to build a classifier for an Autism early detection application. Each data point...

You would like to build a classifier for an Autism early detection application. Each data point in the dataset represents a patient. Each patient is described by a set of attributes such as age, sex, ethnicity, communication and development figures, etc. You know from domain knowledge that autism is more prevalent in males than females.

If the dataset you are using to build the classifier is noisy, contains redundant attributes and missing values. If you are considering a decision tree classifier and a k-nearest neighbor classifier, explain how each of these can handle the three mentioned problems:

1. Noise

2. Missing Values

3. Redundant Attributes

In: Computer Science

• Write a complete prolog with your own facts using the relation: – Like(Person,Food). • Define...

• Write a complete prolog with your own facts using the relation: – Like(Person,Food).

• Define the following rule: –

Two persons are friends if they like the same food.

• Now find:

– All people who like more than one food.

– All food liked by two people – All friends

• likes(sarah, pizza).

• likes(sarah, saleeg)

. • likes(sarah, bread)

. • likes(farah, rice).

• likes(rana, burger)

. • likes(rana, saleeg).

In: Computer Science

I've seen this question answered for C but I don't know how to translate to Java....

I've seen this question answered for C but I don't know how to translate to Java.

Write a program that requests the hours worked in a week and the basic pay rate, and then prints the gross pay (before tax), the taxes, and the net pay (after tax).

Assume the following:

  1. Basic pay rate: from user's choice
  2. Overtime (in excess of 40 hours) = time and a half (i.e., if the hours worked is 45, the hours for pay will be 47.5, which is 40 + 5 * 1.5).
  3. Tax rate:
    • 15% of the first $300;
    • 20% of the next $150;
    • 25% of the rest.
_____________________________
import java.util.Scanner;

public class Pay {

        public static void main(String[] args) {
                //Constants
                final int NORMAL_WORK_HOURS = 40;
                final double OVERWORKED_TIMES = 1.5;
                final double TAX_RATE_1 = 0.15;
                final double TAX_RATE_2 = 0.20;
                final double TAX_RATE_3 = 0.25;         
                final double TAX_BREAK_1 =      300;
                final double TAX_BREAK_2 =      450;
                
                //Declare variables
                Scanner sc = new Scanner(System.in);
                int userChoice = 0;
                double payRate = 0;
                double hoursWorked = 0;//The actual hours worked
                double hoursPay = 0; //The times for pay, i.e., one and a half for each hour overworked
                double grossPay = 0;
                double netPay = 0;
                double tax = 0;
                                
                //Display the choices of basic tax rate
                //Accept user's choice of pay rate and set up the basic pay rate
                //Ask user for the hours worked
                //Calculate the hours for pay: 
                //If the hours worked is less than or equals to 40, same as is
                //if it's greater than 40, hoursPay = 40 + (hoursWorked - 40) * 1.5
                //Calculate the gross pay
                //Calculate the tax
                //Calculate the net pay
                //Display the result
        }

}

In: Computer Science

.What is the role of interrupt vector table during interrupt processing? b. How does OS make...

.What is the role of interrupt vector table during interrupt processing?

b. How does OS make sure that a user process cannot access I/O devices or any other process’ memory areas?

c. How is data parallelism different from task parallelism? Which one of these approaches would you use if you had to compute the average of an array of million numbers? Why?

d. What kind of events can cause a process to leave CPU?

e. What is the main different between heap and stack segments of a process?

In: Computer Science

Apteryx, based in Queen Street, have approached you to gain some insight into their planned development...

Apteryx, based in Queen Street, have approached you to gain some insight into their planned development of the company’s IT setup. The management wish to expand the company and as such they want to be able to connect the new satellite offices to their main office in Queen Street. The two new satellite offices will be in Otara and on Waiheke Island. But it turns out that the management knows nothing about the technology involved in connecting the new satellite office to the main office. Your task is to develop a report which will educate the management on the basics of networking.

The following must be included in your report;

a) the conceptual concepts e.g. topologies and layered models

b) using the concept of OSI and TCP/IP models compare the process a human would send a message against how a computer would do the same.

c) type of equipment they will need to purchase to achieve their goals, provide a discussion on the types of equipment.

d) the complexity involved in providing a complete solution.

In: Computer Science