Indicate progress for a number and total.

@param number The current number
@param total  The total number
323227
@Override
    public void indicateProgress(int number, int total) {
        progressIndicatorActive = true;
        String currMsg = lastMessage;
        try {
            updateStatus(currMsg + ' ' + number + " of " + total);
        } finally {
            lastMessage = currMsg;
        }
    }
1111312
private void setNumbers(int number, ArrayList numbers) {
        this.numbers = new ArrayList();
        this.numbers.add(Integer.valueOf(number));
        this.numbers.addAll(numbers);
    }
958501
function (total) {
            this._enabled = true;
            this._stream = false;
            this.addParticles((typeof total === "number") ? total : this.totalParticles);
            this._enabled = false;
        }
311510
void progress(int cur, int max) {
    StringBuilder out = new StringBuilder();

    if (lastProgress != null) {
      char[] back = new char[lastProgress.length()];
      Arrays.fill(back, '\b');
      out.append(back);
    }

    String progress =
        cur + "/" + (max == -1 ? "?" : "" + max) + " "
            + (max == -1 ? "(??%)"
            : "(" + cur * 100 / (max == 0 ? 1 : max) + "%)");

    if (cur >= max && max != -1) {
      progress += " " + loc("done") + SEPARATOR;
      lastProgress = null;
    } else {
      lastProgress = progress;
    }

    out.append(progress);

    getOutputStream().print(out.toString());
    getOutputStream().flush();
  }
1095885
private void _advance(int count) {
        if (buf != null) {
            bufPos += count;
            if (bufPos == buf.length) {
                buf = null;
            }
        } else {
            pos.setIndex(pos.getIndex() + count);
            if (pos.getIndex() > text.length()) {
                pos.setIndex(text.length());
            }
        }
    }
582644
public function setTotal($total)
    {
        $this->total = (int) $total;

        if ($this->total < 1) {
            $this->total = 1;
        }

        if ($this->page < 1) {
            $this->page = 1;
        } elseif ($this->page > $this->total) {
            $this->page = $this->total;
        }
    }
367409
private void onEnd()
   {
      long result = System.currentTimeMillis() - currentTime.get().poll();
      times.incrementAndGet();
      if (result < min.get())
      {
         min.set(result);
      }
      if (max.get() < result)
      {
         max.set(result);
      }
      total.addAndGet(result);
   }
984226
public function progressBarCommand(): void
    {
        $i     = 0;
        $total = 120;
        $bar   = new ProgressBar();
        $bar->start(120);

        while ($i <= $total) {
            $bar->advance();
            usleep(50000);
            $i++;
        }

        $bar->finish();
    }
120869
public void increment(T item, double amount) {
    counts.put(item, counts.get(item) + amount);
    totalCount += amount;
  }
6351
public final void resolve(Number value) {
		future.complete(new Tree((Tree) null, null, value));
	}
993762
public void showValidationInProgress() {
        validationIcon.setValue(null);
        validationIcon.addStyleName("show-status-label");
        validationIcon.setStyleName(SPUIStyleDefinitions.TARGET_FILTER_SEARCH_PROGRESS_INDICATOR_STYLE);
    }
85312
void postProgress(final DownloadRequest request, final long bytesWritten, final long totalBytes) {
    downloadPoster.execute(new Runnable() {
      @Override public void run() {
        request.downloadCallback().onProgress(request.downloadId(), bytesWritten, totalBytes);
      }
    });
  }
481019
public void setPhoneNumber(String number) {
		String phoneNumber = number;
		if(number.startsWith("+")) {			
			phoneNumber = phoneNumber.substring(1);
		}
		try {
			basePhoneNumber(phoneNumber);		
			telUrl.setPhoneNumber(phoneNumber);
		} catch (ParseException ex) {
			logger.error("Error setting phone number " + number);
			throw new java.lang.IllegalArgumentException("phone number " + number + " is invalid", ex);
		}
	}
799722
function(id, name, loaded, total) {
            this._parent.prototype._onProgress.apply(this, arguments);

            this._templating.updateProgress(id, loaded, total);

            if (total === 0 || Math.round(loaded / total * 100) === 100) {
                this._templating.hideCancel(id);
                this._templating.hidePause(id);
                this._templating.hideProgress(id);
                this._templating.setStatusText(id, this._options.text.waitingForResponse);

                // If ~last byte was sent, display total file size
                this._displayFileSize(id);
            }
            else {
                // If still uploading, display percentage - total size is actually the total request(s) size
                this._displayFileSize(id, loaded, total);
            }
        }
1339733
def _progress_hook(self, blocknum, blocksize, totalsize):
        
        read = blocknum * blocksize
        if totalsize > 0:
            percent = read * 1e2 / totalsize
            s = "\r%d%% %*d / %d" % (
                percent, len(str(totalsize)), read, totalsize)
            sys.stdout.write(s)

            if read >= totalsize:
                sys.stdout.write("\n")
        else:
            sys.stdout.write("read %d\n" % read)
1179559
public void increment(int level) {
		assert level >= 1;
		if (this.numbers.size() < level) {
			do {
				this.numbers.addLast(0);
			} while (this.numbers.size() < level);
		} else if (this.numbers.size() > level) {
			do {
				this.numbers.removeLast();
			} while (this.numbers.size() > level);
		}
		assert this.numbers.size() == level;
		final int previousSection = this.numbers.removeLast();
		this.numbers.addLast(previousSection + 1);
	}
533869
private Double getPercentage(Number number)
   {
      Double result = null;

      if (number != null)
      {
         result = Double.valueOf(number.doubleValue() / 100);
      }

      return result;
   }