Project: Use SMTP to send an email
1. Start a connection
2. Say hello to the server
helo networking
3. Login request
auth login
4. Input username
For example,
Plaintext: networkingtest2018
BASE64: bmV0d29ya2luZ3Rlc3QyMDE4
5. Input password
BASE64: Your passwordxxxxxx
after inputting your password, you will see
means you have already logged in.
6. Input sender and receiver’s information
, which
Note that go to https://www.base64decode.org/ to find the
encoded BASE64 phrase of your username and password.
7. Start drafting your email by typing data
8. Write your email
Subject:Hello
xxx
xxx
.
9. Finish writing your email and send.
If you want to finish writing, enter an enter to have a new line and input a dot.
10. Log out by inputting a quit
In: Computer Science
Describe in detail the encryption and decryption process for Simplified DES by showing your results at each step Details of decryption process:
input: 10 bit key = 1 1 1 1 1 1 1 1 1 1 and 8 bit plaintext = 0 0 0 0 0 0 0 0
Output from IP =
Output from first Fk using K2 =
Output from SW =
Output from first Fk using K1 =
Output from IP-1 =
In: Computer Science
Python 3 Program
Program 4 should first tell users that this is a word analysis software. For any user-given text file, the program will read, analyze, and write each word with the line numbers where the word is found in an output file. A word may appear in multiple lines. A word shows more than once at a line, the line number will be only recorded one time.
Ask a user to enter the name of a text file. Using try/except for invalid user input. Then the program reads the contents of the text file and create a dictionary in which the key-value pairs are described as follows:
Key. The key are the individual words found in the file.
Value. Each value is a list that contains the line numbers in the file where the word (the key) is found. Be aware that a list may have only one element.
Once the dictionary has been built, the program should create another text file for otuput, named “words_index.txt”. Next, write the contents of the dictionary to the file as an alphabetical listing of the words that are stored as keys in the dictionary (sorting the keys), along with the line numbers where the words appear in the original file. Please see the sample file for your reference.
Looking to seeing everyone to submit a well-done program! Here are some tips:
Documents/Comments of your program (Never more)
Testing your program by the given two files, Kennedy.txt . The output file of the Kennedy_index.txt, Kennedy_index_B.txt, Kennedy_index_C.txt, for input file “kennedy.txt”
Remember the output file name of your program is words_index.txt.
For this program, not running one (syntax error) will receive NO point.
Example of original text- Kennedy.txt
We observe today not a victory of party but a celebration of freedom symbolizing an end as well as a beginning signifying renewal as well as change
New text example - Kennedy_index.txt
Text File to be analyzed: Kennedy.txt We: 1 a: 1, 2, 4 an: 3 as: 4, 5, 6 beginning: 4 but: 2 celebration: 2 change: 6 end: 3 freedom: 3 not: 1 observe: 1 of: 2, 3 party: 2 renewal: 5 signifying: 5 symbolizing: 3 today: 1 victory: 1 well: 4, 5
example- Kenndy_index_B.txt
Text File to be analyzed: kennedy.txt
We : 1
a : 1, 2, 4
an : 3
as : 4, 5, 6
beginning : 4
but : 2
celebration : 2
change : 6
end : 3
freedom : 3
not : 1
observe : 1
of : 2, 3
party : 2
renewal : 5
signifying : 5
symbolizing : 3
today : 1
victory : 1
well : 4, 5
example- Kenndy_index_C.txt
Text File to be analyzed: kennedy.txt We : 1 a : 1, 2, 4 an : 3 as : 4, 5, 6 beginning : 4 but : 2 celebration : 2 change : 6 end : 3 freedom : 3 not : 1 observe : 1 of : 2, 3 party : 2 renewal : 5 signifying : 5 symbolizing : 3 today : 1 victory : 1 well : 4, 5
In: Computer Science
Shell script program that asks a number between 5 to 9. If the input is not between 5 and 9, display an error message and ask again.
Output
1
22
333
4444
55555
666666
7777777
88888888
999999999
In: Computer Science
Draw an ER diagram containing the ConferenceSeries, the ConferenceEvent, and the ConferenceTrack entitysets where each ConferenceSeries can be linked to zero or many ConferenceEvent entities, and each Conference Event may be linked to one or many ConferenceTracks. ConferenceTrack should not exists without a ConferenceEvent. Choose an appropriate relationship name. Then augment the model with an entityset Venue and a relationship named OrganizedAt associating each ConferenceEvent with exactly one Venue. Assume that a Venue must have run at least one ConferenceEvent. Your ER diagram should show all details. Show a translation into tables for a SQL database (topic covered in class on Tue Sept 9). Note: Add 3 attributes to each of the entity type with appropriate primary key.
In: Computer Science
does a zombie process use CPU time true or false
and is it true or false that a orphan process will find a new parent and will not use CPU time.
In: Computer Science
Show the encoding of the following machine instructions and convert into hexadecimal.
1. STUR X7, [X9, #32]
2. SUBI X16, X4, #52
3. AND X5, X20, X3
In: Computer Science
This code is an expression of cp command in c language. But I don't understand this code very well. Please explain in notes one by one.(in detail)
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<errno.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
int main(int argc, char *argv[])
{
char ch;
int src, dst;
struct stat st;
if(argc != 3)
{
printf("argument error \n");
printf("usage: ./a.out src dest \n");
exit(0);
}
if (stat(argv[1], &st) == -1) {
perror("stat : ");
exit(-1);
}
src = open(argv[1], O_RDONLY);
if(src == -1){
perror("open source");
exit(errno);
}
dst = open(argv[2], O_WRONLY | O_CREAT|O_TRUNC);
if(dst == -1){
perror("open source");
exit(errno);
}
while(read(src, &ch,1)){
write(dst,&ch,1);
}
close(src);
close(dst);
if (chmod(argv[2], st.st_mode)) {
perror("chmod : ");
return -1;
}
return 0;
}
In: Computer Science
I need to make changes to code following the steps below. The code that needs to be modified is below the steps. Thank you.
1. Refactor Base Weapon class:
a. Remove the Weapon abstract class and create a new Interface class named WeaponInterface.
b. Add a public method fireWeapon() that returns void and takes no arguments.
c. Add a public method fireWeapon() that returns void and takes a power argument as an integer type.
d. Add a public method activate() that returns void and takes an argument as an boolean type.
2. Refactor the specialization Weapon Classes:
a. Refactor the Bomb class so that it implements the WeaponInterface class.
b. Refactor the Gun class so that that it implements the WeaponInterface class.
3. Refactor the Game Class:
a. Remove all existing game logic in main().
b. Create a private helper method fireWeapon() that takes a WeaponInterface as an argument as a weapon. For the passed in weapon activate the weapon then fire the weapon.
c. Create an array of type WeaponInterface that can hold 2 weapons.
d. Initialize the first array element with a Bomb.
e. Initialize the second array element with a Gun.
f. Loop over the weapons array and call displayArea() for each weapon.
------
// Weapon.java
public abstract class Weapon {
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public abstract void activate(boolean enable);
}
______________________
// Bomb.java
public class Bomb extends Weapon {
@Override
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public void fireWeapon()
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
super.fireWeapon(67);
}
@Override
public void activate(boolean enable) {
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Enable
:"+enable);
}
}
_____________________________
// Gun.java
public class Gun extends Weapon {
@Override
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public void fireWeapon()
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
super.fireWeapon(98);
}
@Override
public void activate(boolean enable) {
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Enable
:"+enable);
}
}
_____________________________
// Game.java
public class Game {
public static void main(String args[]) {
Bomb b = new Bomb();
Gun g = new Gun();
b.fireWeapon(45);
g.fireWeapon(60);
}
}
In: Computer Science
Explain how to use the C# shortcut arithmetic operators -=, *=, and /=.
In: Computer Science
C++ Please
Fill in for the functions for the code below. The functions will be implemented using vectors. Additional public helper functions or private members/functions can be used. The List class will be instantiated via a pointer and called similar to the code below:
---the code can be general (can be tested with any int main() test function)---
Stack *ptr = new Stack();
ptr->push(value);
int pop1 = ptr->pop();
int pop2 = ptr->pop();
bool isEmpty = ptr->empty();
class Stack{
public:
// Default Constructor
Stack() {// ... }
// Push integer n onto top of stack
void push(int n) {// ... }
// Pop element on top of stack
int pop() {// ... }
// Get the top element but do not pop it (peek at top of stack)
int top() {// ... }
// Return whether the stack is empty or not
bool empty() {// ... }
};
In: Computer Science
Create java class with name MyClass1
Instructions for MyClass1
For this portion of the assignment you will need to create a java class of your own to model some objects in the real world or your own imagination. your classes should have at least three instances variables, accessor and mutator methods for each of those instance variables, one constructor method of any type, as well as an overridden toString method that will display every field value as part of a String. Use meaningful identifiers for the name of class.
Demonstrate that your class work appropriately by creating instances of each in the MainClass class which contains a main method
In: Computer Science
Write the equations for carry-out bits for a 4-bit carry lookahead adder. Draw its diagram and label all the inputs and the outputs. Compare the delays of the 4-bit ripple-carry and 4-bit carry lookahead adders.
In: Computer Science
Write a C program that counts the number of odd numbers with using function count() within the set. The set has only one negative number which determines the end of set.
In: Computer Science
(previous program) Prompt the user for the filename. Create a new file object sensehat_data_file which opens the file in write mode. Write a loop which will read in 20 values for temperature and humidity from the SenseHat. Sleep 0.5 seconds between each reading taken from the SenseHat Write out the temperature and humidity to the file sensehat_data_file, separated by a comma. Close the file.)
ONLY ANWSER problem below
Then Open the file in read only mode. Use a loop to read in the data from the file until all lines have been read. Print out the count for the number of the line read in. Print out the temperature and humidity.
Print in Python .
In: Computer Science