IMG_7072
.png
keyboard_arrow_up
School
Macomb Community College *
*We aren’t endorsed by this school
Course
1710
Subject
Computer Science
Date
Jul 2, 2024
Type
png
Pages
1
Uploaded by AgentTeamGiraffe39
162 Chapter 8: Specifying Instructions to the Shell 0 10 MINUTES Lab Exercise 8.06: Gathering Error Numbers With redirection error, LaTrina can now implement all of the error checks, and check her own log file for messages. This will allow her to customize the program to trap every error the user generates. In time, her regist.exe will be crash-proof. She asks you how she can get the error codes for common UNIX errors. She knows what errors she is getting, but without the error codes she cannot program for the errors. You tell her about the $? variable, which holds the error code for the previous error. Learning Objectives In this lab, you will record error numbers for common commands. By the end of this lab, you'll be able to: e Determine the error code for any UNIX error Lab Materials and Setup The materials you need for this lab are: e Computer with Red Hat Linux 7.3 installed ® Pencil and paper Getting Down to Business The following table has several commands. Run the command and get the error number using the $? variable. Record the error number in the space provided. Recall that you will need to echo this variable to get the contents. You will have to apply the knowledge that you acquired in the Introduction to UNIX and Linux textbook by John Muster (McGraw-Hill/Osborne, 2002) for echoing variable contents. ¥ Warning Do not log in as root to run this exercise!
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
I need to create a Transposition Cipher in Java that runs in Eclipse. The programs need to ask the user to encrypt or decrypt, read/accept a user's text file(.TXT) (NOT PLAIN TEXT), and save it as a new text file (.TXT). Please include as many comments as possible that help explains each line of code.
arrow_forward
Write a python program that scans in a large number of tweets from a file, and prints the top 5 hashtags.
Approach
Parse each word in the file
Find a way to isolate the hashtags from the rest of the tweet
Compute the frequency of each unique hashtag.
Find the top 5 hashtags.
Caveats
1. Because this is public dataset, there are many tweets that use special characters that may cause issues during reading in your file. To avoid this, explicitly specify the encoding mode in open when reading in the file.
with open('twitter_data.txt', 'r', encoding='utf8') as f:
2. When parsing hashtags be sure to change everything to lowercase. There are cases in the file where two hashtags are the same but differ in case.
3. There is no standard way of sorting a dictionary based on the values. Python gives you access to a sorted function where you can pass in a collection and also specify a comparator which outlines how you want to sort the values. This can be done with a one line lambda function.
arrow_forward
Please explain in C++ thank you
arrow_forward
I need a help with my python activity. This requires 2 clients and 1 server. This is a system to support an online math contest.
Rule:
There are two participants answering at the same time.
The host is responsible in starting up the server, after that they wait for the clients. When the two clients are connected, they must send the message: READY to the server. When the server receives the two READY from the clients, the contest starts.
The server will display 3 questions one after another which can be answered in 30 secs each.
11+10 = 21
10+22 = 32
10+10 = 20
The participant with most correct answers wins.
At the end of the program, the server must show the results.
ex: Client1 WINS! 2/3
Client2: 1/3
arrow_forward
2
Please help me, I am using Java and it has to be AES As part of this project, you need to consider the following steps in your implementation: 1. With an AES encryption algorithm 2. Sender: Given a document X, write a program that can encrypt X with a passsword. Let’s say the password-protected document is Y 3. Receiver: Given Y, write a program that can ask the user to enter a password and perform decryption process to extract the original document X 4. During your implementation, you can also consider how to incorporate the following case: how a given document can be securely shared with several users. For example, if X is a document, then your platform can support multiple (authorized) users to securely access X.
arrow_forward
Write a Java application for a server that listens to a client. The server should run on port 8250. Once the server is running it should output “Server is starting….”, then it should wait to receive a message from the client. Once it receives the message, it should close the socket. Create a client that sends a message to the server through port 8250. The message that should be sent to the server should be the sum of two numbers. Once it sends the message, it should close the socket. Figure 2 shows messages from the server:
arrow_forward
A parking house has place for 107 cars. There are many turnstiles letting cars in and out. As cars come in a shared counter is incremented. As cars leave the house, the shared counter is decremented.
Implement the shared counter as a monitor in Java. See to it that if there are 107 cars in the house, processes trying to increment the counter get delayed until some car leaves the house (this will cause the turnstile to be kept closed without letting the car in, but you do not have to worry about this, you are not implementing the turnstile processes!)
arrow_forward
Encrypt
Caesar cipher is a kind of substitution cipher. Instead of using a substitution table, the alphabets are rotated by a number (a key). For example, if the key is 3, plaintext alphabet a would become d, and plaintext alphabet z would become c.
Write a program that implements the Caesar Cipher. You program will first prompt for the key and then for the mode (E for encryption and D for decryption) and finally for the message to be encrypted / decrypted. Your program will then output the encryption / decryption message.
For this question, the input message may consists of any character, the program should encrypt or small letter case a to z only. All other characters should be kept intact after encryption or decryption.
arrow_forward
Write a Java application for a server that listens to a client. The server should run on port 8250. Once the server is running it should output “Server is starting….”, then it should wait to receive a message from the client. Once it receives the message, it should close the socket. Create a client that sends a message to the server through port 8250. The message that should be sent tothe server should be the sum of two numbers. Once it sends the message, it should close the socket.
output:
run:
Server is starting...
Message received from client: 4+3=7
arrow_forward
I have the following details on my JSON file, and I want my JAVA code to keep it even after restarting the server. Please let me know how I can prevent my program from overwriting the contents of my JSON code.
[ "User"
{"First name": "Juan" , "Middle name": :Dela", "Last name" : "Cruz", "Username" : ""Juan123", "Password" : "1234"}
]
arrow_forward
Stuck on this assignmentMake sure for it to run on gcc & ./
On C - Linux [Note, does not work on C99]Make sure to follow the assignment [add breaks] and include all others.Code it as welcoming the user first, make a discription that follows the example, and the number of degrees for the increment.Does the code need doubles? make the sure title Trigonometric table is centered! and follow the example "30" to display the exact chart.
arrow_forward
Write the suitable java program to implement
the scenario given below.
Create an a java program name "Server.java"
• Use the predefined Socket and ServerSocket class to make the
connection using port number
• Use Input and output stream classes for
passing the messages and receiving the
messages
• Add the value of same number given by the client
•After performing all operation close all the operation
-----
Create an a java program name "Client.java"
• Use the predefined Socket class to make
the connection using port number
• Use Input and output stream classes for
passing the messages and receiving the
messages
• After performing all operation close all the operation
Sample Output;
Server Side:
Server Started and listening to the port
22215
(Waiting for client, Now run the client)
Client Side:
Message sent to the server: www.nct.edu.om
Server Side:
Message received from client: www.nct.edu.om
Message sent to the client: 5.37.70.7
Client Side:
Message received from the server:…
arrow_forward
This is the follow up question from the previous follow up question.
The code has to work in QtSpim. My professor wants the class to use the QtSpim. From the updated code, I am still getting error that says "Memory address out of bounds" and negative output. Can you help me fix this. Thanks.
.datanewline: .asciiz "\n" .globl main .textmain: # compute the next state of the LFSR for each input state li $a0, 0x00000001 jal lfsr_next_state move $t0, $v0 li $a0, 0xdeadbeef jal lfsr_next_state move $t1, $v0 li $a0, 0x200214c8 jal lfsr_next_state move $t2, $v0 li $a0, 0x00000000 jal lfsr_next_state move $t3, $v0
# print the output states li $v0, 1 # set system call for printing integer move $a0, $t0 syscall la $a0, newline li $v0, 4 # set system call for printing string syscall move $a0, $t1 syscall la $a0, newline syscall move $a0, $t2 syscall la $a0, newline syscall move $a0, $t3 syscall…
arrow_forward
Alice used a password to create a zip file secret.zip which contains only a secret.txt file. The secret.txt file contains really important information that Alice would like to access. Unfortunately, Alice forgot the password she used to create the zip file. Alice only remembers that the password is a six-digit password.Given the secret.zip file, you are asked to help Alice to recover the password with an implementation in Python.
arrow_forward
Take a look at the 'iris' dataset that comes with R. The data can be loaded with the code:
1 library(datasets)
2 data(iris)
A description of the dataset can be found by running
1 ?iris
There will be an object called 'iris' in your workspace. In this dataset, what is the mean of 'Sepal.Length' for the species
virginica? Please round your answer to the nearest whole number.
(Only enter the numeric result and nothing else.)
Enter answer here
arrow_forward
Answer the given question with a proper explanation and step-by-step solution.
I need help with this homework for a step-by-step Java Programming, I also attached the picture of "Listing 21.9" which is mentioned in the question, Thanks
arrow_forward
I don't know what to do. I keep gettnig errors. I can't seem to get these two files to work correctly. Every time I think I fix an error, more errors pop up.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from int to String
The field RescueAnimal.name is not visible
The field RescueAnimal.gender is not visible
The field RescueAnimal.age is not visible
The field RescueAnimal.weight is not visible
The field RescueAnimal.acquisitionDate is not visible
The field RescueAnimal.acquisitionCountry is not visible
The field RescueAnimal.trainingStatus is not visible
The field RescueAnimal.reserved is not visible
The field RescueAnimal.inServiceCountry is not visible
at grazioso.Monkey.<init>(Monkey.java:40)
at grazioso.Driver.initializeMonkeyList(Driver.java:90)
at grazioso.Driver.main(Driver.java:26)
arrow_forward
you need to add a method for finding the list of passed modules
and one method for total mark
JAVA
arrow_forward
A Caesar cipher is a simple substitution cipher based on the idea of shifting
each letter of the plaintext message a fixed number (called the key) of
positions in the alphabet. For example, if the key value is 2, the word
"Sourpuss" would be encoded as "Uqwtrwuu." The original message can
be recovered by “reencoding" it using the negative of the key.
Write a program that can encode and decode Caesar ciphers. The in-
put to the program will be a string of plaintext and the value of the key.
The output will be an encoded message where each character in the orig-
inal message is replaced by shifting it key characters in the Unicode char-
acter set. For example, if ch is a character in the string and key is the
amount to shift, then the character that replaces ch can be calculated as:
chr (ord (ch) + key).
62
arrow_forward
Nobody has understood the question thus far.
Please read. It's Java.
Write a client program and server program. The server uses a socket connection to allow a client to supply a filename and the server will send the file contents to the client or an error message if the file does not exist. The client will create a new file with the same contents. The client will supply the filename "input.txt" to the server and create as it's output "output.txt". Don't ask the user for these names. The Server sends whatever file the Client requests. Don't put "input.txt" in the Server. The client must get the contents from the Server. It must not read input.txt directly.
Do not accept arguments from the command line.
One class named Server and one named Client. These must be the ONLY 2 CLASSES
arrow_forward
In Java Please
arrow_forward
I need help
Print the file on the BlueJ console Java
Filename: input.txt
Number of lines: 5
Longest Line: 10
Total number of characters: 33
Asterisk character found at 3,2
xxxxxxxxx
xxxxxxx
xxx*xxxxxx
xx
xxxxx
Work done so far (my code)
// we need to import this library for classes to read and write filesimport java.io.*;import java.util.Scanner;import java.io.FileReader;
/*** Write a description of class FileStats here.** @author (Tanishq Verma)*/public class FileStats{
/*** Constructor for objects of class FileStats*/public FileStats(){
}
public static void main(String args[]) {
// Assignment 5 Part A // print out a message to help show where we are at in the consoleSystem.out.println("\n\nFileStats program running!!");// create a scanner object to read from the keyboardScanner keyboard = new Scanner(System.in);
// Get the filename from user inputSystem.out.print("Enter the filename: ");String filename = keyboard.nextLine();
// Create a new File objectFile file = new…
arrow_forward
Counting and Looping
The program in LoveCS.java prints "I love Computer Science!!" 10 times. Copy it to your directory and compile and run it to
see how it works. Then modify it as follows:
//
LoveCS.java
//
//
//
//
//
Use a while loop to print many messages declaring your
passion for computer science
****************************
public class LoveCS
{
public static void main (String [] args)
{
final int LIMIT = 10;
int count = 1;
while (count <= LIMIT){
System.out.println("I love Computer Science!!");
count++;
}
}
}
Instead of using constant LIMIT, ask the user how many times the message should be printed. You will need to declare a
variable to store the user's response and use that variable to control the loop. (Remember that all caps is used only for
constants!)
Number each line in the output, and add a message at the end of the loop that says how many times the message was
printed. So if the user enters 3, your program should print this:
1.
2.
1 I love Computer Science!!
2 I love…
arrow_forward
How does this method cause memory leaks? How do I make it multi-thread safe?
I have this JUnit test method that checks if my method is working. What it does is to.
Inherit @Before and @After methods from BaseTest
Since for every class, a session is created before, use it for ServiceTest.testUpdate() when we have to use session.save.
-----------------------------------------------------------------------------------------------------------------------
public class BaseTest{ @Autowired protected SessionFactory sessionFactory; protected Session session; @Before public void createSession() { session = sessionFactory.openSession(); } @After public void closeSession(){ if (session != null) { session.flush(); session.close(); } } }
public class ServiceTest extends BaseTest{ @Autowired private FoodService foodService; @Test public void testUpdate() { Food food= new Food("Japanese", "Ramen"); session.save(student); int id = (int) session.getIdentifier(student); session.flush();…
arrow_forward
May I get help with this in bash shell.
arrow_forward
using netbean software
arrow_forward
Text Encryption
Encryption plays an important role in protecting messages that are transmitted across the network. There are many symmetric and asymmetric encryption techniques that can be used in order to encrypt text messages. Some of these techniques are Caesar, Rows-Columns Transposition, Rail- fence, and Playfair cipher encryption as well as advance encryption algorithms.
In this project, you are required to write a code that is capable of encrypting any given text (or text file) into a cipher text using any two different methods. You should prompt the user to choose the method that they would like to encrypt their text from a given list.
Challenge: develop your code to decrypt the cipher text that is encrypted above
Example:
Assume the text TO SERVE AND TO PROTECT is required to be encrypted using Row-Column with the password ALERT
Then the text message in Rows-Columns Transposition will become:
TVTTSAPCOEOEENRTRDOX. The same text message in Rail-fence with depth of 4 would…
arrow_forward
in python. Please include docstring, so I can understand each step to this program. Thanks.
you will import the json module.
Write a class named NeighborhoodPets that has methods for adding a pet, deleting a pet, searching for the owner of a pet, saving data to a JSON file, loading data from a JSON file, and getting a set of all pet species. It will only be loading JSON files that it has previously created, so the internal organization of the data is up to you.
The init method takes no parameters and initializes all the data members, which must all be private.
The add_pet method takes as parameters the name of the pet, the species of the pet, and the name of the pet's owner. If a pet has the same name as a pet that has already been added, then the function should raise a DuplicateNameError (you'll need to define this exception class).
The delete_pet method takes as a parameter the name of the pet and deletes that pet.
The get_owner method takes as a parameter the name of the pet and…
arrow_forward
Consider the following scenario: you have software that enables you to participate in a surgical operation on a patient in another city from the comfort of your own home computer. Who would be interested in continuing the program once it has been finished. And what type of harm do they want to inflict? Is it conceivable that they will seek to take advantage of your vulnerabilities in order to do you harm? Is it possible that such vulnerabilities might inflict harm even if there is no active, hostile opponent attempting to exploit the situation?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- I need to create a Transposition Cipher in Java that runs in Eclipse. The programs need to ask the user to encrypt or decrypt, read/accept a user's text file(.TXT) (NOT PLAIN TEXT), and save it as a new text file (.TXT). Please include as many comments as possible that help explains each line of code.arrow_forwardWrite a python program that scans in a large number of tweets from a file, and prints the top 5 hashtags. Approach Parse each word in the file Find a way to isolate the hashtags from the rest of the tweet Compute the frequency of each unique hashtag. Find the top 5 hashtags. Caveats 1. Because this is public dataset, there are many tweets that use special characters that may cause issues during reading in your file. To avoid this, explicitly specify the encoding mode in open when reading in the file. with open('twitter_data.txt', 'r', encoding='utf8') as f: 2. When parsing hashtags be sure to change everything to lowercase. There are cases in the file where two hashtags are the same but differ in case. 3. There is no standard way of sorting a dictionary based on the values. Python gives you access to a sorted function where you can pass in a collection and also specify a comparator which outlines how you want to sort the values. This can be done with a one line lambda function.arrow_forwardPlease explain in C++ thank youarrow_forward
- I need a help with my python activity. This requires 2 clients and 1 server. This is a system to support an online math contest. Rule: There are two participants answering at the same time. The host is responsible in starting up the server, after that they wait for the clients. When the two clients are connected, they must send the message: READY to the server. When the server receives the two READY from the clients, the contest starts. The server will display 3 questions one after another which can be answered in 30 secs each. 11+10 = 21 10+22 = 32 10+10 = 20 The participant with most correct answers wins. At the end of the program, the server must show the results. ex: Client1 WINS! 2/3 Client2: 1/3arrow_forward2 Please help me, I am using Java and it has to be AES As part of this project, you need to consider the following steps in your implementation: 1. With an AES encryption algorithm 2. Sender: Given a document X, write a program that can encrypt X with a passsword. Let’s say the password-protected document is Y 3. Receiver: Given Y, write a program that can ask the user to enter a password and perform decryption process to extract the original document X 4. During your implementation, you can also consider how to incorporate the following case: how a given document can be securely shared with several users. For example, if X is a document, then your platform can support multiple (authorized) users to securely access X.arrow_forwardWrite a Java application for a server that listens to a client. The server should run on port 8250. Once the server is running it should output “Server is starting….”, then it should wait to receive a message from the client. Once it receives the message, it should close the socket. Create a client that sends a message to the server through port 8250. The message that should be sent to the server should be the sum of two numbers. Once it sends the message, it should close the socket. Figure 2 shows messages from the server:arrow_forward
- A parking house has place for 107 cars. There are many turnstiles letting cars in and out. As cars come in a shared counter is incremented. As cars leave the house, the shared counter is decremented. Implement the shared counter as a monitor in Java. See to it that if there are 107 cars in the house, processes trying to increment the counter get delayed until some car leaves the house (this will cause the turnstile to be kept closed without letting the car in, but you do not have to worry about this, you are not implementing the turnstile processes!)arrow_forwardEncrypt Caesar cipher is a kind of substitution cipher. Instead of using a substitution table, the alphabets are rotated by a number (a key). For example, if the key is 3, plaintext alphabet a would become d, and plaintext alphabet z would become c. Write a program that implements the Caesar Cipher. You program will first prompt for the key and then for the mode (E for encryption and D for decryption) and finally for the message to be encrypted / decrypted. Your program will then output the encryption / decryption message. For this question, the input message may consists of any character, the program should encrypt or small letter case a to z only. All other characters should be kept intact after encryption or decryption.arrow_forwardWrite a Java application for a server that listens to a client. The server should run on port 8250. Once the server is running it should output “Server is starting….”, then it should wait to receive a message from the client. Once it receives the message, it should close the socket. Create a client that sends a message to the server through port 8250. The message that should be sent tothe server should be the sum of two numbers. Once it sends the message, it should close the socket. output: run: Server is starting... Message received from client: 4+3=7arrow_forward
- I have the following details on my JSON file, and I want my JAVA code to keep it even after restarting the server. Please let me know how I can prevent my program from overwriting the contents of my JSON code. [ "User" {"First name": "Juan" , "Middle name": :Dela", "Last name" : "Cruz", "Username" : ""Juan123", "Password" : "1234"} ]arrow_forwardStuck on this assignmentMake sure for it to run on gcc & ./ On C - Linux [Note, does not work on C99]Make sure to follow the assignment [add breaks] and include all others.Code it as welcoming the user first, make a discription that follows the example, and the number of degrees for the increment.Does the code need doubles? make the sure title Trigonometric table is centered! and follow the example "30" to display the exact chart.arrow_forwardWrite the suitable java program to implement the scenario given below. Create an a java program name "Server.java" • Use the predefined Socket and ServerSocket class to make the connection using port number • Use Input and output stream classes for passing the messages and receiving the messages • Add the value of same number given by the client •After performing all operation close all the operation ----- Create an a java program name "Client.java" • Use the predefined Socket class to make the connection using port number • Use Input and output stream classes for passing the messages and receiving the messages • After performing all operation close all the operation Sample Output; Server Side: Server Started and listening to the port 22215 (Waiting for client, Now run the client) Client Side: Message sent to the server: www.nct.edu.om Server Side: Message received from client: www.nct.edu.om Message sent to the client: 5.37.70.7 Client Side: Message received from the server:…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education