Click here to Skip to main content
15,900,815 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 940 Pin
OriginalGriff14-Jan-24 20:27
mveOriginalGriff14-Jan-24 20:27 
GeneralRe: Wordle 940 Pin
ChandraRam14-Jan-24 22:27
ChandraRam14-Jan-24 22:27 
GeneralRe: Wordle 940 Pin
Sander Rossel14-Jan-24 23:31
professionalSander Rossel14-Jan-24 23:31 
GeneralRe: Wordle 940 Pin
Cp-Coder15-Jan-24 1:44
Cp-Coder15-Jan-24 1:44 
GeneralUsing HASH Tables. Looking for general discussion on this topic. Pin
jmaida14-Jan-24 15:08
jmaida14-Jan-24 15:08 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Peter_in_278014-Jan-24 15:29
professionalPeter_in_278014-Jan-24 15:29 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida14-Jan-24 15:51
jmaida14-Jan-24 15:51 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Greg Utas14-Jan-24 18:54
professionalGreg Utas14-Jan-24 18:54 
After searching for a good hash for strings, I settled on the following:
C++
uint32_t string_hash(const char* s)
{
   uint64_t hash = 0;
   auto size = strlen(s);

   for(size_t i = 0; i < size; ++i)
   {
      hash = s[i] + (hash << 16) + (hash << 6) - hash;
   }

   return hash;
}
And then you truncate the result to be a valid index into your hash table.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.

GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 17:11
jmaida15-Jan-24 17:11 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Greg Utas15-Jan-24 19:04
professionalGreg Utas15-Jan-24 19:04 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida16-Jan-24 13:42
jmaida16-Jan-24 13:42 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
megaadam14-Jan-24 22:31
professionalmegaadam14-Jan-24 22:31 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
den2k8814-Jan-24 23:52
professionalden2k8814-Jan-24 23:52 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jschell15-Jan-24 4:58
jschell15-Jan-24 4:58 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 11:48
jmaida15-Jan-24 11:48 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
BernardIE531715-Jan-24 5:03
BernardIE531715-Jan-24 5:03 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 11:50
jmaida15-Jan-24 11:50 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 14:15
jmaida15-Jan-24 14:15 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jschell16-Jan-24 4:35
jschell16-Jan-24 4:35 
GeneralFound this on Reddit, and... Pin
Brisingr Aerowing14-Jan-24 14:19
professionalBrisingr Aerowing14-Jan-24 14:19 
GeneralRe: Found this on Reddit, and... Pin
trønderen14-Jan-24 16:13
trønderen14-Jan-24 16:13 
GeneralBalmy weather we're having Pin
k505414-Jan-24 4:44
mvek505414-Jan-24 4:44 
GeneralRe: Balmy weather we're having Pin
Gary Stachelski 202114-Jan-24 6:17
Gary Stachelski 202114-Jan-24 6:17 
GeneralRe: Balmy weather we're having Pin
Mike Hankey14-Jan-24 6:40
mveMike Hankey14-Jan-24 6:40 
GeneralRe: Balmy weather we're having Pin
0x01AA14-Jan-24 5:52
mve0x01AA14-Jan-24 5:52 

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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   494 votes