Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Oct 2003
    Posts
    242
    I am going to have a go at this one too.

  2. #12
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    Cool Im looking forward to seeing it
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  3. #13
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774

    Closed!

    OK, this challenge is now closed. I shall post my evaluations shortly.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  4. #14
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    I intended to post these this morning, but, it turns out that I cant view some entries from work, as a result it will need to wait now till this evening. Sorry
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  5. #15
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774

    Cool

    OK the results :

    There were a number of potential pitfalls you could stumble on the way of making this application:

    1. On asking for a file the user may have cancelled this by clicking cancel
    2. On asking for a file the file may not be accessible - eg something else has it locked.
    3. The file may not contain any words
    4. What would you do if the file were so big it couldnt be read into memory in 1 chunk?
    5. What if there arent 20 top words to display?
    6. Speed of word counting is not always the shortest code.
    7. Depending on your code, you could find yourselves prone to memory leaks.
    8. Not leaving loose ends so you can run it again and again.

    So.. how did you do?

    I confess I did not get back to people too much about errors in their code this week, because you should be looking to identify issues yourselves. For those of you I did get back to, it was more because there was a lacking in meeting the criteria.. For bigger projects I'd still assist but for such small projects you should be looking for these kinds of issues yourselves. So, while a lot of the "issues" reported may seem harsh, they are things I feel you should have been beginning to find on your own.

    Contenders were:

    BlueAura, fik, Oryde and VelariaKnight


    OK, time for the summaries:

    For those who didnt include a timer Ive added one and dumped the result in seconds to the caption bar of the main form (coz I didnt want to alter the actual app in any other way). I also added a report memory leaks on shutdown to each app, so we can see if they leak or not ..


    Im glad to see there was a lot of g00gling gone on to produce this one.

    Blues app:

    Blues project doesnt compile by default in turbo explorer which is a bummer.. and I guess I cant comment too much as I didnt specificy it as a requirement.. Bad me, however, for some reason, when the src is compiled on my PC (in either turbo having removed the line Application.MainFormOnTaskbar := True; or in 2007) the app didnt finish on checking a file.. Although the exe Blue sent me did complete (so weird it produces different exes), so I cant compile it with a timer in it to test it.. Although it might have something to do with the "invalid res file" it claimed.. although that would seem unlikely.

    Ah, it was how the thread was signaling the termination.. Having changed that.. and now added the timer.. OK thats better, although - dont click the analyze button twice !! :P (it barfs), it also doesnt handle well if the user clicks cancel on the open file button.

    Oh, and its insanely slow! sorry blue, the idea is really good though, and on a good point it reports no leaks!

    empty file handled as well as the no words.
    Windows.pas 192.6secs
    My backup file? No.. couldnt run that sorry.. I needed to go out!!

    VKs app:

    VK did a great icon, app looks way cool - far better than the rest of us, in fact, we should hang our heads in shame. However, it reports leaks on shutdown.. I also happened to notice it didnt get the same word counts as the rest of us, possibly because like someone else you assumed that something like aa3bb would be a word of aabb, not 2 words of aa and bb.

    It didnt handle an empty file or a file with no words.
    windows.pas = 28.6s
    my backup file = .. sorry didnt like to run it!

    Orydes app:

    Much like blues, it didnt handle the lack of opening file very well, in fact it crashes a few times and spews out a memory leak report, however, it does allow for repeated attempts at analysing files, and is pretty quick and chewed through
    my backup log file (25mb ish) in around 18.5seconds,
    windows.pas was 3.05s

    Reports leaks on shutdown though.. Good effort however.

    fiks app:

    Simple, effective and fast. Reports leaks on shutdown.

    windows.pas 3.09sec
    crashes on empty file
    worked fine on no words
    my backup file took 37.8seconds

    Mine took

    windows.pas 1.5s
    didnt crash on empty or no words
    my backup file took also 37.8 seconds although mine was slower to show the final output to window despite completion.

    As a result, fik and oryde came in very close, however, Oryde has to get it for processing my backup file so quick!
    Attached Files Attached Files
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  6. #16
    Join Date
    Jan 2007
    Posts
    640
    This frankly depresses me... 2 bombs in 2 challenges. These were supposed to be "easy" then I look at the December challenge and go "if I did this badly here..." You're right in that I didn't consider those thigns, which is stupid of me.

  7. #17
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    No, its not stupid, its just the lack of experience.

    When trying to do something "as fast as possible" its easy to trim just a shade too much and end up with nothing that doesnt quite work.. If you think of our discussion about the validation, if you applied that to each and every word to check no one had fiddled with it, and that it wasnt longer than x characters, or that it hadnt inadvertently been set to blank and and.. well it wouldnt be fast now would it?

    You put a lot of effort into it, and yes there were some pit falls and an empty file is one people are less likely to think of, after all, which dumb idiot would ask a 0byte file how many words were in it!! The answer is.. someoe would.. theres always one.

    If everything operated within acceptible means there would be no need for validation or testing of these things.

    My backup file was a good test for speed as with all due respect to the windows.pas file while its a healthy size, its not exactly stressing anything

    Dont feel down though, half the reason I picked the challenge was that there are a number of trips along the way, the challenge is simple enough to code, but there are some gottchas to avoid.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  8. #18
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    PS - I just spotted I made an oops in mine, it was a problem I had corrected in the one I wrote in my lunchbreak, but forgot to copy it to my HD before I compiled it.. sigh.

    for those wondering.. Put the words "this is a test" into a text file and run it against mine - it only lists's 3 top words.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  9. #19
    Join Date
    Oct 2003
    Posts
    242
    Well done Orydes.
    I hope someone else this time might show or post a link to their code. Would make these challenges a better learning experiance. Would be really interested to see how others tackled the problem.Else I haven't really learn't much more than i already know if you understand what I mean. Here is a link to my source:-
    http://www.myfilebin.com/userfiles/f...edystring2.zip

    Also find it very interesting that i get quite different timeing results from what Liz got. Yes I expected actual times to be different, but not the order of times!! I thought my system was quite low spec 2.5g P4 with only 512 MB ram on XP. Can only think it is the ram usage that makes this happen on mine as i have a relatively small amount.

  10. #20
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    Wouldnt explain it all as I ran them all on the same PC, one at a time.

    Im trying to get you guys to discuss your approaches but you dont.. so, rather than just post code, explaining why you did what you did is a good thing, as well as discussing the various pitfalls and what you'd thought of and what you hadnt

    There are next to no comments in anyones code to speak of, so it wouldnt help as much in the learning process as someone sitting down and explaining their approach, what drove them that way, the problems they had and overcame.. That would be truely useful.
    Last edited by LizKimber; 11-05-2007 at 05:15 PM.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •