Click here to Skip to main content
15,892,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Converting try/catch to __try/something Pin
toxcct27-Oct-05 7:43
toxcct27-Oct-05 7:43 
GeneralRe: Converting try/catch to __try/something Pin
integerous27-Oct-05 12:57
integerous27-Oct-05 12:57 
QuestionSecure IPC Pin
Chintoo72327-Oct-05 5:59
Chintoo72327-Oct-05 5:59 
AnswerRe: Secure IPC Pin
ThatsAlok27-Oct-05 22:25
ThatsAlok27-Oct-05 22:25 
QuestionWhat's this? Pin
Le Sourcier27-Oct-05 5:41
Le Sourcier27-Oct-05 5:41 
Question Hash string function that keeps compare properties Pin
Kochise27-Oct-05 5:27
Kochise27-Oct-05 5:27 
AnswerRe: Hash string function that keeps compare properties Pin
Chris Losinger27-Oct-05 7:30
professionalChris Losinger27-Oct-05 7:30 
GeneralRe: Hash string function that keeps compare properties Pin
Kochise27-Oct-05 21:17
Kochise27-Oct-05 21:17 
Nadanada, I'm not willing to 'compress' a string in an integer, and restore the string from the integer afterward. What I just want is to help my sorting routines by feeding it with fixed size integer the CPU could handle very easily, not variable length strings...

Currently, I'm feeding a custom string tree. All strings are stacked as-is, and I used the HASH value as node's key. Even if they are mostly 'random', strings are inserted 'as-is' from their hash value. It works. I can even search for a particular string, it's hash value is found in the tree.

The problem occurs when I'm trying to sort the tree, or at least walk it in a ascendant or descendant way. What I get is hash values from the minus one to the maximum one. But their corresponding string is non-sense, they don't follow the ascending or descending order I'm trying to get.

Yeap, I found some pages on Google about hash functions :

http://www.partow.net/programming/hashfunctions/
http://www.isthe.com/chongo/tech/comp/fnv/
http://www.cs.rice.edu/~scrosby/hash/

But none helped me in what I was trying to get. I can accept a little level of collision, because I know and control the input. And even if I get the same hash match, I can always control the two strings with a good old compare. At least I saved the whole tree walking which was processed in hash integer comparaison.

So thanks at least to having helped me to loose focus on the 'hash trick', as this won't evolve in a success. I will try another method to sort out my strings using an integer.

Kochise

In Code we trust !

-- modified at 3:18 Friday 28th October, 2005
GeneralRe: Hash string function that keeps compare properties Pin
Chris Losinger28-Oct-05 1:17
professionalChris Losinger28-Oct-05 1:17 
GeneralRe: Hash string function that keeps compare properties Pin
Kochise28-Oct-05 3:06
Kochise28-Oct-05 3:06 
QuestionHow to pass a parm to iexplorer? Pin
mcgahanfl27-Oct-05 5:24
mcgahanfl27-Oct-05 5:24 
AnswerRe: How to pass a parm to iexplorer? Pin
BlackT27-Oct-05 5:29
BlackT27-Oct-05 5:29 
QuestionText Rotation - VC 6.0 Pin
BlackT27-Oct-05 4:17
BlackT27-Oct-05 4:17 
AnswerRe: Text Rotation - VC 6.0 Pin
Mircea Puiu27-Oct-05 7:23
Mircea Puiu27-Oct-05 7:23 
Questionquestion with the MFC documentation Pin
ewighell27-Oct-05 3:39
ewighell27-Oct-05 3:39 
AnswerRe: question with the MFC documentation Pin
Maximilien27-Oct-05 3:52
Maximilien27-Oct-05 3:52 
AnswerRe: question with the MFC documentation Pin
Chris Losinger27-Oct-05 3:55
professionalChris Losinger27-Oct-05 3:55 
AnswerRe: question with the MFC documentation Pin
toxcct27-Oct-05 3:58
toxcct27-Oct-05 3:58 
QuestionRe: question with the MFC documentation Pin
David Crow27-Oct-05 4:49
David Crow27-Oct-05 4:49 
AnswerRe: question with the MFC documentation Pin
ewighell27-Oct-05 5:02
ewighell27-Oct-05 5:02 
AnswerRe: question with the MFC documentation Pin
ewighell27-Oct-05 5:05
ewighell27-Oct-05 5:05 
QuestionHow to kill a thread ??? Pin
vikas amin27-Oct-05 2:21
vikas amin27-Oct-05 2:21 
AnswerRe: How to kill a thread ??? Pin
David Crow27-Oct-05 2:32
David Crow27-Oct-05 2:32 
AnswerRe: How to kill a thread ??? Pin
ThatsAlok27-Oct-05 22:40
ThatsAlok27-Oct-05 22:40 
QuestionWritePrinter API seems Good but Behave Difficult Pin
AsimUmair27-Oct-05 1:27
AsimUmair27-Oct-05 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.