Siteimprove internal TechTalk.
Discussing what Accessible Names mean in a web context and how to add good Accessible Names through code and copywriting.
Siteimprove internal TechTalk.
Discussing what Accessible Names mean in a web context and how to add good Accessible Names through code and copywriting.
Functions: Function Definition, prototyping, types of functions, passing arguments to functions, Nested Functions, Recursive functions.
Strings: Declaring and Initializing strings, Operations on strings, Arrays of strings, passing strings to functions. Storage Classes: Automatic, External, Static and Register Variables.
Structures-Declaring and Initializing, Nested structure, Array of Structure, Passing Structures to functions, Unions, typedef, enum, Bit fields.
Pointers: Declarations, Pointer arithmetic, Pointers and functions, call by value, Call by reference, Pointers and Arrays, Arrays of Pointers, Pointers and Structures. Meaning of static and dynamic memory allocation, Memory allocation functions.
Files: File modes, File functions, and File operations, Text and Binary files, Command Line arguments Preprocessor directives. Macros: Definition, types of Macros, Creating and implementing user defined header files
Lexical analyzer, tokenizer, scanner, or lexer is a function that is invoked by the syntax analyzer. This function returns the nxt lexicon or word in the source file.
Python help- You will be writing an encryption program for an IT compa.pdfChristopherkUzHunter
Python help:
You will be writing an encryption program for an IT company. Your program should give the
option to either encrypt or decrypt a file of passwords. The encryption option should take each
password in the file, encrypt it, and output the encrypted contents to a new file. The decryption
process should reverse a previously encrypted file and output the original message to a new file.
File to use for testing: passwords.txt.
File contains:
PQERYT
NSBEMD
WPRZQY
ARITOU
Additional Information:
Encryption: To encrypt the file, you should start by reading through the file, character by
character, and place each character into a list. Spaces and punctuation are considered characters.
You should then change each character in the list into its ASCII value and subtract its index from
the value. For example, with the password: PQERYT, the capital P would be encrypted as 80 (its
ASCII code of 80 minus 0, its index number in the list) and the Q would be encrypted as 80 (its
ASCII code of 81 minus 1, its index number in the list). Finally, take the list and concatenate all
the values together into one string variable with a period between each value. For example, the
password PQERYT, the encrypted output file would contain: 80.80.67.79.85.79.4. (The 4 is the
newline character at the end of the password in the file).
Decryption: To decrypt the file, you should start by reading through the input file. Next, take the
string and create a list by using the split() function with the periods as the delimiter. When you
create the list, there will be an empty string placed at the end of the list that will need to be
removed. Finally, take the new list, add each value by its index and then convert that resulting
ASCII number into its appropriate character. Example: 80.80.67.79.85.79.4.
[80,80,67,79,85,79,4] PQERYT\n Your Task:
Your instructor is very particular regarding how this assignment will be completed so you must
follow the guidelines listed below exactly. You will need to define two functions with the
following criteria:
A function named encrypt() with no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
data from the input file, encrypt the information, and output the results of the encrypted message
to the output file.
A function named decrypt() also has no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
encrypted data from the input file, reverse the encryption process, and output the decrypted
message to the output file. The program should prompt the user to choose whether they want to
encrypt or decrypt a file or exit the program..
Functions: Function Definition, prototyping, types of functions, passing arguments to functions, Nested Functions, Recursive functions.
Strings: Declaring and Initializing strings, Operations on strings, Arrays of strings, passing strings to functions. Storage Classes: Automatic, External, Static and Register Variables.
Structures-Declaring and Initializing, Nested structure, Array of Structure, Passing Structures to functions, Unions, typedef, enum, Bit fields.
Pointers: Declarations, Pointer arithmetic, Pointers and functions, call by value, Call by reference, Pointers and Arrays, Arrays of Pointers, Pointers and Structures. Meaning of static and dynamic memory allocation, Memory allocation functions.
Files: File modes, File functions, and File operations, Text and Binary files, Command Line arguments Preprocessor directives. Macros: Definition, types of Macros, Creating and implementing user defined header files
Lexical analyzer, tokenizer, scanner, or lexer is a function that is invoked by the syntax analyzer. This function returns the nxt lexicon or word in the source file.
Python help- You will be writing an encryption program for an IT compa.pdfChristopherkUzHunter
Python help:
You will be writing an encryption program for an IT company. Your program should give the
option to either encrypt or decrypt a file of passwords. The encryption option should take each
password in the file, encrypt it, and output the encrypted contents to a new file. The decryption
process should reverse a previously encrypted file and output the original message to a new file.
File to use for testing: passwords.txt.
File contains:
PQERYT
NSBEMD
WPRZQY
ARITOU
Additional Information:
Encryption: To encrypt the file, you should start by reading through the file, character by
character, and place each character into a list. Spaces and punctuation are considered characters.
You should then change each character in the list into its ASCII value and subtract its index from
the value. For example, with the password: PQERYT, the capital P would be encrypted as 80 (its
ASCII code of 80 minus 0, its index number in the list) and the Q would be encrypted as 80 (its
ASCII code of 81 minus 1, its index number in the list). Finally, take the list and concatenate all
the values together into one string variable with a period between each value. For example, the
password PQERYT, the encrypted output file would contain: 80.80.67.79.85.79.4. (The 4 is the
newline character at the end of the password in the file).
Decryption: To decrypt the file, you should start by reading through the input file. Next, take the
string and create a list by using the split() function with the periods as the delimiter. When you
create the list, there will be an empty string placed at the end of the list that will need to be
removed. Finally, take the new list, add each value by its index and then convert that resulting
ASCII number into its appropriate character. Example: 80.80.67.79.85.79.4.
[80,80,67,79,85,79,4] PQERYT\n Your Task:
Your instructor is very particular regarding how this assignment will be completed so you must
follow the guidelines listed below exactly. You will need to define two functions with the
following criteria:
A function named encrypt() with no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
data from the input file, encrypt the information, and output the results of the encrypted message
to the output file.
A function named decrypt() also has no parameters. Within the function, the user should be
prompted to enter the input file name and the output file name. The function will then read in the
encrypted data from the input file, reverse the encryption process, and output the decrypted
message to the output file. The program should prompt the user to choose whether they want to
encrypt or decrypt a file or exit the program..
A New Modified Version of Caser Cipher AlgorithmIJERD Editor
Computers uses a file which is a collection of information. The information is sensitive part of the organizations , and can be classified into simple, important, and critical information. Any loss or threat to information can prove to be great loss to the organization as well to people. The most important goal for designing any encryption algorithm is the security against unauthorized attacks. This paper introduces a new method to enhance the performance of the (Cesar Cipher algorithm ). This is done by replacing the single key (Offsite) that used by the standard algorithm with dynamic key his value is changed for each letter depending on its position and the value of the previous letter. This replacement adds a new level of protection strength and more robustness against breaking methods. One more powerful technique added by the proposed algorithm is repeat the encryption for the entered text several times.
CS 23001 Computer Science II Data Structures & AbstractionPro.docxfaithxdunce63732
CS 23001 Computer Science II: Data Structures & Abstraction
Project #4
Spring 2015
Objectives:
· Develop and use a Tree ADT (n-ary)
· Apply and use tree traversal algorithms
· Manipulate trees by inserting and deleting nodes
· Apply and use STL
Problem:
Build a program profiler. Construct a program to instrument C++ source code to support program profiling.
It is often important to determine how many times a function or statement is executed. This is useful not only for debugging but for determining what parts of a program may need to be optimized. This process is called profiling. That is, a execution profile presents how many times each part of a program is executed using a given set of input data (or for some run time scenario). To compute a profile, statements need to be added to the code that keep track of how many times a function or statement is executed. The process of adding these statements is called instrumenting the code.
To implement a profiler one must first parse the source code and generate an Abstract Syntax Tree (AST) of the code. Each node of the AST describes the syntactic category of the code stored within it (function, statement, while-statement, etc.). So at the top level is a syntactic category corresponding to a program, class, or function (such as in the case of a main). Under that are sub-trees that further detail the syntactic categories of each part of the code. Such things as declarations, parameter lists, while-statement, and expression statements will describe the various parts of the program.
After the AST is generated it can then be traversed and the appropriate syntactic structures can be found that need to be instrumented. Once a construct is found, say a function, new code can be inserted that keeps track of how many times that function is executed.
The most difficult part of constructing a profiler is correctly parsing the source code. Unfortunately, C++ is notoriously difficult to parse. So here we will use a parsing tool called src2srcml. This tool reads in C++ code and marks up the code with XML tags (e.g., block, if, while, condition, name, etc). That is, the output is an AST in XML. The XML representation is called srcML (source code markup language).
A number of srcML data files are provided for the project. However, you can use your own program as input. To run srcML on wasp or hornet you will first need to set a PATH variable so the command can be found. You need to execute the command:
export PATH=/local/opt/srcml/bin:$PATH
It is best if you insert this line into your .bash_profile file in your home directory on wasp/hornet.
Then to generate the srcML file for your own code use the following:
src2srcml main.cpp -o main.cpp.xml
Use the following for a list of all options:
src2srcml --help
More information about srcML can be found at www.srcML.org including a list of all the tag names (see Getting Started). You can also download srcML if you want it on your own machine.
Your .
This Presentation is a draft of a summary of "Learn Python The Hard Way" Book which is very helpful for anyone want to learn python from scratch of
For reading the book and do exercises, the book is available for free here: http://learnpythonthehardway.org/book/
Introduction to objects and inputoutput Ahmad Idrees
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Encryption is a process of converting a message, image, or any other .pdfrachanaprade
Encryption is a process of converting a message, image, or any other form of data into encoded
data that can only be decoded by someone who can decrypt the message (usually with a key or
the like). The science of writing secret codes is called cryptography For thousands of years,
cryptography has made secret messages that only the sender and recipient could read, even if
someone captured the messenger and read the coded message. A secret code system is called a
cipher. A good encryption algorithm should produce output that looks random to a bystander but
is easily decipherable with the correct key. Thus, encryption algorithms make use of pseudo-
random encryption keys. Let's start with some definitions: - Encryption or Enciphering: the
process of encoding messages to make them unreadable. This algorithm has two inputs: a
plaintext and a secret key. - Decryption or deciphering: making encrypted messages readable
again by decoding them (recovering the plaintext from ciphertext). - Cipher: an algorithm for
performing encryption and decryption. - Plaintext: the original message. - Ciphertext: the
encrypted message. Note: a ciphertext still contains all of the original message information, even
if it looks nonsense. - Secret key; the same key used for encryption and decryption. -
Cryptography, the science of studying ciphers. For this project, you need to develop a game that
converts normal English words into secret codes. In order to convert, the program randomly
applies an encryption algorithm to any given message. The algorithms you need to implement
include Substitution, Playfais Caesas Transposition, Product, and RSA ciphers. 1. Substitution
cipher, replacing each letter of the alphabet in the plaintext with a different letter in the
ciphertext. For example, if you want to encrypt the word 'Cat', you need to come up with a
substitution for each plaintext letter to a ciphertext letter. For example, you may substitute the
letter ' a ' with the letter ' o '. The rule is that the letter we substitute can only be used once. So,
the letter 'o' is crossed off as it has already been used. The same would be applied to all
alphabetic letters.
1. Substitution cipher; replacing each letter of the alphabet in the plaintext with a different letter
in the ciphertext. For example, if you want to encrypt the word 'Cat'; you need to come up with a
substitution for each plaintext letter to a ciphertext letter, For example. you may substitute the
letter 'a' with the letter ' 0 . The rule is that the letter we substitute can only be used once. So, the
letter 'o' is crossed off as it has already been used. The same would be applied to all alphabetic
letters. You can also substitute a letter with itself. If you are not familiar with this cipher. please
visit: Substitution cipher Page 3 of 5 2. Playfair cipher is a digraph substitution cipher. It
employs a table where one letter of the alphabet is omitted, and the letters are arranged in a 55
grid. For more informat.
data.txtInternational Business Management l2 Cons.docxtheodorelove43763
data.txt
International Business Management l2 Consulatation fee // error
Imperial Chemical 234 Pest control chemicals
National Home Appliances 34S6 Coffee machines // error
MicroHeart Software Consultancy 45678 Security audit
University of Silver Quartet 5678 Facility management
Telstar Satellite Communication 67O Disconnection fee // error
data_c.txt
Imperial Chemical 234 Pest control chemicals
MicroHeart Software Consultancy 45678 Security audit
University of Silver Quartet 5678 Facility management
sample_isdigit.cpp
#include <iostream>
#include <cctype>
using namespace std;
int main(){
char a = 'A';
char b = '3';
char c = ' ';
if (isdigit(a)){
cout << a << " is a digit!" << endl;
} else {
cout << a << " is not a digit!" << endl;
}
if (isdigit(b)){
cout << b << " is a digit!" << endl;
} else {
cout << b << " is not a digit!" << endl;
}
if (isdigit(c)){
cout << c << " is a digit!" << endl;
} else {
cout << c << " is not a digit!" << endl;
}
return 0;
}
CSC2402 A3_2015_updated.pdf
CSC2402 Assignment 3
This assignment is marked out of 100 marks. It is worth 10 % of your overall course mark.
Submit your assignment on‐line using the link to Assignment 3 on the course web page.
Assignment 3 consists of one task. For Assignment 3 you must submit all four files listed below in a single ZIP
file (not RAR). All four files must be in pure text format. No PDF, HTML, Word files, Open Office files, RTF
etc. and no compression or archiving such as zip, rar, tar etc. Please name your files to match the names
listed.
task_3.cpp – holds main() function,
exception.cpp – class file for exception handler functions,
exception.h – class definition file for exception handler functions, and
task_3.txt – copy of compilation messages and sample runs.
The steps to copy the compilation messages and sample runs for the task_3.txt file are software dependent:
If you are using Codelite, the compilation messages can be copied and pasted with the usual crtl‐c
and crtl‐v. For output of sample runs, right click the title bar of the command window, select
EDIT/MARK and then highlight the output. With the output selected, right click the title bar of the
command window, select EDIT/COPY. Position your cursor to a (new) text file opened in a text editor
such as Notepad, and crtl‐v will paste the copied output to the text file.
If you are using MinGW, right click the title bar of the command window; select EDIT/MARK and
then high light the output. With the output selected, right click the title bar of the command
window, select EDIT/COPY. Position your cursor to a (new) text .
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
1. TO Buy the Tutorial Visit Our Website
COMP 122
Week 7 iLab
The focus of this lab is on using strings. You will have an opportunity to work
with both C style strings and the string data type. This lab also gives you an
opportunity to use what you have learned previously, including using functions,
array processing, repetition, and selection. You will also have an opportunity to
work with file input and output.
You are to design and implement a program which does encryption and
decryption of data from files. Encryption is the process of taking plain lines of
text and performing some algorithmic transformation on the data to create an
encrypted line of text which looks nothing like the original. Decryption is the
process of taking an encrypted line of text and performing some algorithmic
transformation on the data to recover the original line of plain text.
Encryption and Decryption Approach
Our approach to encryption and decryption involves two strings. The first is an
encryption / decryption string which we will allow to be up to 128 lower case
alphabetical characters in length. The second string is a line of text from a file
that is to be encrypted or decrypted.
Our basic strategy for encrypting data is based on mapping alphabetical
characters to specific values, then doing some simple mathematical operations
2. to create a new value. First of all, every character in either the encryption string
or the input string is mapped to a number between 0 and 25 based on its position
in the alphabet.
=0
=1
= 25
The mapped value of a character is easily obtained by doing the following:
For lower case characters, subtract 'a' from the character.
For upper case characters, subtract 'A' from the character.
To calculate the modified value of the first character of input we add its mapped
value to the mapped value from the first character of the encryption string. This
modified value is then adjusted using % 26 to make sure that the final modified
value is within the 0 - 25 range. To create the final encrypted character value for
the first character, simply do the following:
For lower case characters, add 'a' to the modified value.
For upper case characters, add 'A' to the modified value.
This is done for each alphabetic character in the input string. Non-alphabetic
characters simply maintain their present value. If the input string is longer than
the encryption string, simply reuse mapped values from the encryption string.
For instance, if the encryption string has 10 characters (index values 0 - 9),
when processing the 11th input character (index 10), simply use the input
character index % length of encryption string (in this case 10 % 10 is 0) to
select the value from the encryption string to use for mapping.
The decryption process is basically the same as the encryption process. The
only difference is the value of the mapped character from the encryption string.
For lower case encryption, the mapped from encryption string - 'a'
For upper case encryption, the mapped from encryption string - 'A'
For lower case decryption, the mapped - (character from encryption string - 'a')
For upper case decryption, the mapped - (character from encryption string - 'A')
Program Requirements
3. Your program must meet the following requirements:
1. You must ask the user if they want to perform an encryption or decryption
operation.
2. You must ask the user to enter the name of the file they want to encrypt or
decrypt.
3. You must get an encryption key from the user which can be up to 128
characters. The key must be all lower case alphabetic characters.
4. You must have a function which takes the encryption key and creates an
encryption map from it. For each character in the encryption key string, subtract
the lower case letter 'a' and store the result in the corresponding encryption map
array.
5. You must have a function which takes the encryption key and creates a
decryption map from it. For each character in the encryption key string, subtract
the lower case letter 'a' from it. Then subtract that result from 26 and store the
value in the corresponding decryption map array.
6. You must have a function which will do the encryption or decryption
transformation. This function takes the following parameters:
A constant C string containing the line of text to be transformed.
A constant C character array which contains the encryption or decryption map.
An integer which contains the length of the encryption map.
A string reference (output) which will contain the encrypted or decrypted string
upon completion.
The core of the encryption / decryption algorithm is as follows:
For each character (the ith character) in the text input line do the following:
if the character is not alphabetical, add it to the end of the output string
if the character is lower case alphabetical
subtract the character 'a' from the character
get the ith % map length element from the map and add it to the character
adjust the value of the character % 26 to keep it within the alphabet
add the character 'a' to the character
add the encrypted character value to the end of the output string
if the character is upper case alphabetical
do the same thing as for lower case except use 'A' instead of 'a'
4. 7. For decryption, the main program should create an ifstream for the file to be
decrypted. It should use the getline method of the ifstream to read lines from the
file, call the encryption / decryption function with the line to be decrypted, and
display the string which contains the result of the encryption / decryption
function call. Repeat until the ifstream reaches the end of the file, then close the
ifstream.
8. For encryption, the main program should create an ifstream for the file to be
encrypted. It should also create an ofstream for the file where the encrypted
result will be stored. The file name for this file can be gotten from the user or
can be the input file name with a special extension added at the end. The getline
method of the ifstream is used to read lines from the input file. Then the
encryption / decryption function is called to encrypt the line. Display the string
containing the result and write the string to the ofstream. Close the ifstream and
ofstreams when finished.
9. Make sure that your program allows the user to encrypt / decrypt more than
one file per session. This means adding a loop which allows the entire program
to repeat until the user has nothing more to do.
Hints
1. Use C strings for the encryption string and the file names. Use char arrays for
the encryption and decryption maps. You cannot treat these as C strings because
the maps can contain 0 as a valid data item rather than the end of string marker.
2. Use a string type variable to hold the encrypted and decrypted strings. The
string type allows you to add characters to the end of a string using
thepush_back method, and it allows you to dump the contents of the string using
the erase method.
3. For input streams, you can use the eof method to determine when you have
reached the end of a file.
4. Use a character array to read data from the files. Set the maximum length for
this buffer to be 256 characters.
Development Strategy
5. I would recommend that you build this project in two phases. The first phase
should concentrate on getting the encryption and decryption map functions and
the encryption / decryption function working. You can test this by using fixed C
strings for the input line and the encryption string. Call the map functions, then
encrypt the fixed input string, output the result, then decrypt the encrypted
string and output the result. When your final output is the same as the original
input, your encryption / decryption functions are working. The second phase
adds the file operations.
Testing and Deliverables
When you think you have a working program, use Notepad to create a file with
plain text in it. You should enter some different length lines containing a variety
of characters. Your file should have at least 10 lines. You should try using short
and long encryption keys. Using your program, encrypt the file, then decrypt the
encrypted file. Take a screen shot of your decrypted output and paste it into a
Word document. Also copy the contents of your original file and the encrypted
file into the Word document. Clearly label the contents of the Word document.
Then copy your source code into your document. Make sure that you have used
proper coding style and commenting conventions!
6. I would recommend that you build this project in two phases. The first phase
should concentrate on getting the encryption and decryption map functions and
the encryption / decryption function working. You can test this by using fixed C
strings for the input line and the encryption string. Call the map functions, then
encrypt the fixed input string, output the result, then decrypt the encrypted
string and output the result. When your final output is the same as the original
input, your encryption / decryption functions are working. The second phase
adds the file operations.
Testing and Deliverables
When you think you have a working program, use Notepad to create a file with
plain text in it. You should enter some different length lines containing a variety
of characters. Your file should have at least 10 lines. You should try using short
and long encryption keys. Using your program, encrypt the file, then decrypt the
encrypted file. Take a screen shot of your decrypted output and paste it into a
Word document. Also copy the contents of your original file and the encrypted
file into the Word document. Clearly label the contents of the Word document.
Then copy your source code into your document. Make sure that you have used
proper coding style and commenting conventions!