Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thanks to you all!!! Pin
kingletas8-Dec-07 13:12
kingletas8-Dec-07 13:12 
GeneralRe: Thanks to you all!!! Pin
Xmen Real 7-Dec-07 14:46
professional Xmen Real 7-Dec-07 14:46 
QuestionComparing objects created in different threads Pin
mszwaya7-Dec-07 7:20
mszwaya7-Dec-07 7:20 
GeneralRe: Comparing objects created in different threads Pin
Ennis Ray Lynch, Jr.7-Dec-07 8:03
Ennis Ray Lynch, Jr.7-Dec-07 8:03 
GeneralRe: Comparing objects created in different threads Pin
Mark Churchill7-Dec-07 14:26
Mark Churchill7-Dec-07 14:26 
AnswerRe: Comparing objects created in different threads Pin
mszwaya10-Dec-07 4:46
mszwaya10-Dec-07 4:46 
Questionstring searching?? Pin
Small Rat7-Dec-07 6:59
Small Rat7-Dec-07 6:59 
GeneralRe: string searching?? Pin
Skippums7-Dec-07 9:53
Skippums7-Dec-07 9:53 
Do the following, where 'keyword' is the search string (must have length of at least 2 characters)and 'str' is the file string:
bool inAsp = false;
bool inATag = false;
List<int> matches  = new List<int>();
List<int> curGuess = new List<int>();
for (int i = 0; i < str.Length; ++i) {
    char c = str.CharAt(i);
    if (inAsp) {
        if (EndingAspTag)        // this is a pseudocode conditional
            inAsp = false;
        continue;
    } else if (inATag) {
        if (EndingATag)          // this is a pseudocode conditional
            inATag = false;
        continue;
    } else if (StartingAspTag) { // this is a pseudocode conditional
        curGuess.Clear();
        inAsp = true;
    } else if (StartingATag) {   // this is a pseudocode conditional
        curGuess.Clear();
        inATag = true;
    }
    for (int j = curGuess.Count - 1; j >= 0; --j) {
        if (c != keyword.CharAt(++curGuess[j]))
            curGuess.RemoveAt(j);
        else if (curGuess[j] == keyword.Length - 1) {
            matches.Add(i - curGuess[j]);
            curGuess.RemoveAt(j);
        }
    }
    if (c == keyword.CharAt(0))
        curGuess.Add(0);
}
for (int i = 1; i < matches.Count; ++i) {
    if (matches[i] - matches[i - 1] < keyword.Length)
        matches.RemoveAt(i--);
}
</int></int></int></int>
The code for the above conditions to check for entering or exiting an 'asp' or 'a' tag segment is non-trivial, as you also need to take into account whether you are within quotes, but you get the idea. This is also very inneficient, but it will work. Hope this helps,


-Jeff

GeneralRe: string searching?? Pin
pmarfleet7-Dec-07 10:40
pmarfleet7-Dec-07 10:40 
GeneralRe: string searching?? Pin
Pete O'Hanlon7-Dec-07 11:18
mvePete O'Hanlon7-Dec-07 11:18 
Generalevent for adding item in listbox Pin
Xmen Real 7-Dec-07 5:59
professional Xmen Real 7-Dec-07 5:59 
GeneralRe: event for adding item in listbox Pin
Anthony Mushrow7-Dec-07 6:22
professionalAnthony Mushrow7-Dec-07 6:22 
GeneralRe: event for adding item in listbox Pin
Xmen Real 7-Dec-07 14:42
professional Xmen Real 7-Dec-07 14:42 
Generaldatagridview cell colour Pin
arkiboys7-Dec-07 5:29
arkiboys7-Dec-07 5:29 
GeneralRe: datagridview cell colour Pin
Giorgi Dalakishvili7-Dec-07 5:44
mentorGiorgi Dalakishvili7-Dec-07 5:44 
Generalincrement by 1 Pin
eyeseetee7-Dec-07 4:41
eyeseetee7-Dec-07 4:41 
AnswerRe: increment by 1 Pin
Guffa7-Dec-07 4:51
Guffa7-Dec-07 4:51 
GeneralRe: increment by 1 Pin
eyeseetee7-Dec-07 4:58
eyeseetee7-Dec-07 4:58 
AnswerRe: increment by 1 Pin
Guffa7-Dec-07 5:04
Guffa7-Dec-07 5:04 
GeneralRe: increment by 1 Pin
eyeseetee7-Dec-07 5:10
eyeseetee7-Dec-07 5:10 
GeneralRe: increment by 1 Pin
Ian Shlasko7-Dec-07 5:21
Ian Shlasko7-Dec-07 5:21 
GeneralRe: increment by 1 Pin
eyeseetee7-Dec-07 5:26
eyeseetee7-Dec-07 5:26 
GeneralRe: increment by 1 Pin
Ian Shlasko7-Dec-07 5:41
Ian Shlasko7-Dec-07 5:41 
GeneralRe: increment by 1 Pin
eyeseetee7-Dec-07 6:26
eyeseetee7-Dec-07 6:26 
GeneralRe: increment by 1 Pin
Ian Shlasko7-Dec-07 7:27
Ian Shlasko7-Dec-07 7: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.