Suppose this code (developed in ANSI C): bufferTest (buffer*) { if (!b): return FALSE; else: return (b->content); } TASK: Identify all errors with this code and solve it to return the correct test of the buffer. please writ this code in correct way
Q: How do you do smartPCA correctly and effectively?
A: Introduction: SmartPCA: PCA stands for Principal Component Analysis, which is a widely used statist...
Q: Given the following memory chip configurations find the requested information: An EPROM chip has a c...
A: a) Organisation - 16K *8 8 - Data Pins and 14- address Pins b) Organisation - 16*4 4 - Data Pi...
Q: In SQL, the data in a relation can be retrieved/displayed in ascending/descending order using keywor...
A: According to the question we generally use sql commands for retrieve the data from database and for ...
Q: Suppose we have two arrays, a and b, containing numbers of size n and m, respectively. a and b seque...
A: Suppose we have two arrays, a and b, containing numbers of size n and m, respectively. a and b seque...
Q: Discuss the concept you picked up from smart fabrics.
A: Introduction: Technical textiles, often known as smart textiles, are created and recognised as one o...
Q: public class ArrayMerge { static void arrayMerge(int a[], int b[]){ int c[] = new i...
A: Please find the solution below
Q: Using MATLAB input a natural number n and then print the sum of the first n odd natural numbers in t...
A: An even number has a remnant of 0 when divided by 2, whereas an odd number has a leftover of 1 when ...
Q: Build a Learning-Based Agent, using python and aima3 library...
A: from node import * from problem import * import math import heapq import random NODES_COUNT = 0 ...
Q: What exactly are secondary images, and what do they imply?
A: Introduction: Secondary image means a spurious or ghost image, in addition to the bright primary ima...
Q: Can anyone help me write a code for python for the Following steps. I have written a fair bit just w...
A: Summary: - Hence, we have discussed all the points.
Q: Write a Java program to find the number of words in the user entered String. for example:- i/p : "Aw...
A: Required:- Write a Java program to find the number of words in the user entered String. for example:...
Q: Draw an Entity relationship diagram (ER) for a university according to the following rules: ‐ For ...
A: ER Diagram: An ER diagram shows the relationship among entity sets. An entity set is a group of simi...
Q: hat role does an IP address play in computer networks?
A: Introduction: An IP address's function is to manage the connection between devices that transmit and...
Q: 1. Even after running the spell checker, why is it important to proofread information that you input...
A: A spreadsheet is a computer application for computation, organization, analysis and storage of data ...
Q: 34. In JAVA language, write a program to input the distance in kilometers and then convert the dista...
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: 1. Consider the following fragment of English: The boy walked the dog The girl walked the dog The bo...
A: the boy girl ran walked chased dog 0 1 1 2 2 4 2 3 0 0 3 ...
Q: Question:: Do parallel/distributed databases have a distinct advantage over centralized ones?
A: Ans : True that parallel/distributed databases have a distinct advantages over centralized ones tha...
Q: I have an javascript array and now I want to add two elements one from backside and other from front...
A: logic:- use push() function to add element at last. Use unshift() function to add element at first...
Q: Q6. Provide a shell-script that renames all files in the current directory. You will need to add the...
A:
Q: Five ways have been mentioned for the copy and paste process, which are 1- Copy and paste by clickin...
A: answer is
Q: PROVIDE JS SOURCE CODE Design a web page with a text box (username) where the user can enter a name ...
A:
Q: 172.16.0.0 (class B IP address) into four subnets. Describe each step and show the result at each st...
A: The answer is
Q: Determine whether each of these functions is a bijection from ℝ to ℝ. If it is, write the inverse f...
A: Determine whether each of these functions is a bijection from ℝ to ℝ. If it is, write the inverse fu...
Q: ethods as a base point, write a password generator that will generate a password of a given length. ...
A: Lets see the solution.
Q: Consider a collection C with 100,000 documents.
A:
Q: Q3] (6 Marks) Suppose A is a one-dimension array with 12 elements is entered into list box. Write a ...
A:
Q: Create a Java program for the transaction of an ATM. The main class is responsible for allowing the ...
A: I give the code in Java along with output and code screenshot
Q: What exactly does the sudo command mean?.
A: Answer: Sudo (SuperUser DO) is a command that grants you access to files and operations that are nor...
Q: 34. In JAVA language, write a program to input the distance in kilometers and then convert the dista...
A: Start input distance in kilometers miles= kilometers / 1.6 print distance in miles stop
Q: Write a javascript program to prove that symbols are immutable.
A: Required:- Write a Javascript program to prove that symbols are immutable. Approach:- Make 2 objects...
Q: Identify and explain the problems that big data with a vast volume of data might cause.
A: Introduction: Big Data is an area of research that entails evaluating a large amount of data methodi...
Q: Ethics – compile a list of ethical issues to be considered when formulation a view on human exceptio...
A: INDIGENOUS KNOWLEDGE SYSTEMS IN VIETNAM'S UPLAND IN SUSTAINABLE DEVELOPMENT AS AN EXAMPLE In the pre...
Q: public class FindArrayDifference { static void arrayDifference(int a[], int b[]) { ...
A: We are given a piece of code for which we need to calculate step number and time complexity. Algorit...
Q: units = int(input(" Please enter Number of Units you Consumed : ")) if(units < 50): amount = u...
A: I have tested all the scenario its working fine the code is given below
Q: Suppose A is a one-dimension array with 12 elements is entered into list box. Write a program segmen...
A: Code: Private Sub Command1_Click()Dim A(12) As SingleFor i = 1 To 12A(i) = Val(List1.List(i - 1))Nex...
Q: t has the file deletion algorithm had?
A: given - In Symbian, Android, and iPhone, what impact has the file deletion algorithm had?
Q: Question:: Is there a difference between a system subsystem and a logical division?
A: Introduction: Subsystem: A unit or piece of equipment is part of a more extensive system. For examp...
Q: N JAVA Write a class Store which includes the attributes: store name, city. Write another class ...
A: Step 1 The code is given in the below step by step
Q: What are the TCP/IP layers names? List all the layer names in a proper order with layer numbers.
A: Ans: There is the 5 types of TCP/IP layers in the there is the application, transport, network, dat...
Q: Understand the difference between ios::out and ios::app
A: Defined the difference between ios::out and ios::app
Q: One hundred students are assigned lockers 1 through 100. The student assigned to locker number 1 ope...
A: ANSWER Let us try to understand the problem very clearly, For sake of convenience take there are 1...
Q: here is a CD available for purchase that contains .jpeg and .gif images of music that is in the publ...
A: The answer is given below:-
Q: An organization is granted a block of addresses with the beginning address 21.103.51.0/24. The organ...
A: Given that, IP address= 21.103.51.0/24 We need to divide this network into 3 subnets. Number of IP a...
Q: Question 1f: Convert the following hexadecimal number to decimal: ACEF 44271
A: Note: This is a multiple-question-based problem. As per company guidelines, only the first question ...
Q: 1-what is Active Directory Administrative Center 2- explain Active Directory Administrative Cent...
A: Remote access to the Admin Center: Server Manager has extended administrative tasks in Active Direct...
Q: 12. Simplify the boolean expression Z = A + A) using boolean algebra. %3D
A: Simplify the boolean expression Z = A + A¯¯ using boolean algebra.
Q: Write a Java program to find the number of words in the user entered String. for example:- i/p : "Aw...
A: Approach:- Take the string from the client utilizing the scanner class article and afterward make a ...
Q: etween a system subsystem and a logical division
A: given - Is there a difference between a system subsystem and a logical division?
Q: I have an javascript array and now I want to add two elements one from backside and other from front...
A: Required:- I have a javascript array and now I want to add two elements one from the backside and th...
Q: In C++ A carpet company has determined that every 50 square feet of floor coverage will require 6 ho...
A: #include<iostream>using namespace std; bool inputValidate(double);void getInfo(double&, do...
Suppose this code (developed in ANSI C): bufferTest (buffer*) { if (!b): return FALSE; else: return (b->content); }
TASK: Identify all errors with this code and solve it to return the correct test of the buffer.
please writ this code in correct way
Step by step
Solved in 2 steps
- In C Programming: Write a function printCourseRow() which receives a course pointer and prints all its fields as a single row. Use proper formatting so that when we print 2 or more courses as rows, the same members align below each other. Test the function, but don’t include the testing code in your homework.Upload a screenshot of a sample output.For the scramble.c problem, write a program that: • Has a main () function and another function that has this prototype: void scramble str (char s[]); • The scramble_str() function scrambles the contents of the string in a random way so that the string has the same length as before, but the contents are all mixed around. It does this in-place, i.e., there is only one buffer that holds a string. You're free to scramble it any way you want to, but use rand () repeatedly so it gets really scrambled. • The main () function will read a string entered by the user into the buffer, call scramble_str(), and output the resulting string. This will be done in a loop forever, until the entered string is the string "bye". When the user says "bye", the program will exit with a polite message. Do note that reading a string using scanf (), which is the only tool I've introduced you to so far, will just read up to the first whitespace. So, multiple-word strings won't work! Let's use something that will…The question should be done in C++, please give explanation and running result. 1. For this question, we need to provide more information about where the mismatch of the text file is happening. Write a recursive function called list_mismatched_lines that takes 2 filenames as input arguments and displays to the screen all mismatched lines in those files. This function should use hashing techniques and shall not compare strings to detect mismatch. The signature of this function should be: void list_mismatched_lines(std::string file1, std::string file2); In file1.txt, it contains "My dear C++ class. I hope that you enjoy this assignment. " In file2.txt, it contains "My dear C++ class. I hope that you like this assignment. " Example: Running the following line of code, should print to the screen the mismatched lines only, from both files. list_mismatched_lines(file1, file2); The following output should be seen on the screen: file1.txt: I hope that you enjoy this assignment.file2.txt:…
- The read() system call needs to be run in a loop to deal safely with edge cases that can appear on some system configurations. Some libraries provide a function for this (for example the C library [fread), but it is not too hard to code yourself. Consider the following snippet of code, with two parts replaced by XXX and YYY ssize_t do_read(int fd, void buffer, size_t len) { ssize_t res; do { res read(fd, buf, len); while (res XXX @ && errno YYY); return res; } Enter the values for XXX and YYY to make this code run correctly, respecting the following rules. The correct value for XXX is a single operator. Enter it without any spaces. The correct value for YYY is a clause to do a comparison with the errno value. Enter the value with no leading or trailing spaces, and exactly one space in any places inside the string where spaces are required. Enter the values here: ● XXX: • YYY:Modify the producer-consumer implementation code bellow, so that it uses monitors to handle race conditions instead of semaphores or mutexes. Use the pthread library implementation #include <pthread.h> #include <semaphore.h> #include <stdio.h> #include <stdlib.h> #define BUFFER_SIZE 20 pthread_mutex_t mutex; int count = 0; int buffer[BUFFER_SIZE]; pthread_t tid; int producers = 0, consumers = 0; void insert(int item) { while (count == BUFFER_SIZE); if (count < BUFFER_SIZE) { buffer[producers] = item; producers++; producers=producers%BUFFER_SIZE; sleep(1); } return; } int remove_item() { int item; while (count == 0); if (count > 0) { item = buffer[consumers]; buffer[consumers] = buffer[consumers - 1]; consumers++; consumers=consumers%BUFFER_SIZE; sleep(1); } return item; } void * producer(void *param) { int item; while (1) { item = rand() % BUFFER_SIZE; while (count >= BUFFER_SIZE);…Compliant/Noncompliant Solutions The following code segment was provided in Secure Coding Guidelines for Java SE: void readData() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream("file"))); // Read from the file String data = br.readLine();} The code is presented as a noncompliant coding example. For this assignment, identify two compliant solutions that can be utilized to ensure the protection of sensitive data. Provide a detailed explanation of factors, which influence noncompliant code and specifically how your solutions are now compliant. Your explanation should be 2-3 pages in length. Submit the following components: Word document with appropriate program analysis for your compliant solutions and source code in the Word file. Submit your .java source code file(s). If more than 1 file, submit a zip file.
- The task is to implement part of a linter program using python. Specifically, you must be able to scan for grouping symbols ( "()", "[]", "{}” ) and ensure that there are no hanging open symbols or stray closing symbols in the source file. The implementation must involve recursion in terms of scanning for the scope. If a different closing symbol is encountered or the end of file is reached, the error message "Line : missing closing symbol for "" should be displayed. For stray closing tags, the message "Line : stray closing symbol for "". Note: Do not use "stack" in your code.C++ LANGUAGE In this assignment, you will be writing two objects to heuristically compare the performance of the bubble sort, selection sort, and insertion sort algorithms. To do this, a “Timer” object will be created and compositionally related to a storage class that will load the file contents, execute the sorts in an unbiased manner, handle any memory allocations that need to be made in order to do this, and reports back the execution times of each algorithm on the provided input files for that machine. First you will need to make a Timer object. This object should function like a traditional stopwatch with methods for starting, stopping, resetting, and reporting back times. The design of the object itself is up to you (it should minimally contain methods for the aforementioned ideas), but it must consist of a solitary object that provides interfaces appropriate for being compositionally included as part of a sorting object to facilitate the timekeeping portion of this exercise.…Python decorators can be used in Django in order to avoid duplication of code in view functions. For instance, consider the following definition of a decorator that is then applied to a view function. This code has three bugs: 01: def fetch_author (view_func) : 02: 03: 04: 05: 06: 07: 08: def wrapper (request, *args, **kwargs) : return view_func 09: 10: @fetch_author 11: def books_new (request) : 12: 13: 14: 15: 16: 17: } books = Book.objects.filter (authors _in= [author], year_ _gte="2015") context = { try: author = Author.objects.get (id-request. GET ["author_id"]) view_func (request, author, *args, **kwargs) except Author. Does NotExist: return bad_request (request, Author.DoesNotExist) Line 02 Line 05 Line 08 return render (request, "books-recent.html", context) Line 11 Identify the three lines which contain the three bugs: Line 12 Line 17 "title" : "New books", "books" books,
- Q2: Besides the while-loop in Q1, I want to implement a 2nd while-loop running in parallel with the first while: while(1) { wt(1); XX); } However, on an MCU there is no parallelism. (For ex., on Arduino I can define only one loop() function.) Write a single while that does the job of both whiles. (a) Write it in a procedural style. (b) Write it the super-loop style (state-machine with fixed heartbeat).Implement a password cracker using C++ Source code must be well documented (comments). You will be provided with an unsalted hashed password file that contains password hashes for different users. Also, you will be provided with a dictionary file(in clear text) containing the most common passwords. You should implement the offline dictionary attack by trying SHA1 and SHA2 algorithms. Also, your program should brute force all possible alphanumeric(only small cases) passwords from 1 to 4 characters using SHA1 and SHA2 algorithms against all hashed passwords left from the offline dictionary attack (if any).Part Two: Implementing a rainbow table You are to write a program, in C/C++, Java or Python, that should run using the following instruction: $ ./Rainbow Passwords.txt where the file Passwords.txt contains a list of possible passwords. The password file contains a password per line, as in the provided words file and consists of strings of printable characters. Any password used must be taken from this file, so the only stored hash information needs to relate to those entries in the file. The program is used to find pre-images for given hash values. Rainbow tables can be used to solve pre-image problems for hash functions. At the simplest level they can simply be a list of hash values and the corresponding pre-images, often from some dictionary. This can be expensive in terms of storage space however, and a more efficient way of identifying pre-images involves the use of the hash function and reduction functions. First step The process is as follows: 1. Read in the list of possible…