Click here to Skip to main content
15,900,906 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCString porble Pin
m1m22-Sep-07 9:18
m1m22-Sep-07 9:18 
QuestionRe: CString porble Pin
Mark Salsbery2-Sep-07 9:39
Mark Salsbery2-Sep-07 9:39 
AnswerRe: CString porble Pin
m1m22-Sep-07 10:37
m1m22-Sep-07 10:37 
AnswerRe: CString porble Pin
Jason Teagle2-Sep-07 22:58
Jason Teagle2-Sep-07 22:58 
QuestionHyperlink on WebBrowser Control Pin
vikrant kpr2-Sep-07 8:23
vikrant kpr2-Sep-07 8:23 
AnswerRe: Hyperlink on WebBrowser Control Pin
Gary R. Wheeler2-Sep-07 14:25
Gary R. Wheeler2-Sep-07 14:25 
QuestionUnicode string hash Pin
Bartosz Bien2-Sep-07 6:52
Bartosz Bien2-Sep-07 6:52 
AnswerRe: Unicode string hash Pin
cmk2-Sep-07 7:55
cmk2-Sep-07 7:55 
It looks similar to the djb2 hash.

I don't know why the lower case filter is there (*s >= 0x61 && *s < 0x7a) as it just filters out bit5 - never seen that done on a string hash before.

The lower-case filter isn't going to work in unicode as you don't know that the language will be english, however; if you really want to keep it try this:

int operator()(const wchar_t* s)
{
    int      h = 1048577;
    wchar_t  f = 0xdfdf,
             c = 0;

    while( *s ) {
        c = iswlower(*s) ? (*s & f) : *s;
        h = ((h << 5) + h) ^ c;
        ++s;
    }

    return h & (HASHSIZE - 1);
}


Not knowing how the 0xdf was chosen in the original i don't know if you should use 0xdfdf or 0x00df for f ... or something else entirely.


...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

Questioncurve length Pin
includeh102-Sep-07 6:14
includeh102-Sep-07 6:14 
AnswerRe: curve length Pin
Anurag Gandhi2-Sep-07 20:32
professionalAnurag Gandhi2-Sep-07 20:32 
AnswerRe: curve length Pin
Russell'3-Sep-07 1:16
Russell'3-Sep-07 1:16 
Questioncan you help me with a program that can do numerical methods? Pin
mitsui582-Sep-07 2:26
mitsui582-Sep-07 2:26 
AnswerRe: can you help me with a program that can do numerical methods? [modified] Pin
mitsui583-Sep-07 1:30
mitsui583-Sep-07 1:30 
QuestionCBitmapButton mouseover change bitmap? (vc++ 6.0) Pin
rolfhorror2-Sep-07 2:05
rolfhorror2-Sep-07 2:05 
AnswerRe: CBitmapButton mouseover change bitmap? (vc++ 6.0) Pin
Mark Salsbery2-Sep-07 9:50
Mark Salsbery2-Sep-07 9:50 
GeneralRe: CBitmapButton mouseover change bitmap? (vc++ 6.0) Pin
rolfhorror2-Sep-07 10:35
rolfhorror2-Sep-07 10:35 
QuestionI have a question about retrieve a window handle at mouse position. Pin
tmay_992-Sep-07 0:32
tmay_992-Sep-07 0:32 
AnswerRe: I have a question about retrieve a window handle at mouse position. Pin
bob169722-Sep-07 5:00
bob169722-Sep-07 5:00 
GeneralRe: I have a question about retrieve a window handle at mouse position. Pin
tmay_992-Sep-07 11:21
tmay_992-Sep-07 11:21 
GeneralRe: I have a question about retrieve a window handle at mouse position. Pin
bob169722-Sep-07 13:37
bob169722-Sep-07 13:37 
GeneralRe: I have a question about retrieve a window handle at mouse position. Pin
bob169722-Sep-07 13:41
bob169722-Sep-07 13:41 
GeneralRe: I have a question about retrieve a window handle at mouse position. Pin
bob169722-Sep-07 13:48
bob169722-Sep-07 13:48 
GeneralRe: I have a question about retrieve a window handle at mouse position. Pin
tmay_992-Sep-07 14:29
tmay_992-Sep-07 14:29 
QuestionProblems with the OEM/DOS Font "Terminal" in an RTF View Pin
CrocodileBuck1-Sep-07 23:22
CrocodileBuck1-Sep-07 23:22 
AnswerRe: Problems with the OEM/DOS Font "Terminal" in an RTF View Pin
CrocodileBuck1-Sep-07 23:41
CrocodileBuck1-Sep-07 23:41 

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.