Click here to Skip to main content
15,903,856 members

Bugs and Suggestions

   

General discussions, site bug reports and suggestions about the site.

For general questions check out the CodeProject FAQs. To report spam and abuse Head to the Spam and abuse watch. If you wish to report a bug privately, especially those related to security, please email webmaster@codeproject.com

 
Generalsearching Who's Who Pin
Luc Pattyn1-Dec-10 7:04
sitebuilderLuc Pattyn1-Dec-10 7:04 
GeneralRe: searching Who's Who Pin
Chris Maunder1-Dec-10 9:54
cofounderChris Maunder1-Dec-10 9:54 
GeneralRe: searching Who's Who Pin
Luc Pattyn1-Dec-10 10:05
sitebuilderLuc Pattyn1-Dec-10 10:05 
GeneralRe: searching Who's Who Pin
Chris Maunder1-Dec-10 11:25
cofounderChris Maunder1-Dec-10 11:25 
GeneralRe: searching Who's Who Pin
Luc Pattyn1-Dec-10 11:47
sitebuilderLuc Pattyn1-Dec-10 11:47 
GeneralRe: searching Who's Who Pin
Chris Maunder1-Dec-10 12:49
cofounderChris Maunder1-Dec-10 12:49 
GeneralRe: searching Who's Who Pin
Luc Pattyn1-Dec-10 13:50
sitebuilderLuc Pattyn1-Dec-10 13:50 
GeneralRe: searching Who's Who Pin
AspDotNetDev1-Dec-10 11:29
protectorAspDotNetDev1-Dec-10 11:29 
Sounds like an interesting challenge. Here is a recommendation for a custom data structure that would allow for quick partial-word matches.

Put all usernames into a tree. There are a few root nodes, one for each character that can be in a username. Each node in the tree builds a portion of a username. So, if you have "Bob", the tree would look like this:
B-+
  |
  O-+
    |
    B-+
      |
      [Data Associated With Bob]

Now, create a tree of partial names. For a username that is 3 letters long, there will be one main entry (in the above tree), and 2 entries in the partial tree:
O-+
  |
  B-+
    |
    [Pointer To Data Associated With Bob]
    [Poitner To Data Associated With Scrob]
B-+
  |
  [Pointer To Data Associated With Bob]
  [Pointer To Data Associated With Scrob]
  [Pointer To Data Associated With Bub]

For a partial-word search, you would look in the partial username tree. If somebody searched for ".ob", you'd look for a root node of "O", then find the "B" child, and find all pointer nodes to find the usernames that end with "ob". You'd also want to search subtrees to find names that contain "ob" followed by more letters. You'd probably want to make some lower limit... say, no fewer than 3 characters can be entered for a partial-name search. This "tree" could be implemented as part of a database. Accounting for typical username length and the number of users, the size of the data would probably be around 15,000,000 units (each unit being, say, 10 bytes).

There are probably better data structures for the more general case, but this would probably work well for short text snippets (as is the case with usernames).

GeneralRe: searching Who's Who Pin
Chris Maunder1-Dec-10 11:32
cofounderChris Maunder1-Dec-10 11:32 
GeneralRe: searching Who's Who Pin
Pete O'Hanlon1-Dec-10 11:37
mvePete O'Hanlon1-Dec-10 11:37 
GeneralRe: searching Who's Who Pin
Luc Pattyn1-Dec-10 12:32
sitebuilderLuc Pattyn1-Dec-10 12:32 
GeneralRe: searching Who's Who Pin
AspDotNetDev1-Dec-10 11:40
protectorAspDotNetDev1-Dec-10 11:40 
GeneralRe: searching Who's Who Pin
Chris Maunder1-Dec-10 12:50
cofounderChris Maunder1-Dec-10 12:50 
GeneralRe: searching Who's Who Pin
AspDotNetDev1-Dec-10 13:20
protectorAspDotNetDev1-Dec-10 13:20 
GeneralRe: searching Who's Who Pin
AspDotNetDev1-Dec-10 13:28
protectorAspDotNetDev1-Dec-10 13:28 
GeneralUser account [modified] Pin
Keith Barrow1-Dec-10 2:51
professionalKeith Barrow1-Dec-10 2:51 
GeneralRe: User account Pin
Nagy Vilmos1-Dec-10 3:14
professionalNagy Vilmos1-Dec-10 3:14 
GeneralRe: User account Pin
Luc Pattyn1-Dec-10 3:26
sitebuilderLuc Pattyn1-Dec-10 3:26 
GeneralRe: User account Pin
Dalek Dave1-Dec-10 3:53
professionalDalek Dave1-Dec-10 3:53 
GeneralRe: User account Pin
Dan Neely1-Dec-10 4:54
Dan Neely1-Dec-10 4:54 
GeneralRe: User account Pin
Luc Pattyn1-Dec-10 6:18
sitebuilderLuc Pattyn1-Dec-10 6:18 
GeneralRe: User account Pin
#realJSOP1-Dec-10 3:15
professional#realJSOP1-Dec-10 3:15 
GeneralRe: User account Pin
fjdiewornncalwe1-Dec-10 4:06
professionalfjdiewornncalwe1-Dec-10 4:06 
GeneralRe: User account Pin
Slacker0071-Dec-10 4:23
professionalSlacker0071-Dec-10 4:23 
GeneralRe: User account Pin
Chris Maunder1-Dec-10 23:54
cofounderChris Maunder1-Dec-10 23:54 

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.