Questions
Imagine that a company has developed an advanced technology that allows it to reduce its data...

Imagine that a company has developed an advanced technology that allows it to reduce its data center requirements by an unprecedented amount, and creates a competitive advantage for the company in the data center market. Why should it share that technology with other data center firms? If this firm does not share its techniques, the rest of the industry will continue to operate less efficient centers, and increase global emissions of green house gases above what they would otherwise be.

In: Computer Science

Give regular expressions for (c) C indentifiers (d) Binary strings consisting of either an odd number...

Give regular expressions for

(c) C indentifiers

(d) Binary strings consisting of either an odd number of 1s or an odd number of 0s

In: Computer Science

4. Identify the tool is used with the netstat command to view a system's routing table?...

4. Identify the tool is used with the netstat command to view a system's routing table? Run the identified command and highlight the output of the command with an appropriate result and discussion.

In: Computer Science

4. Create an array with the values “Andrew,” “Andy,” and “Kaufman” (without the quotes). Write a...

4. Create an array with the values “Andrew,” “Andy,” and “Kaufman” (without the quotes). Write a program that prints Andrew “Andy” Kaufman in perl.

In: Computer Science

5. Implement 2-D error detection mechanism using even parity check. Given a data bit to be...

5. Implement 2-D error detection mechanism using even parity check. Given a data bit to be send, perform the even parity check for the data to be send. Append the parity bit at the end of that data. At the receiver end, the receiver has to check for errors in transmission

Please code in C language.

In: Computer Science

5. Create this hash variable: in perl language Scalar => ‘dollar sign’, Array => ‘at sign’,...

5. Create this hash variable: in perl language Scalar => ‘dollar sign’, Array => ‘at sign’, Hash => ‘percent sign’ Process it with a foreach loop that prints the key/value pairs so that the keys are printed in sorted order: Array: at sign Hash: percent sign Scalar: dollar sign.

In: Computer Science

analyze the assembly code and explain what each line is doing 000000000000063a <main>: 63a: 55 push...

analyze the assembly code and explain what each line is doing

000000000000063a <main>:
 63a:   55                      push   ebp
 63b:   48 89 e5                mov    ebp,esp
 63e:   48 83 ec 10             sub    esp,0x10
 642:   c7 45 fc 00 00 00 00    mov    DWORD PTR [ebp-0x4],0x0
 649:   eb 16                   jmp    661 <main+0x27>
 64b:   83 7d fc 09             cmp    DWORD PTR [ebp-0x4],0x9
 64f:   75 0c                   jne    65d <main+0x23>
 651:   48 8d 3d 9c 00 00 00    lea    edi,[eip+0x9c]        # 6f4 <_IO_stdin_used+0x4>
 658:   e8 b3 fe ff ff          call   510 <printf@plt>
 65d:   83 45 fc 01             add    DWORD PTR [ebp-0x4],0x1
 661:   83 7d fc 09             cmp    DWORD PTR [ebp-0x4],0x9
 665:   7e e4                   jle    64b <main+0x11>
 667:   b8 00 00 00 00          mov    eax,0x0
 66c:   c9                      leave 
 66d:   c3                      ret    

In: Computer Science

6. Store your important phone numbers in a hash. Write a program to look up umbers...

6. Store your important phone numbers in a hash. Write a program to look up umbers by the person’s name in perl language.

In: Computer Science

This program focuses on programming with Java Collections classes. You will implement a module that finds...

This program focuses on programming with Java Collections classes. You will implement a module that finds a simplified Levenshtein distance between two words represented by strings.

Your program will need support files LevenDistanceFinder.Java, dictionary.txt, while you will be implementing your code in the LevenDistanceFinder.java file.

INSTRUCTIONS

The Levenshtein distance, named for it's creator Vladimir Levenshtein, is a measure of the distance between two words. The edit distance between two strings is the minimum number of operations that are needed to transform one sting into the other. For a full implementation of the distance we would need to account for three different types of operations, removing a letter, adding a letter, or changing a letter.

For THIS program however, we are going to focus solely on the ability to change one letter to another. So, we will be thinking of changing one letter at a time, while maintaining the fact that the word is a still a valid word at all times.

