string search?

K

Keith Thompson

IMO, for the student accessibility of the content and the right 'pace'
are more important than 100% correctness.

There is no reason, and no excuse, for a tutorial not to be correct as
well as accessible and properly paced.
 
A

Andrew Poelstra

Your recommendations, on the other hand, I feel no need to check myself
for suitability. Your recommendation would be enough even if I did not
recognise who wrote the first tutorial from the URL.

Perhaps you should. I've never seen an error Richard Heathfield made
that someone else caught (with the exception of Keith Thompson, who
seems to see everything), simply because his clout in this group makes
everyone assume he's right.

I'm not suggesting that these links in particular are wrong, nor am I
suggesting that he makes errors on this group more than once in a blue
moon. I'm just saying that we should still be wary. ;-)
 
J

Joe Wright

Roland said:
IMO, for the student accessibility of the content and the right 'pace'
are more important than 100% correctness.

Best regards,
Roland Pibinger

I really don't understand you. Correctness takes precedence over
everything else in any sort of tutorial, surely.
 
F

Flash Gordon

Roland said:
IMO, for the student accessibility of the content and the right 'pace'
are more important than 100% correctness.

In my opinion, something that is just plain wrong is *far* worse than
nothing at all. The links that you posted have a lot that is just plain
wrong such as the things I pointed out. I did not have to go that far on
them to find enough problems to make them worse than useless.
 
F

Flash Gordon

Andrew said:
Perhaps you should. I've never seen an error Richard Heathfield made
that someone else caught (with the exception of Keith Thompson, who
seems to see everything), simply because his clout in this group makes
everyone assume he's right.

I agree completely with you and in general do my best to spot any errors
made by any of the regulars as well as names I don't recognise. One of
the good things about this group is that no matter how well respected
someone is if they make a mistake someone will point it out and the
better posters will accept the corrections.
I'm not suggesting that these links in particular are wrong, nor am I
suggesting that he makes errors on this group more than once in a blue
moon. I'm just saying that we should still be wary. ;-)

Indeed.
 
J

Jordan Abel

2006-11-02 said:
I really don't understand you. Correctness takes precedence over
everything else in any sort of tutorial, surely.

I'd say that simplification early on is okay (a tutorial on physics
could start with newtonian mechanics for example, despite the fact that
they are manifestly incorrect), but out-and-out _wrong_ information is
different. The line is hard to draw, though.
 
R

Richard Heathfield

Andrew Poelstra said:
Perhaps you should. I've never seen an error Richard Heathfield made
that someone else caught (with the exception of Keith Thompson, who
seems to see everything),

Not so. I've been corrected on very many occasions. Less so in recent years,
I suppose, but only because I don't make quite so many blunders as I used
to. But I still make 'em from time to time, and I still welcome corrections
when I do.
simply because his clout in this group makes everyone assume he's right.

That doesn't even apply to Chris Torek, who has far more "clout" in this
group than I do (and rightly so).
I'm not suggesting that these links in particular are wrong, nor am I
suggesting that he makes errors on this group more than once in a blue
moon. I'm just saying that we should still be wary. ;-)

Right! So... if you're wary (as you should be), go and look, and do the
usual check for the obvious screw-ups. I'd be surprised if you find any,
but use your own eyes, not mine. (I'd also be surprised if you *didn't*
find at least one non-obvious screw-up, if you spend long enough looking.
After all, everyone's human...)

One of the tutorials, incidentally, is by Steve Summit, who needs no
introduction. The other is by Tom Torfs, who was a longstanding member of
this group until he disappeared in mysterious circumstances after asking a
question about C99's changes to the preprocessor spec. Missing, presumed
writing a C99 compiler.
 
A

Andreas Kochenburger

Hello, Im working on a little LAN game in the style of old text-only
MUD's and would need to find a way to search for a string in a text
file (for example for usernames). I know it works in the way of looking
for the first letter, if matches the second and so on, but don't know
how to write it. Any suggestions?

Call a file filter or a perl script from within your C program.

Andreas
 
C

Charlton Wilbur

IMO, for the student accessibility of the content and the right 'pace'
are more important than 100% correctness.

If the information is incorrect -- as opposed to "we won't explain
this fully right now, but trust us, we'll get to it later" -- then the
accessibility of the content and the right pacing are completely
irrelevant.

Learn incorrect material now because it's easy, and spend a lot more
effort unlearning and relearning later, if you ever get that far.

Charlton
 
D

Default User

Andreas said:
Call a file filter or a perl script from within your C program.

Why would you deliberately introduce non-portable elements when they
aren't necessary?




Brian
 
B

Bertram Trabant

I'd like to thank everyone who helped (resp. argued), i found the bugs
in my code. They didn't have anything to do with the string, i just
wrote the conditions wrong, but anyways thanks for the effort.

(Now you can stop the flame war about tutorials:)
 
A

Andreas Kochenburger

Why would you deliberately introduce non-portable elements when they
aren't necessary?

Why are embedded interpreters - e.g. Lua - so useful ?



Andreas
 
C

cloverman

Hello, Im working on a little LAN game in the style of old text-only
MUD's and would need to find a way to search for a string in a text
file (for example for usernames). I know it works in the way of looking
for the first letter, if matches the second and so on, but don't know
how to write it. Any suggestions?
If your text file is a list of account details stored on disk, indexed
by user-name, and there are potentially many users, then it might be
better, and easier, to use a database such as SQL (MySQL is a free
version) (which might use an O(log n) b-tree or b+tree algorithm for
indexes - Knuth-Pratt-Morris algorithm is a linear algorithm O(n+m)
where n is the length of the file, and m is the length of the
search-string) - big O notation is a way that computer scientists
classify the efficiency of algorithms as n gets larger - the n in O(log
n) in b-tree or b+tree search which, if I have guessed right in your
case, is the number of accounts - a database using b-tree or b+tree
algorithm will be more efficient than linear string searching when n is
large (i.e. large number of accounts).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top