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

C#

 
AnswerRe: SQL Error converting data type varchar to numeric Pin
Pete O'Hanlon5-Nov-07 9:38
mvePete O'Hanlon5-Nov-07 9:38 
GeneralRe: SQL Error converting data type varchar to numeric Pin
ortaparmak5-Nov-07 11:41
ortaparmak5-Nov-07 11:41 
QuestionIs Regex faster? Pin
error14085-Nov-07 5:24
error14085-Nov-07 5:24 
AnswerRe: Is Regex faster? Pin
Ilya Verbitskiy5-Nov-07 5:29
Ilya Verbitskiy5-Nov-07 5:29 
AnswerRe: Is Regex faster? Pin
Colin Angus Mackay5-Nov-07 5:30
Colin Angus Mackay5-Nov-07 5:30 
AnswerRe: Is Regex faster? Pin
DavidNohejl5-Nov-07 5:48
DavidNohejl5-Nov-07 5:48 
AnswerRe: Is Regex faster? Pin
Pete O'Hanlon5-Nov-07 9:28
mvePete O'Hanlon5-Nov-07 9:28 
GeneralRe: Is Regex faster? Pin
error14085-Nov-07 21:53
error14085-Nov-07 21:53 
Ok i wrote a little app that compares the two methods.

I found out, that testing a file with 60000 lines 30 times took my pc about a second with this method:

<br />
using (StreamReader rIn = new StreamReader("test.txt"))<br />
            {<br />
                string line = "";<br />
                while ((line = rIn.ReadLine()) != null)<br />
                {<br />
                    if (line.Trim() == "{{{tcl")<br />
                    {<br />
                        return true;<br />
                    }<br />
                }<br />
                rIn.Close();<br />
<br />
            }<br />
            return false;<br />


and about 9 seconds with the regex:

<br />
using (StreamReader rIn = new StreamReader("test.txt"))<br />
            {<br />
                string line = "";<br />
                Regex reg = new Regex(@"\s*\{\{\{tcl\s*");<br />
                while ((line = rIn.ReadLine()) != null)<br />
                {<br />
                    if (reg.IsMatch(line))<br />
                    {<br />
                        return true;<br />
                    }<br />
                }<br />
                rIn.Close();<br />
            }<br />
            return false;<br />


Thats a BIG difference.
GeneralRe: Is Regex faster? Pin
Pete O'Hanlon5-Nov-07 23:16
mvePete O'Hanlon5-Nov-07 23:16 
QuestionWeb Service Client / Using Non-Passed In Parameters Pin
Jeremy A. Cunningham ~ AltTech5-Nov-07 5:18
Jeremy A. Cunningham ~ AltTech5-Nov-07 5:18 
AnswerRe: Web Service Client / Using Non-Passed In Parameters Pin
RedPhoenix.net5-Nov-07 6:31
RedPhoenix.net5-Nov-07 6:31 
GeneralRe: Web Service Client / Using Non-Passed In Parameters Pin
Jeremy A. Cunningham ~ AltTech5-Nov-07 6:40
Jeremy A. Cunningham ~ AltTech5-Nov-07 6:40 
AnswerRe: Web Service Client / Using Non-Passed In Parameters Pin
Ennis Ray Lynch, Jr.5-Nov-07 10:00
Ennis Ray Lynch, Jr.5-Nov-07 10:00 
GeneralRe: Web Service Client / Using Non-Passed In Parameters Pin
Jeremy A. Cunningham ~ AltTech6-Nov-07 4:47
Jeremy A. Cunningham ~ AltTech6-Nov-07 4:47 
GeneralRe: Web Service Client / Using Non-Passed In Parameters Pin
Ennis Ray Lynch, Jr.6-Nov-07 4:58
Ennis Ray Lynch, Jr.6-Nov-07 4:58 
GeneralRe: Web Service Client / Using Non-Passed In Parameters Pin
Jeremy A. Cunningham ~ AltTech8-Nov-07 1:58
Jeremy A. Cunningham ~ AltTech8-Nov-07 1:58 
GeneralRe: Web Service Client / Using Non-Passed In Parameters Pin
Ennis Ray Lynch, Jr.8-Nov-07 3:15
Ennis Ray Lynch, Jr.8-Nov-07 3:15 
QuestionN-Grandparent-Parent-Child Algorithm Pin
VarChar2555-Nov-07 5:08
VarChar2555-Nov-07 5:08 
AnswerRe: N-Grandparent-Parent-Child Algorithm Pin
Paddy Boyd5-Nov-07 5:21
Paddy Boyd5-Nov-07 5:21 
AnswerRe: N-Grandparent-Parent-Child Algorithm Pin
led mike5-Nov-07 5:21
led mike5-Nov-07 5:21 
AnswerRe: N-Grandparent-Parent-Child Algorithm Pin
Pete O'Hanlon5-Nov-07 9:24
mvePete O'Hanlon5-Nov-07 9:24 
GeneralRe: N-Grandparent-Parent-Child Algorithm Pin
VarChar2555-Nov-07 5:42
VarChar2555-Nov-07 5:42 
GeneralRe: N-Grandparent-Parent-Child Algorithm Pin
J4amieC5-Nov-07 5:56
J4amieC5-Nov-07 5:56 
GeneralRe: N-Grandparent-Parent-Child Algorithm Pin
VarChar2555-Nov-07 6:25
VarChar2555-Nov-07 6:25 
QuestionCompare Static variable and Session variable Pin
P.Murugs5-Nov-07 5:07
P.Murugs5-Nov-07 5:07 

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.