So, for an example, the edit distance from "dog" to "cat" is 3. One possible path for this is

"dog" to "dot" to "cot" to cat"

Note, that there might be other paths, but they all involve at least 3 changes. Another longer example is from "witch" to "coven".

witch->watch->match->march->marcs->mares->mores->moves->coves->coven

You will be implementing a secondary class called LevenshteinFinder that will be used by the main program to solve the problem.

You are given a client program LevenDistanceFinder.java that does the file processing and user interaction. LevenDistanceFinder.java reads a dictionary text file as input and passes its entire contents to you as a list of strings. You are to write a class called LevenshteinFinder that will manage the actual work of finding the distance and the path.

The class will probably have the following necessary private fields:

  • Starting and Ending Strings

  • A map of words to a set of neighbors.

  • An integer distance that starts at -1.

  • A List of strings that is the path itself.

PUBLIC LEVENSHTEINFINDER(STRING, STRING, SET<STRING> )

Your constructor is passed a string which is the starting word of the path. A string that is the ending word of the path, and a collection of words as a set. It should use these values to initialize the class. The set of words will initially be all words from the dictionary.

You should throw an IllegalArgumentException if length of the two words is not the same.

You will want to store the starting and stopping words for later use, but you should not need to save the words list. First you will want to pull out only the words that are of the correct size. Then from this smaller list, what you will want to do is to create a map of words to their "neighbor" words. Start this by going through every word and add it and an empty set, to a map.

You will then go through the set a second time and check every word to every other word. If they are "neighbors" you will add each word to the set that goes with the other word. So if stringA and stringB are neigbors, then you add stringA to stringB's set, and vice versa.

Once the neighbor map is created, you will run the findDistacnce method and the findPath method to save those values for future delivery.

Note that this is all done in the constructor, so that all the work is done when it is “newed”/created.

PRIVATE INT DIFFERENTLETTERS(STRING A, STRING B)

This method should take two strings and find the number of letters that are different from each other and return that number.

PUBLIC INT GETDISTANCE()

This method is called by the main program to get the distance between the two words. Note that you found this in a different method. So this should just return a saved value. If it is longer than 2 lines, you are doing it wrong.

PUBLIC STRING GETPATH()

This method returns a string that is the path from the first word to the second word, assuming it exists. If the path distance is negative one, then return back an error message, if the path distance is zero or higher, then take the pathArray and convert it to a string with arrows in between.

Example: love->lave->late->hate

PRIVATE INT FINDDISTANCE(STRING A, STRING B)

This method finds the distance between two strings. (Note, only the distance, not the path itself). Start by creating two empty sets. Add the staring word to the second set. Set a counter to zero. Then while the sets are different sizes and the 2nd set does not contain the ending word, add everything from set 2 into set one, clear the 2nd set, and then take every word from set1 AND the neighbor of every word from set1 into set 2. Increment the loop counter.

When the loop finishes, if the 2nd set contains the final word return the counter because it was found, if the 2nd set doesn't contain the word, return -1 because there is no path.

PRIVATE VOID FINDPATH(STRING A, STRING B)

This method will find the path between two words. It should probably be the last method you work on. In fact I would create it, and have it do nothing until you are ready for it.

When running this method should only be run after findDistance() so that the distance has already been found and stored in a private int value.

When you are ready for it, this method should do the following.
Initialize the class path List to a new empty List.
Check the distance, if it is negative, store an error message in the path List and then exit the method. If the distance is zero or positive add the first element to the list.

Now in a loop that starts at the distance minus 1, and goes down until 1, look at the set of neighbors of the word in the last box of the list. Find one that has a distance to the ending word that matches the current loop counter. There may be multiples, but there has to be at least one. Find this word, and add it to the list.

Now repeat the loop until the for loop quits. Then add the ending word to the list. You are done.
Here is an example for the path from love -> hate.

The distance from love to hate is 3, so that is bigger than -1. So add love to the list. The list is now size one. Now start your loop from distance -1 (2) to 1. So i is currently 2. Find any word in the neighbor of love, that has a distance to hate of size 2. Use your findDistance method here!. One of those words is "lave". So add that to the array.

