Community Page
- elliottback.com/wp/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- did you do at moto photo or the passport photo service???I am in need for canadian passport photo and I live near washington dc...
- Hi, Worked for years, but today requires a new activation.... serial number 1045 1557 0885 5951 0032 1070 Activation Code 7067 3221 8552 6937 3433 2427 0144 3945 Activation Type: Repair 93:13 Many...
- Hi Susan, My mother lives in Colorado Springs and is about to undergo the Canadian passport routine. Did you find a place in the Springs for Canadian passport pictures?
- PHOENIX, ARIZONA For anyone in the PHOENIX metropolitan area who is looking for Canadian passport photos, I urge you to go to Hassan Photography. They were recommended by the Canadian Consulate in...
- Ok so after having my photo rejected i turned to the interwebz to find a location that does passport photos and the person behind the counter dosnt look at you like a monkey doing a math problem...
4 years ago
4 years ago
/* Other blocks */
map_t blocks;
};
typedef struct minifile* minifile_t;
...
// Allocate a file
file = (minifile_t) malloc(sizeof(struct minifile));
if(!file) return NULL;
// Initialize blocks
file->blocks = hashmap_new();
if (!file->blocks) return NULL;
...
/* Get blocks */
for(i = 0; i < num_blocks; i++){
int *temp = (int *) malloc(sizeof(1));
*temp = *inode; inode++;
if(hashmap_put(file->blocks, hashmap_length(file->blocks), temp) != MAP_OK)
return NULL;
}
4 years ago
4 years ago
Can we store any type of variable e.g. struture as a value ?
If yes how can I retrieve the values from the hash map.
The hashmap_get is returning me junk values.I would appreciate a code sample.
4 years ago
hashmap_put(map_t in, int key, any_t value)
method. You can think of any_t as an alias for void *: it's defined in the header somewhere, So, you'd call:
If s is already a pointer type, just call:
To get something out of the datastructure, again just pass a pointer:
Don't forget to check the return values! All the hashmap methods should return a constant indicating success.
4 years ago
I think the solution to this is to store even the key values ("abc" or "xyz" ) in the structure hash_element, so that we can compare this while inserting and this must be unique.
4 years ago
3 years ago
Thanks
3 years ago
2 years ago
The code looks good and also easly usable but the 2 include files are needed to you this code and hence makes it un-useable. pls provide me those include files as soon as possible.
Thanks
Sunil
2 years ago
2 years ago
2 years ago
2 years ago
i find this project very interesting. thanks a lot Elliot. But i need the file sync.h. can you provide it to me please.
regards
2 years ago
2 years ago
I will post my code in my blog latter tonight.
The basic idea is that:
1. hashmap_get should exit at the first encouter with an empty slot. Or else it will loop through all elements at a miss.
2. hashmap_remove should rehash the elements between the deleted element and the first empty slot after it.
3. table_size should always be two times bigger than size.
This will ensure that there will always be a empty slot not too far way. This will make hashmap_get and hashmap_remove 20 times faster in my case.
4. some other bug fixes.
1 year ago
1 year ago
1 year ago
1 year ago
Thanks for this posting of the code. I was wondering if you could send me the include files so that I get the fully functional code. As part of my project, I am doing a study of some of the implementations for hash table for space consumption check.
Thanks.
Regards,
Kajal
1 year ago
I find the code useful..
Could you please forward me the include file so that i can do some modifications to it to serve my purpose.
Thanks...
Vikas
5 months ago