A regular expression is written in a very specific language, and its purpose is to define a text pattern. One of the biggest uses of regular expressions is to detect specific text patterns within a larger text file, such as a log file. For example, you might write a regex to look for the specific text that represents an HTTP 500 error in a web server log file or to look for email addresses in an SMTP server log file. In this assignment your task is to parse an industrial benchmark and extract the following patterns: Read bench.txt file as input. Extract all the rows with the following pattern from the text file (by using regex): Pattern: - - instſdigit_number] [MACRO NAME] + PLACED ( [X] [Y] ) [DIRECTION] ; For example: - inst2591 NAND4X2 + PLACED ( 100000 71820 ) N ; In this example: Digit_number: 2591 MACRO Name: NAND4X2 X: 100000 Y: 71820 Direction: N
Q: Write a Java program that allows the user to specify a file name on the command line and prints the…
A: The program for the above problem is given below:
Q: Another question, I suppose to draw a snowflake using this function, but everytime I get to the…
A: Given: Another question, I suppose to draw a snowflake using this function, but everytime I get to…
Q: e Write a program that produces a Caesar cipher of a given message string. A Caesar cipher, or…
A:
Q: Can a python programmer write a program that takes a picture of its own source code and then hides…
A: Python is a general purpose, interpreted, high level programming language that is used for…
Q: Write down a program for summing up the total vehicle trip counts between a source location and…
A: As per the question, we want to achive the following goals : 1. read input from user in the format…
Q: Write a program in C++ language that inserts two symbolic strings from the keyboard and prints them…
A: Write a program in C++ language that inserts two symbolic strings from the keyboard and prints them…
Q: Given a chess board, your job is to write a program that takes two squares x and y as input and then…
A: Code: #include <bits/stdc++.h> using namespace std; int dx[8]={-2, -2, -1, -1, 1, 1, 2,…
Q: Implement a SMS spam detection program in python using the Naive Baiyes algorithm. The program…
A: The answer is given below:-
Q: de: int paths(int i, int j) { static int p[5][5] = {0}; if (i == 0 || j == 0) return 1;…
A: In C++, finish the Robot Paths code. Here is the starter code: int paths(int i, int j) { static…
Q: Write a C program that reads an integer n and prints the sequence of order n. The first few strings…
A: #include <vector>#include <iostream> using namespace std;vector<int> ans;void…
Q: Write a C++ program that accepts a number followed by one space and then a letter. If the letter…
A: Approach: We used if else-if ladder to display the required result Prompt user to enter the number…
Q: Write a Matlab/Octave script that finds the number of perfect numbers between 1 and n. n is the…
A:
Q: Write a C program, called msg.c, that reads messages from an input file (or stdin) and verifies…
A: #include <stdio.h>#include<string.h>#include<stdbool.h>bool foo(char…
Q: a. Add the following operation to the class stackType : void reverseStack(stackType &otherStack);…
A: Objective: A function would be added to the stackType class to copy elements from an existing stack…
Q: Write an activity that will replace the letter c2 for all the forms of the letter c1 and vice versa.…
A: Create the method with 3 arguments 1st string 2 vice versa string create the variable to store the…
Q: Write a shell script program that uses * to print the entire pyramid (shown below). To print the…
A:
Q: Write a program in c language to analyze the letter frequencies in a block of text. Ignore case…
A: Start. Read the characters in the string. Find the frequency of each character. Print them. Exit.…
Q: Write a java program that reads in a series of first names and eliminates duplicates by storing them…
A: please check the step 2 for solution
Q: I want a coding in python 3 on raspberry pi that can find a video in a file and tell me the time…
A: A 2-part series on motion detection This is the first post in a two part series on building a motion…
Q: Write a program to produce the first 100 Fibonacci numbers. A Fibonacci number is one that is the…
A: Here I have first of all taken a for loop to iterate for the next 100 times. Inside the loop, first…
Q: rite a C++ program which finds out the shifts where the substring/pattern matches the text, by using…
A: Below i have given program :
Q: Write a C program, called msg.c, that reads messages from an input file (or stdin) and verifies…
A: Actually, program is a executable software that runs on a computer.
Q: Please write a program that performs Cipher Block Chaining encryption and decryption with either AES…
A: Solution: Given, Please write a program that performs Cipher Block Chaining encryption and…
Q: Write a MIPS assembly language program that generates a sequence of integers, such that cach integer…
A: Introduction
Q: Write a python program that shows ten distinct random words, all over ten characters long, that…
A: import randomdef count_distinct_words(filename): try: # open file to read f =…
Q: In python coding language.. Create a program that will take in an input of ASCII characters and…
A: The concept I have used is to extract each character ASCII value and check idmf sum with distance is…
Q: Write a program that simulates the control software for a “people mover" system, a set of driverless…
A: Given requirement, Write a program that simulates the control software for a "people mover" system,…
Q: Question 1: Suppose you are decrypting an incoming message for National Security purposes. For that…
A: Algorithm: Start Read string s and integer n Declare an empty dictionary sList Iterate through the…
Q: Write a C program that asks the user to enter the number of pencils (in Kilograms) that he wants to…
A: Note: - As per the guidelines we can only answer one specific at a time. Please resubmit the other…
Q: Write a program in C that can convert a bit stream of a message into a frame by using Hamming…
A: As you have asked multiple questions we will solve the first one for you. If you want any specific…
Q: Given the following table. Write a C program to implement Mono-alphabetic cipher for encrypting and…
A: Mono-alphabetic Cipher: Any cipher in which the plain text letters are mapped to cipher text letters…
Q: Given a chess board, your job is to write a program that takes two squares x and y as input and then…
A: Program: #include <bits/stdc++.h> using namespace std; int dx[8]={-2, -2, -1, -1, 1, 1, 2,…
Q: Write a program in elixir to iterate over the list of strings and divide the whole list into smaller…
A: Here we write simple , divide the whole lists into smaller chunks. we assume as take 16 element in…
Q: Write a MATLAB program in a script file that finds a positive integer n such that the sum of all the…
A: Use an infinite loop to find the sum and keep on adding the Integer to Sum till the Sum is 3 digit…
Q: Write a script using PHP that takes a link from the user and parses through its associated web page…
A: <!DOCTYPE html> <html> <head> <title>Web Crawler</title> </head>…
Q: Write a program to produce the first 100 Fibonacci numbers. A Fibonacci number is one that is the…
A: Program Approach: Include the necessary header files for standard I/O. Declare a main function().…
Q: Design a project to find the smallest number in three mumbers by calling the subroutine (Smallest)…
A: The answer for both mcqs is given below.
Q: Write a C program to create chessboard like boxes (8 X 8) in the client area. If the window is…
A: Algorithm Step1: Declare the variables of row, column and size as x and y, also temporary variable…
Q: Write a program that prints the multiplication table but inserts a randomly generated incorrect…
A: Objective: This program will print the multiplication table with a randomly generated wrong value.…
Q: s the user options to encrypt and decrypt with DES and AES. The program should further offer the…
A: Q. Write a program (in JAVA) that gives the user options to encrypt and decrypt with DES and AES.…
Q: Write a C program, called msg.c, that reads messages from an input file (or stdin) and verifies…
A: C programming is a general-purpose, procedural, imperative computer programming language developed…
Q: example python code for generating dot plots for two DNA sequence (in a text file, where the first…
A: import matplotlib.pyplot as new#used for data visualization new.style.use('seaborn') #seaborn…
Q: Try to count the total number of words and characters of given input strings on the command line
A: Answer:
Q: Can you write me a code in C ++ language with the data I wrote to you, such as the output I took a…
A: According to the above program to solve this data, we need to calculate the average and draw a Bar…
Q: Write a MATLAB program in a script file that finds a positive integer n such that the sum of all the…
A: The requested Matlab code is in the next step by using while loop and if-else statements.
Solution needed in Python language.
Step by step
Solved in 2 steps
- Write a program that coverts a zip code to a bar code. The bar codes use large and small bars. We will use : as a small bar and | as a large bar. Each digit has its own bar pattern. 1 is :::|| 2 is ::|:| 3 is ::||: 4 is :|::| 5 is :|:|: 6 is :||:: 7 is |:::| 8 is |::|: 9 is |:|:: 0 is ||::: The barcode also includes a check digit. The final digit added to the bar code verifies the previous numbers are correct. To Determine the checksum: Add all the digits together Determine what needs to be added to make the total a multiple of 10 The bar code also always starts and ends with a large bar. This is used by the scanner to align the letter. Drexel's Zip Code is 19104 The check digit is 5. The sum of the digits is 1+9+1+0+4 = 15. To make 15 a multiple of 10, we need to add 5. The bar code will be |:::|||:|:::::||||::::|::|:|:|:| The majority of work in this problem is done by digit. It makes sense to store the zip code as a string, not as an integer. Write the function checksum(zip)…Write a JAVA program for HTML is the language of web pages. Items start and end with tags. A table starts with <table> and ends with </table>. In a table, a row starts with <tr> and ends with </tr>. In a row, a column starts with <td> and ends with </td>. Given two integers for rows and columns, generate an appropriately sized html table. Place the character c in each table cell. If the input is 2 3, the output is: <table> <tr> <td> c </td> <td> c </td> <td> c </td> </tr> <tr> <td> c </td> <td> c </td> <td> c </td> </tr> </table>Write a java program that enables the user to enter a string and an index,then cuts the letter in the given index(only cuts the single letter). Then prints the new string without that letter
- Write a Python program that uses a token count to simulate a simple slot machine in which 3 numbers between 0and 8 are randomly selected and printed side-by-side. Your program should ask the slot machine user to input howmany tokens the user wishes to begin with. Print “JACKPOT!” if all three of the numbers are the same after a spinand increase the tokens by 10. Print “NICE MATCH!” if only two of the tokens are the same after a spin andincrease the token count by 3. In any case, it costs the user 1 token to spin. Continue playing until the userchooses to stop (print the final token count) or the token count reaches 0 (print “Sorry, you are out of tokens”). Ifthe user wants to spin again, instruct the user to hit a carriage return. If the user wants to quit, instruct theuser to type any other character before the carriage return. Always print out the final token count before yourprogram terminates. Your code needs to include a function spin_slots() that generates the three-digitrandom…In programming, we use the mask concept to indicate information that can be shown to the user and information that must be “masked”, that is, hidden. In an implementation of a hangman game, we use a mask to indicate which secret word positions the player has already guessed right (whose the contents must therefore be shown to the player), and which positions must remain hidden. Each time that the player hits a letter of the hidden word, the mask is updated so that it has little dashes in the places of letters that the player has not hit yet and show it, in their proper place, the letters that he already hit it. For example, if the word is "cards", the current mask is: - a - - s and the player guesses the letter "d", the mask should be updated to: - a - ds.Write a function called update_mask that takes as input a string containing the word secret (in the example above, this word would be “cards”), a list whose elements are the characters of the current mask (in the example above…Write a program that can dynamically change the font of a text ina label displayed on a stack pane. The text can be displayed in bold and italic atthe same time. You can select the font name or font size from combo boxes, asshown in Figure . The available font names can be obtained using Font.getFontNames(). The combo box for the font size is initialized with numbersfrom 1 to 100.
- 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.Write a program in Python that asks the user to enter an integer and prints two integers, root and power, such that 1 < power < 6 and root ** power is equal to the integer entered by the user. If no such pair of integers exists, it should print a message to that effect. Write the program so that if the user gives integer 64, then your program will answer that 4 ** 3 is 64, that is, it looks for the lowest root for which root ** power is the desired integer.Write a program that reads a list of integers from input and identifies the mode (the value that appears most often). The input is a sequence of integers that ends with -1. Total number of integers in the list is unknown. Output the mode and end with a newline. Assume that the list is not empty and only one mode exists. Ex: If the input is: 5 9 2 -3 -5 -3 2 1 4 5 5 -1 the output is: 5 import java.util.Scanner; import java.util.ArrayList; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); /* Type your code here. */ }}
- Write a c++ program to assign passengers seats in an airplane. Assume a small airplane with seat numbering as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7 A B C D The program should display the seat pattern, with an 'X' marking the seats already assigned. For example, after seats 1A, 2B, and 4C are taken, the display should look like this: 1 X B C D 2 A X C D 3 A B C D 4 A B X D 5 A B C D 6 A B C D 7 A B C D After displaying the seats available, the program prompts for the seat desired, the user types in a seat, and then the display of available seats is updated. This continues until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should say that that seat is occupied and ask…// the language is c++, please take a screen shot of your output Write a reverseStackfunction and test it with your studentID.(0766505) #include<iostream>usingnamespacestd; intMAXSIZE=8; intstack[8]; int top=-1; ntisEmpty(){ if(top==-1) return1; else return0;} int isFull() { if(top==MAXSIZE) return1; else return0;} int peek() { return stack[top]; } int pop() { int data; if(!isEmpty()) { data=stack[top];top=top-1;} else{ cout<<"Couldnotretrievedata,Stackisempty."<<endl;} returndata;} voidpush(intdata) { if(!isFull()){ top=top+1;stack[top]=data;} else{ cout<<"Couldnotinsertdata,Stackisfull."<<endl;}} intmain(){ //pushitemsontothestack push(3); push(5); push(9); push(1); push(12); push(15); cout<<"Elementattopofthestack:"<<peek()<<endl; cout<<"Elements:"<<endl; //printstackdata while(!isEmpty()){ int data=pop(); cout<<data<<endl;} cout<<"Stackfull:"<<isFull()<<endl;…In Python, The function concatAltChars takes a string parameter s and a boolean parameter even; the function concatenates together either the even-position characters of s or the odd-position characters of s, depending on whether even is True, or False, respectively. The accumulated string is returned. For example, the even-indexed characters of "HANOVER" are at indexes 0, 2, 4, and 6: H N V R. So, concatAltChars("HANOVER", True) returns the string result "HNVR". But concatAltChars("HANOVER", False) returns the string result "AOE". For example: Test Result s = "goldfinches" print(concatAltChars(s, True)) glfnhs s = "A" print(concatAltChars(s, True)) A s = "A" print(concatAltChars(s, False))