Next round, i is one. The list is now [love, lave]. So find a neighbor of "lave" that has a distance to "hate" of one. One possible word is "late". So add "late" to the list which now looks like [love, lave, late]

That should finish the loop, add "hate" to the list. The final list looks like [love, lave, late, hate]. Store that list in the class field. And you are done.

Your program should exactly reproduce the format and general behavior demonstrated on the previous pages.

You may assume that the list of words passed to your constructor will be a nonempty list of nonempty strings composed entirely of lowercase letters.

Use the TreeMaps, TreeSets and ArrayLists implementations for all of your ADT's.

HINTS

If you have not had to deal with exceptions before the proper way to throw and exception is the following: throw new IlleagalStateException() or IllegalArgumentEXception() as appropriate. This will end your method and return back to the primary program.

In: Computer Science

C++ Write a program that reads candidate names and numbers of votes in from a file....

C++

Write a program that reads candidate names and numbers of votes in from a file. You may assume that each candidate has a single word first name and a single word last name (although you do not have to make this assumption). Your program should read the candidates and the number of votes received into one or more dynamically allocated arrays.

In order to allocate the arrays you will need to know the number of records in the file. In order to determine the number of records in the file you may include the number as metadata in the first line of the file or you may read through the file to count the lines and then reset the file pointer back to the beginning of the file to read in the data. Do not hard code the number of candidates. Do not prompt the user to enter the number of candidates. You must either count the number of candidates in the file or encode the number as metadata as the first record in the file.

The program should output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. You may, but are not required to, use the example file provided.

In: Computer Science

Write a python program that does the following: Prompt for a file name of text words....

Write a python program that does the following:

Prompt for a file name of text words.
Words can be on many lines with multiple words per line.

Read the file and convert the words to a list.

Call a function you created called list_to_once_words(), that takes a list as an argument and returns a list that contains only words that occurred once in the file.

Print the results of the function with an appropriate description.

Think about everything you must do when working with a file.

No Example Output provided for this question.

In: Computer Science

Give the finite-state automaton and the regular grammar for the following: (a) (ab v ba)* v...

Give the finite-state automaton and the regular grammar for the following:

(a) (ab v ba)* v (ab)*

(b) (11*)*(110 v 01)

(c) All strings over {0,1} containing the string 010

(d) All strings over {0,1} which do not contain the string 010

In: Computer Science

i wish to solve the equations v'=v^3/3-w+i, w'=g(v+a-bw) with a=0.8, b=0.7, g=0.08, i=0.5 using ode45 in...

i wish to solve the equations v'=v^3/3-w+i, w'=g(v+a-bw) with a=0.8, b=0.7, g=0.08, i=0.5 using ode45 in matlab. i solved in on paper but i don't know how to type the codes in matlab.

i googled this but for one unfamiliar with the code, it is hard to fathom what they are solving i also would like the code to show the plots of both variables changing with time and the phase plots of both variables.

In: Computer Science

I need a program(code) in any programming language that performs the following operations: union, concatenation and...

I need a program(code) in any programming language that performs the following operations: union, concatenation and conversion DFA-NDFA.

In: Computer Science

The formula for calculating the amount of money in a savings account that begins with an...

The formula for calculating the amount of money in a savings account that begins with an initial principal value (P) and earns annual interest (i) for (n) years is: P(1 + i)n
Note that i is a decimal, not a percent interest rate: .1 NOT 10%

             Write a python program that does the following:

  • Prompt the user on three lines for principal, percent interest rate and number of years to invest (using descriptive prompts)
    • Use a while loop to keep prompting until entries are valid
  • Call your function calc_compound_interest() that:
    • takes the arguments principle, int_rate, years
    • uses the above formula to calculate the ending value of the account
    • returns the value
  • Call a second function calc_compound_interest_recursive() that:
    • takes the arguments principle, int_rate, years
    • calculates the value recursively – calling a base calculation over and over instead of using the number of year as an exponent.
    • return that value
  • Print both values with clear descriptions and formatted with thousand commas and 2 decimal places. Then print whether the two values are equal when rounded to 4 decimal places.


In: Computer Science