Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Standard C++ Library
On Wed, 2 Apr 2008 21:10:22 -0500, stan <smoore@exis.net> wrote:
 

>I'll go out on a limb here and guess that you're self taught. You might
>want to consider a course in algorithms if you're really interested in
>programming.

No thanks.

>You clearly seem concerned with appearances as evidenced by
>your taunts. You can't even imagine how much it would improve your
>standing with programmers if you could replace "doubt" and "guess"
>with a clear, correct, and concise analysis of an algorithm.

I already posted the reason why Hasmap is faster than sorted map in
this situation. I have tested both version.
 
>
>And your reading skills have already been clearly demonstrated.

By the way, I checked your posting history for this newsgroup. Other
than one post in "Best book" thread, all your posts are in the threads
started by me :)  How come?  Did I inspire you so much that you
started posting to this newsgroup regularly? Do you have a crush on
me?



Report this thread to moderator Post Follow-up to this message
Old Post
Razii
04-03-08 03:52 AM


Re: Standard C++ Library
In article <2lp7v3pqft8c5betsa8fg3lbu5t39k2qqa@4ax.com>,
Razii  <DONTwhatevere3e@hotmail.com> wrote:
>On 02 Apr 2008 14:44:59 GMT, ytrembla@nyx.nyx.net (Yannick Tremblay)
>wrote:
> 
>
>I doubt it's that easy to trigger worse case scenario. You will need
>to read hashing algorithm and then write a bible size book with
>specifically chosen data.

Regardless if it is easy or hard, if you are going to release software
in the wild, then you must make sure that a nasty character can't
destroy your application simply by looking up the Java Hash algorithm
and feeding it hand prepared data.  Read the history of buffer
overflow exploit to learn to what extend peoples will go to break
programs.

A lot of search/sort/hash algorithm have worse case scenario that are
maybe unlikely to be found naturally but rather easy to generate.
Some examples would be: already sorted data, almost already sorted
data, data sorted in reverse order.  Although random data is unlikely
to trigger any of the above, it is not that uncommonly found in the
wild and a good programmer must be aware of these potential problems
and protect his software against it.

So if you any real interest in algorithms, try pre-sorting your text
before attempting your test.

By the way, IMO, the best solution to your problem is:

$ sort bible.txt > sortedbible.txt

Using such an utility, generating somewhat sorted data is trivial.  e,g:

$ sort -r bible.txt > reversesortedbible.txt
$ sort bible.txt > doublesortedbible.txt && sort bible.txt >>
doublesortedbible.txt

Very very simple.










Report this thread to moderator Post Follow-up to this message
Old Post
Yannick Tremblay
04-03-08 11:17 AM


Sponsored Links




Last Thread Next Thread Next
Pages (3): « 1 2 [3]
Search this forum -> 
Post New Thread

C++ archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:48 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.