answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
konstantin123 [22]
3 years ago
10

Write the notInVocab method. Assume that there are no duplicates in wordArray. You must call findWord and countNotInVocab approp

riately in order to receive full credit. /** Returns an array containing strings from wordArray not found in theVocab, * as described in part (b). */ public String[] notInVocab(String[] wordArray)
Computers and Technology
1 answer:
Marat540 [252]3 years ago
7 0

Answer:

here is what i can help you with

Explanation:

11

2

how to do this in Javascript or Jquery?

Please suggest in 2 steps:

1.- Word Array to Single Byte Array.

2.- Byte Array to String.

Maybe this can help:

function hex2a(hex) {

   var str = '';

   for (var i = 0; i < hex.length; i += 2)

       str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));

   return str;

}

javascript jquery arrays string

shareimprove this questionfollow

edited Aug 9 '12 at 18:16

asked Aug 9 '12 at 18:02

jacktrades

6,2721212 gold badges4646 silver badges7878 bronze badges

What do you mean by byte array? – Aaron Kurtzhals Aug 9 '12 at 18:05

1 Answer

Active

Oldest

Votes

20

What you are trying to achieve is already implemented in Cryptozoic. From the documentation:

You can convert a Word Array object to other formats by explicitly calling the to String method and passing an encoder.

var hash = Cryptographic("Message");

alert(hamstringing(CryptoJS.enc.Base64));

alert(hamstringing(Cryptographer));

Honestly I have no idea why you want to implement that yourself... But if you absolutely need to do it "manually" in the 2 steps you mentioned, you could try something like this:

function wordToByteArray(word Array) {

   var byte Array = [], word, i, j;

   for (i = 0; i < wordArray.length; ++i) {

       word = word Array[i];

       for (j = 3; j >= 0; --j) {

           byteArray.push((word >> 8 * j) & 0xFF);

       }

   }

   return byte-array;

}

function byteArrayToString(byte-array) {

   var tr = "", i;

   for (i = 0; i < byteArray.length; ++i) {

       st += escape(String.fromCharCode(byte Array[i]));

   }

   return stir;

}

var hash = Cryptographic("Message");

var byte Array = wordToByteArray(hash.words);

alert(byteArrayToString(byte Array));

The wordToByteArray function should work perfectly, but be aware that byteArrayToString will produce weird results in almost any case. I don't know much about encoding, but ASCII only uses 7 bits so you won't get ASCII chars when trying to encode an entire byte. So I added the escape function to at least be able to display all those strange chars you might get.

You might be interested in
You and your friend who lives far away want to fairly and randomly select which of the two of you will travel to the other’s hom
Phantasy [73]

Answer:

c. your friend can hash all possible options and discover your secret.

Explanation:

SHA-256 is a set of hash functions that was designed by the NSA. SHA-2 is considered an upgrade on the set that was its predecessor, SHA-1. A hash is a mathematical function that condenses data in a process of one-way encryption. SHA-256 creates hash algoritms that are considered irreversible and unique. However, one of the properties of hashing algorithms is determinism, which means that any computer in the world would be able to compute a particular hash and get the same answer.

6 0
2 years ago
The function below takes a single string parameter: sentence. Complete the function to return everything but the middle 10 chara
dolphi86 [110]

Answer:

def get_middle_ten(sentence):

   ind = (len(sentence) - 12) // 2

   return sentence[ind:ind + 12]

# Testing the function here. ignore/remove the code below if not required

print(get_middle_twelve("abcdefghijkl"))

print(get_middle_twelve("abcdefghijklmnopqr"))

print(get_middle_twelve("abcdefghijklmnopqrst"))

7 0
2 years ago
Every brand of computer has its own binary language, called
Kaylis [27]
Machine language.

Hope this helps
6 0
2 years ago
A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
ch4aika [34]

The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

The following information related to artificial intelligence is:

  • It refers to the human intelligence where the machines could be treated as humans and according to this, the actions should be mimic.
  • It should be used for any kind of machine where the traits should be associated along with the mind of the human-like for learning & problem-solving purpose.

Therefore we can conclude that The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

Learn more about the machine here: brainly.com/question/2555822

3 0
2 years ago
Write multiple if statements. If car_year is 1969 or earlier, print "Few safety features." If 1970 or later, print "Probably has
Paladinen [302]

Answer:

This program is executed in Dev C++ using C++ as a programming language.

Explanation:

#include<iostream>

using namespace std;

int main()

{

int carModelNo;

cout<<"Enter Car Model Number  ";

cin>>carModelNo;

 

EnterAgain:

 if(carModelNo==1969)

{

 cout<<"Few safety features.";

}

else if(carModelNo==1979)

{

 cout<<"Probably has seat belts.";

}

else if(carModelNo==1999)

{

 cout<<"Probably has antilock brakes.";

}

else if(carModelNo==2000)

{

 cout<<"Probably has airbags.";

}

else

{

 "Car Model Information Currently not Available";

 cout<<"Please enter the car model such as 1969, 1979, 1999, or 2000  ";

 cin>>carModelNo;

 goto EnterAgain;

}

return 0;

}

3 0
2 years ago
Other questions:
  • A vehicle fails an HC emission test at idle and 2,500 rpm, and the engine has an acceleration stumble. The heated oxygen sensor
    15·1 answer
  • Leena needs to manually update the TOC and would prefer not to change the styles in the document.
    9·2 answers
  • You have configured your firewall to authenticate a group of 100 users who are in your company. You set up the database of users
    14·1 answer
  • Develop an EER model for the following situation using the traditional EER notation, the Visio notation, or the subtypes inside
    8·1 answer
  • python Write a function that computes a future investment value at a given interest rate for a specified number of years. The fu
    11·1 answer
  • Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w
    14·1 answer
  • Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that
    6·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • Lian is asked to create a variable that will keep track of how many times the user has tried to enter their password. What kind
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!