Skip to main content
2 votes
Accepted

The predefined login function does not seem to be working in finance

Try any user with the password password. All users are created with that same password. This hashp = generate_password_hash("password") treats password as a string literal, because of the ". You ...
DinoCoderSaurus's user avatar
1 vote
Accepted

PSet5 Speller: Are we hashing the words in the dictionary into a hash table or the words of the text?

the purpose of the hash function is to calculate a hash value for a given word and return that value. Nothing more. The table[] array (or whatever you name it) is an array of pointers to the first ...
Cliff B's user avatar
  • 69.1k
1 vote
Accepted

PSET5 - 3 conceptual questions (debug not needed)

Q1: Is it possible? Yes, if you have software specializing in decription. Simple hash functions like encoding the first letter would be easy for systems designed to decode. Highly complex hashes? ...
Cliff B's user avatar
  • 69.1k
1 vote
Accepted

Speller skips first word in dictionary

I'm surprised there aren't more problems! Look at the following code: while ((ch = fgetc(d)) != EOF) { fscanf(d, "%s", dictword); The while statement scans the first letter ...
Cliff B's user avatar
  • 69.1k
1 vote
Accepted

Speller not working! What's going on?

First, since the global declarations and other code that comes at the top of the file weren't included, I've had to guess at some things to test the code. I suspect that sumstring, used in the hash ...
Cliff B's user avatar
  • 69.1k
1 vote
Accepted

PSet2 Crack: crypt() returning same hash

I'd say crypt works as expected, and is not the cause for your problem. Passing z or z_val does the same thing, as arrays are passed as a pointer to their first element. Same goes for returning o or ...
Blauelf's user avatar
  • 21k
1 vote
Accepted

Question about PSet 2 Crack

A couple of things, if your if condition returns 1 in case of error you don't need an else clause, this only complicates the code. In addition you should print the correct way to use the program, a ...
MARS's user avatar
  • 5,179
1 vote

pset1 always adding extra one space on each Hash row

You set height equal to four. This also sets j to four. See how this works on the first line: i = 0 by definition, so you print a " " every time j is above i and deduct one from j. You can repeat ...
O1G's user avatar
  • 31
1 vote
Accepted

Segmentation Fault on Hashtable

new->s=""; lets new->s point to an empty string stored in a read-only area. strcpy(new->s,val); then tries to write to that read-only area. You need writable memory associated to the ...
Blauelf's user avatar
  • 21k
1 vote
Accepted

PSet 5 Speller Compiles, but Not Producing Output

In your load function, you are created a new_node, adding it to your linked list, and then freeing it free(new_node);. You've just thrown away your node. You shouldn't free your nodes until you ...
curiouskiwi's user avatar
  • 18.7k
1 vote
Accepted

Problems with hash function in pset5

The code will return index % HASHSIZE;, but where is index calculated? Maybe index was supposed to be hash? If this answers your question, please click on the check mark to accept. Let's keep up on ...
Cliff B's user avatar
  • 69.1k

Only top scored, non community-wiki answers of a minimum length are eligible