Click here to Skip to main content
15,888,301 members
Home / Discussions / C#
   

C#

 
AnswerRe: background image for richtextbox like watermark Pin
Ravi Bhavnani26-Jul-10 2:00
professionalRavi Bhavnani26-Jul-10 2:00 
GeneralRe: background image for richtextbox like watermark Pin
mobasher26-Jul-10 2:50
mobasher26-Jul-10 2:50 
AnswerRe: background image for richtextbox like watermark Pin
Eddy Vluggen26-Jul-10 3:36
professionalEddy Vluggen26-Jul-10 3:36 
QuestionOn drawing rectangle how to scroll down the picture box? Pin
Nivas8226-Jul-10 0:30
Nivas8226-Jul-10 0:30 
Questionupdate panel in content page works just on first time click? Pin
220825-Jul-10 23:49
220825-Jul-10 23:49 
AnswerRe: update panel in content page works just on first time click? Pin
Jeroenh26-Jul-10 0:03
Jeroenh26-Jul-10 0:03 
GeneralRe: update panel in content page works just on first time click? Pin
220826-Jul-10 0:20
220826-Jul-10 0:20 
QuestionList of Lists, hashtable or a message stick? Pin
Ray Brand25-Jul-10 22:54
Ray Brand25-Jul-10 22:54 
Hi all,
I have sat on the sidelines reading all your posts for a long time now. Up until now I have managed to hack my way through my own solutions by trial and error and looking here but now, i am a little lost for a solution to my current problem. Here is what i want to do.

Using C#
I have a word table sorted in order of the 1000 most commonly used words in the English language.
I want to read in from a text file, such as an Ebook or the likes and for each word read, store the numeric value representing its position in the lookup table in a tree like structure. I dont want to repeat words in the same depth in the tree, but realise they will be repeated at a later depth in the tree.

As i read in each sentence from the file, i want to check from the existing entries in the tree to see if the word exists.
In the case of a new start to a sentence I want to create a new root node and build on it accordingly, in the case of the begginings of the sentence
already being stored I only want to branch when a new word (and thus a new possible sentence path) is found.
that way any random sentence in the book could be recreated by traversing the tree by following the correct branches to the final child node.
I thought using the lookup table and storing ints would be a little more resource friendly rather than strings of words for each element.

So saving the following sentences would look like this...

The Boy Fell In the Mud
The Boy Fell In the Sand
The Boy Fell In the Water
The Boy Got Up Quickly
The Boy Got Up Slowly
The Boy Got Up To a lot of Mischief
The Boy Got Up To no good
The Girl....
Once upon a time...

Stores 2 dimensionally like this

The-Boy-Fell-In-the-Mud
-------------------------Sand
-------------------------Water
------------Got-Up-Quickly
------------Got-Up-Slowly
----------------------To-a-lot-of-Mischief
----------------------To-no-good
The Girl...
Once Upon a time...

Now to the question, I have been trying this using lists of lists but boy it is getting muddy.
I had a look at just using arrays but could not really work out how to do this effectively.
Considered hashtables??
So the question is, how would you guys approach this, create a class of some sort, persevere with the list of lists.
I confess I am a little lost at this point.
Any suggestions would be greatly appreciated.
Thanks heaps
Ray
AnswerRe: List of Lists, hashtable or a message stick? Pin
Eddy Vluggen26-Jul-10 0:57
professionalEddy Vluggen26-Jul-10 0:57 
GeneralRe: List of Lists, hashtable or a message stick? Pin
Ray Brand26-Jul-10 1:03
Ray Brand26-Jul-10 1:03 
GeneralRe: List of Lists, hashtable or a message stick? Pin
Eddy Vluggen26-Jul-10 1:17
professionalEddy Vluggen26-Jul-10 1:17 
GeneralRe: List of Lists, hashtable or a message stick? Pin
Ray Brand26-Jul-10 4:52
Ray Brand26-Jul-10 4:52 
GeneralRe: List of Lists, hashtable or a message stick? Pin
Eddy Vluggen26-Jul-10 6:09
professionalEddy Vluggen26-Jul-10 6:09 
AnswerRe: List of Lists, hashtable or a message stick? Pin
PIEBALDconsult26-Jul-10 7:15
mvePIEBALDconsult26-Jul-10 7:15 
GeneralRe: List of Lists, hashtable or a message stick? Pin
Ray Brand27-Jul-10 3:24
Ray Brand27-Jul-10 3:24 
Questionhelp with GPS Pin
Gali197825-Jul-10 22:22
Gali197825-Jul-10 22:22 
AnswerRe: help with GPS Pin
Łukasz Nowakowski25-Jul-10 22:36
Łukasz Nowakowski25-Jul-10 22:36 
AnswerRe: help with GPS Pin
V.25-Jul-10 23:11
professionalV.25-Jul-10 23:11 
AnswerRe: help with GPS Pin
rahul.net1126-Jul-10 0:45
rahul.net1126-Jul-10 0:45 
AnswerRe: help with GPS [modified] Pin
William Ten Broek26-Jul-10 15:37
William Ten Broek26-Jul-10 15:37 
QuestionHow to uninstall previous version of msi package? [modified] Pin
rahul.net1125-Jul-10 20:35
rahul.net1125-Jul-10 20:35 
AnswerRe: How to uninstall previous version of msi package? Pin
souidi abderrahman27-Jul-10 22:00
souidi abderrahman27-Jul-10 22:00 
QuestionLightBox in Windows Application Pin
Krishna Varadharajan25-Jul-10 20:07
Krishna Varadharajan25-Jul-10 20:07 
AnswerRe: LightBox in Windows Application Pin
V.25-Jul-10 20:42
professionalV.25-Jul-10 20:42 
GeneralRe: LightBox in Windows Application Pin
Krishna Varadharajan25-Jul-10 20:53
Krishna Varadharajan25-Jul-10 20:53 

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.