JavaScript loading progress of an image

With this, you add 2 new functions on the Image() object: Image.prototype.load = function(url){ var thisImg = this; var xmlHTTP = new XMLHttpRequest(); xmlHTTP.open(‘GET’, url,true); xmlHTTP.responseType=”arraybuffer”; xmlHTTP.onload = function(e) { var blob = new Blob([this.response]); thisImg.src = window.URL.createObjectURL(blob); }; xmlHTTP.onprogress = function(e) { thisImg.completedPercentage = parseInt((e.loaded / e.total) * 100); }; xmlHTTP.onloadstart = function() { … Read more

Using Bash to display a progress indicator [duplicate]

In this example using SCP, I’m demonstrating how to grab the process id (pid) and then do something while that process is running. This displays a simple spinnng icon. /usr/bin/scp me@website.com:file somewhere 2>/dev/null & pid=$! # Process Id of the previous running command spin[0]=”-” spin[1]=”\\” spin[2]=”|” spin[3]=”https://stackoverflow.com/” echo -n “[copying] ${spin[0]}” while [ kill -0 … Read more

Hide progress of Invoke-WebRequest

Use the $progressPreference variable. It should have a value of ‘Continue’ by default unless you’ve edited it elsewhere, which tells Powershell to display the progress bar. Since you mentioned that you have your own custom progress displays, I would reset it immediately after the cmdlet is executed. For example: $ProgressPreference=”SilentlyContinue” # Subsequent calls do not … Read more

Progress bar in console application

I was also looking for a console progress bar. I didn’t find one that did what I needed, so I decided to roll my own. Click here for the source code (MIT License). Features: Works with redirected output If you redirect the output of a console application (e.g., Program.exe > myfile.txt), most implementations will crash … Read more

Text progress bar in terminal with block characters [closed]

Python 3 A Simple, Customizable Progress Bar Here’s an aggregate of many of the answers below that I use regularly (no imports required). Note: All code in this answer was created for Python 3; see end of answer to use this code with Python 2. # Print iterations progress def printProgressBar (iteration, total, prefix = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)