Top 10 reads of June 2014

these are the top 10 reads of June 2014.

  • How to unzip a zip file in PHP
  • How to load image from web asynchron into picturebox in C# and VB.NET
  • How to toggle a text using jQuery
  • How to scroll to the top of the page in javascript
  • How to copy a table in MySQL
  • How to scroll to the top of the page in jQuery
  • How to check if a number is even in javascript
  • How to use a favicon in HTML
  • How to get the IP Address in Javascript
  • How to check if a userAgent is a mobile device in jQuery
  • thanks to all visitors, bookmark us, share us, talk about us, Follow us!, let’s grow bigger!

    Please rate this snippet

    How to format bytes to human readable Size in Python

    To format bytes to human readable Size in Python you can use the following snippet.

    Sample Python

    fileSize = 12454162221
    for count in ['Bytes','KB','MB','GB']:
        if fileSize > -1024.0 and fileSize < 1024.0:
            print "%3.1f%s" % (fileSize, count)
        fileSize /= 1024.0
    print "%3.1f%s" % (fileSize, 'TB')
    

    Please rate this snippet