+ Post New Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 52
Scripts Thread, script to output every number in a sequence between x and y to a text file in Coding and Web Development; Originally Posted by Arthur On this occasion it looks like it's the opposite result. it worked fine for me, in ...
  1. #31


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by Arthur View Post
    On this occasion it looks like it's the opposite result.
    it worked fine for me, in 2min - see the post above

    did you do: python ./test > output ?

    I'm using python 2.6

  2. #32


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,155
    Thank Post
    234
    Thanked 2,742 Times in 2,021 Posts
    Rep Power
    801
    Python didn't work for me. Same issue as Rabbie I think. Could be user error though.



    I'm using Python v2.7.3 on Windows 7 (both 64-bit).

    Code:
    #!c:/python27/python.exe -u
    count = 400000000
    while count <= 499999999:
        count = count + 1
    print '0%s' % (count)
    Last edited by Arthur; 30th June 2012 at 06:15 PM.

  3. #33

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,705
    Thank Post
    335
    Thanked 517 Times in 485 Posts
    Rep Power
    180
    Quote Originally Posted by Arthur View Post
    Python didn't work for me. Same issue as Rabbie I think. Could be user error though.



    I'm using Python v2.7.3 on Windows 7 (both 64-bit).

    Code:
    #!c:/python27/python.exe -u
    count = 400000000
    while count <= 499999999:
        count = count + 1
    print '0%s' % (count)
    THat's because your script is wrong.

    Tabs in python are same as brackets. So you've got the print line outside the brackets.

    Tab it across one and it should print it.

    e.g.

    Code:
    count = 400000000
    while count <= 499999999:
        count = count + 1
        print '0%s' % (count)
    0400000002
    >>> ================================ RESTART ================================
    >>>
    0400000001
    0400000002
    0400000003
    0400000004
    0400000005
    0400000006
    0400000007
    0400000008
    0400000009
    0400000010
    0400000011
    >>>
    etc

    Steve

  4. 2 Thanks to Steve21:

    Arthur (30th June 2012), RabbieBurns (30th June 2012)

  5. #34


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,155
    Thank Post
    234
    Thanked 2,742 Times in 2,021 Posts
    Rep Power
    801
    Quote Originally Posted by Steve21 View Post
    That's because your script is wrong.
    Thanks Steve! It's working now.

    I blame CyberNerd for not using the proper CODE tags.

  6. 2 Thanks to Arthur:

    mac_shinobi (30th June 2012), SYNACK (2nd July 2012)

  7. #35

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,705
    Thank Post
    335
    Thanked 517 Times in 485 Posts
    Rep Power
    180
    Quote Originally Posted by Arthur View Post
    Thanks Steve! It's working now.

    I blame CyberNerd for not using the proper CODE tags.
    Spent many a hour at uni trying to work out why my project wasn't working only to realise it's just pythons stupidty in things like the tabs

    Steve

  8. #36


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    it just didn't paste properly

  9. #37


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,155
    Thank Post
    234
    Thanked 2,742 Times in 2,021 Posts
    Rep Power
    801
    Quote Originally Posted by CyberNerd View Post
    it just didn't paste properly
    The tabs aren't displayed in your post.

  10. #38


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by Arthur View Post
    The tabs aren't displayed in your post.
    It seems to show up ok if it wrap it in a [code] tag. but not just pasting. strange.

    i fixed it now
    Last edited by CyberNerd; 30th June 2012 at 07:27 PM.

  11. #39

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,850
    Thank Post
    3,367
    Thanked 1,062 Times in 982 Posts
    Rep Power
    366
    Quote Originally Posted by Arthur View Post
    The tabs aren't displayed in your post.
    Who needs to use the source when you can use the tab - or does the tab only work at the bar ?

  12. #40

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740
    Quote Originally Posted by RabbieBurns View Post
    1.2GB text file compresses into a 13MB rar file.. wow.
    Would be interesting to see the size if it were a Max compressed .arj
    Reason being is that I'm scripting some massive folders using 7zip.
    Last edited by mattx; 30th June 2012 at 11:40 PM.

  13. #41


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,155
    Thank Post
    234
    Thanked 2,742 Times in 2,021 Posts
    Rep Power
    801
    Quote Originally Posted by RabbieBurns View Post
    1.2GB text file compresses into a 13MB rar file.. wow.
    Quote Originally Posted by mattx View Post
    Would be interesting to see the size if it were a max compressed .arj
    Here you are @mattx...

    Code:
    -------------------------------------------------------
    Format                Size (Bytes)     Compression Time
    -------------------------------------------------------
    PAQ8O (-7)                 612,210             13:53:08
    KGB (-a7 -m9)              755,500             03:57:54
    ACE                      2,032,579             00:00:45
    7-Zip (LZMA*)           11,145,528             00:09:14
    7-Zip (LZMA2*)          11,259,540             00:05:12
    RAR                     13,429,575             00:00:16
    ARC                     14,600,448             00:05:02
    XZ                      15,519,312             00:02:33
    BZip2                   91,689,039             00:04:49
    GZip                   123,841,059             00:08:08
    Zip                    123,841,185             00:08:03
    7-Zip (PPMd)           161,275,089             00:01:39
    LZH                    200,546,065             00:04:33
    ARJ (-jm)              220,298,941             00:00:46
    PEA                    235,515,251             00:01:28
    NTFS                   375,001,088             00:00:13
    -------------------------------------------------------
    Original:            1,200,000,000             00:03:56 **
    -------------------------------------------------------
    
    * Dictionary Size: 96MB / Word Size: 256 / Block Size: 4GB
    ** Creation time
    As you can see from the file sizes above, ARJ isn't that great (at least in this particularly case with Rabbie's text file). PAQ, KGB and ACE are the clear winners in terms of size, although 7-Zip is still pretty good epecially when using LZMA2 for the compression method since it can use every processor core in your PC to speed up compression (like WinRAR). ACE has the best file size to compression time ratio, although it could just be extremely good at quickly compressing sequential numbers.
    Last edited by Arthur; 2nd July 2012 at 05:28 AM.

  14. Thanks to Arthur from:

    mattx (2nd July 2012)

  15. #42

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,682
    Thank Post
    692
    Thanked 1,408 Times in 1,166 Posts
    Rep Power
    354
    Now the Geekiness is over, what are you going to do with all those numbers?

  16. #43

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740
    That's fantastic - the sort of thing I would love to do if I had the time !!

    Quote Originally Posted by Arthur View Post
    Here you are @mattx...

    Code:
    -------------------------------------------------------
    Format                Size (Bytes)     Compression Time
    -------------------------------------------------------
    PAQ8O (-7)                 612,210             13:53:08
    KGB (-a7 -m9)              755,500             03:57:54
    ACE                      2,032,579             00:00:45
    7-Zip (LZMA*)           11,145,528             00:09:14
    7-Zip (LZMA2*)          11,259,540             00:05:12
    RAR                     13,429,575             00:00:16
    ARC                     14,600,448             00:05:02
    XZ                      15,519,312             00:02:33
    BZip2                   91,689,039             00:04:49
    GZip                   123,841,059             00:08:08
    Zip                    123,841,185             00:08:03
    7-Zip (PPMd)           161,275,089             00:01:39
    LZH                    200,546,065             00:04:33
    ARJ (-jm)              220,298,941             00:00:46
    PEA                    235,515,251             00:01:28
    NTFS                   375,001,088             00:00:13
    -------------------------------------------------------
    Original:            1,200,000,000             00:03:56 **
    -------------------------------------------------------
    
    * Dictionary Size: 96MB / Word Size: 256 / Block Size: 4GB
    ** Creation time
    As you can see from the file sizes above, ARJ isn't that great (at least in this particularly case with Rabbie's text file). PAQ, KGB and ACE are the clear winners in terms of size, although 7-Zip is still pretty good epecially when using LZMA2 for the compression method since it can use every processor core in your PC to speed up compression (like WinRAR). ACE has the best file size to compression time ratio, although it could just be extremely good at quickly compressing sequential numbers.

  17. #44

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,850
    Thank Post
    3,367
    Thanked 1,062 Times in 982 Posts
    Rep Power
    366
    Quote Originally Posted by Arthur View Post
    Only took me 3 minutes 56 seconds.

    * My PC has a Core i5-2500K @ 4.6GHz, 16GB RAM and a 256GB SSD.
    Which SSD do you have in your pc ?

  18. #45


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Originally Posted by Arthur
    Only took me 3 minutes 56 seconds.

    * My PC has a Core i5-2500K @ 4.6GHz, 16GB RAM and a 256GB SSD.
    out of interest, how long did it take to run the python script on that beast?

    my work machine managed
    real 1m3.992s
    user 1m3.080s
    sys 0m0.880s

    on Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz

  19. Thanks to CyberNerd from:

    mac_shinobi (2nd July 2012)

SHARE:
+ Post New Thread
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Program or Script to add URLS to a URL sets in ISA server.
    By FN-GM in forum Internet Related/Filtering/Firewall
    Replies: 9
    Last Post: 3rd July 2009, 06:44 PM
  2. terminal script to create home dirs in OS X
    By HodgeHi in forum Coding
    Replies: 6
    Last Post: 3rd July 2009, 10:13 AM
  3. Replies: 6
    Last Post: 16th September 2006, 09:33 PM
  4. Script to change user email in AD (or Exchange)
    By SpuffMonkey in forum Scripts
    Replies: 16
    Last Post: 8th November 2005, 10:31 PM
  5. Script to shut down computers in a certain OU
    By tosca925 in forum Scripts
    Replies: 11
    Last Post: 25th September 2005, 09:23 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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