MinioClient.getObjectProgressBar() example.
18190
public static void main(String[] args)
      throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
    try {
      /* play.min.io for test and development. */
      MinioClient minioClient = new MinioClient("https://play.min.io:9000",
          "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");

      /* Amazon S3: */
      // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
      // "YOUR-SECRETACCESSKEY");

      // Check whether the object exists using statObject(). If the object is not found,
      // statObject() throws an exception. It means that the object exists when statObject()
      // execution is successful.

      // Get object stat information.
      ObjectStat objectStat = minioClient.statObject("testbucket", "resumes/4.original.pdf");

      // Get input stream to have content of 'my-objectname' from 'my-bucketname'
      InputStream is = new ProgressStream("Downloading .. ", ProgressBarStyle.ASCII,
          objectStat.length(), minioClient.getObject("my-bucketname", "my-objectname"));

      Path path = Paths.get("my-filename");
      OutputStream os = Files.newOutputStream(path, StandardOpenOption.CREATE);

      long bytesWritten = ByteStreams.copy(is, os);
      is.close();
      os.close();

      if (bytesWritten != objectStat.length()) {
        throw new IOException(path + ": unexpected data written.  expected = " + objectStat.length()
            + ", written = " + bytesWritten);
      }

    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
    }
  }
20672
public void fillWithProgress(ProgressBar view, FakerNumericComponent component) {
        validateNotNullableView(view);
        validateIfIsAProgressBar(view);
        validateNotNullableFakerComponent(component);

        view.setProgress(Math.abs(component.randomNumber().intValue()));
    }
549873
def progress(rest):
	""
	if rest:
		left, right, amount = [piece.strip() for piece in rest.split('|')]
		ticks = min(int(round(float(amount) / 10)), 10)
		bar = "=" * ticks
		return "%s [%-10s] %s" % (left, bar, right)
1029975
function getStackAddendumByWorkInProgressFiber(workInProgress) {
  var info = '';
  var node = workInProgress;
  do {
    info += describeFiber(node);
    // Otherwise this return pointer might point to the wrong tree:
    node = node['return'];
  } while (node);
  return info;
}
922423
def iterprogress( sized_iterable ):
    
    pb = ProgressBar( 0, len( sized_iterable ) )
    for i, value in enumerate( sized_iterable ):
        yield value
        pb.update_and_print( i, sys.stderr )
91953
def progressbar(length, label):
    
    return click.progressbar(length=length, label=label, show_pos=True)
928018
private void addProgressInterceptor() {
        httpClient.networkInterceptors().add(new Interceptor() {
            @Override
            public Response intercept(Interceptor.Chain chain) throws IOException {
                final Request request = chain.request();
                final Response originalResponse = chain.proceed(request);
                if (request.tag() instanceof ApiCallback) {
                    final ApiCallback callback = (ApiCallback) request.tag();
                    return originalResponse.newBuilder()
                            .body(new ProgressResponseBody(originalResponse.body(), callback)).build();
                }
                return originalResponse;
            }
        });
    }
1371521
def updateScreenshotProgress(self, screenshotHandle, flProgress):
        

        fn = self.function_table.updateScreenshotProgress
        result = fn(screenshotHandle, flProgress)
        return result
1342228
private void showProgress() {

        removeContent();
        displayDialogInfo(
            org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_UPLOAD_INFO_UPLOADING_0),
            false);
        m_selectionSummary.removeFromParent();
        List<String> files = new ArrayList<String>(getFilesToUpload().keySet());
        Collections.sort(files, String.CASE_INSENSITIVE_ORDER);
        m_progressInfo = new CmsUploadProgressInfo(files);
        m_progressInfo.setContentLength(m_contentLength);
        m_contentWrapper.add(m_progressInfo);
        m_updateProgressTimer.scheduleRepeating(UPDATE_PROGRESS_INTERVALL);
        startLoadingAnimation(Messages.get().key(Messages.GUI_UPLOAD_CLIENT_LOADING_0), 0);
        setHeight();
        changeHeight();
    }
93922
@Override protected synchronized Object doInBackground() throws Exception {
        try {
            setProgress(INITIALIZING);

            // perform initialization of camera device
            // access FrameGrabber objects from _this_ thread *ONLY*...
            frameGrabber = cameraDevice.createFrameGrabber();
            frameGrabber.setImageMode(ImageMode.COLOR);
            if (trackingSettings.useOpenCL) {
                frameGrabber.setPixelFormat(AV_PIX_FMT_RGBA);
            }
            frameGrabber.start();
            grabberConverter = new OpenCVFrameConverter.ToIplImage();
            IplImage image = grabberConverter.convert(frameGrabber.grab());
            final IplImage initImage = image;
            final int initWidth    = initImage.width();
            final int initHeight   = initImage.height();
            final int initChannels = trackingSettings.useOpenCL ? 4 : initImage.nChannels();
            final int initDepth    = initImage.depth();

            if (initWidth != cameraDevice.imageWidth || initHeight != cameraDevice.imageHeight) {
                cameraDevice.rescale(initWidth, initHeight);
            }

            // resize and tile the monitor frames according to the size of the grabbed images
            if (monitorWindows != null) {
                final double initScale = trackingSettings.getMonitorWindowsScale();
                EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        for (int i = 0; i < monitorWindows.length; i++) {
                            monitorWindows[i].setCanvasSize(
                                    (int)Math.round(initWidth *initScale),
                                    (int)Math.round(initHeight*initScale));
                            monitorWindows[i].setTitle(monitorWindowsTitles[i] + " (" +
                                    initWidth + " x " + initHeight + "  " +
                                    (initDepth&~IPL_DEPTH_SIGN) + " bpp  gamma = " +
                                    frameGrabber.getGamma() + ") - ProCamTracker");
                        }
                    }
                });
                CanvasFrame.tile(monitorWindows);
                CanvasFrame.global = monitorWindows[0];
            }

            // allocate memory for all images and load video
            final int minLevel = alignerSettings.getPyramidLevelMin();
            undistortedCameraImage  = IplImage.create(initWidth >> minLevel,
                    initHeight >> minLevel, initDepth, initChannels);
            distortedProjectorImage = IplImage.create(projectorDevice.imageWidth,
                    projectorDevice.imageHeight, IPL_DEPTH_8U, initChannels);
            BufferRing.BufferFactory<ProjectorBuffer> projectorBufferFactory;
            projectorBufferFactory = new BufferRing.BufferFactory<ProjectorBuffer>() {
                public ProjectorBuffer create() {
                    return new ProjectorBuffer(distortedProjectorImage, false);
                }
            };
            if (trackingSettings.useOpenCL) {
                GLContext shareWith = null;
                if (projectorFrame instanceof GLCanvasFrame) {
                    shareWith = ((GLCanvasFrame)projectorFrame).getGLCanvas().getContext();
                }
                contextCL = new JavaCVCL(shareWith);

                grabbedImageCL            = //contextCL.createCLImageFrom(initImage);
                        contextCL.getCLContext().createImage2d(initWidth, initHeight,
                                new CLImageFormat(frameGrabber.getSensorPattern() != -1L ?
                                        CLImageFormat.ChannelOrder.R :
                                        CLImageFormat.ChannelOrder.RGBA, ChannelType.UNORM_INT8));
                undistortedCameraImageCL  = //contextCL.createCLImageFrom(undistortedCameraImage);
                        contextCL.getCLContext().createImage2d(
                                undistortedCameraImage.width(), undistortedCameraImage.height(),
                                new CLImageFormat(CLImageFormat.ChannelOrder.RGBA, ChannelType.FLOAT));
                cameraDevice.setMapsPyramidLevel(minLevel);
                cameraMapxCL = contextCL.writeImage(cameraMapxCL, cameraDevice.getUndistortMap1(), false);
                cameraMapyCL = contextCL.writeImage(cameraMapyCL, cameraDevice.getUndistortMap2(), false);

                if (projectorFrame != null) {
                    projectorMapxCL = contextCL.writeImage(projectorMapxCL, projectorDevice.getDistortMap1(), false);
                    projectorMapyCL = contextCL.writeImage(projectorMapyCL, projectorDevice.getDistortMap2(), false);
                    distortedProjectorImageCL = contextCL.createCLGLImageFrom(distortedProjectorImage);
                }
                projectorBufferFactory = new BufferRing.BufferFactory<ProjectorBuffer>() {
                    public ProjectorBuffer create() {
                        return new ProjectorBuffer(distortedProjectorImage, true);
                    }
                };
            }
            projectorBufferRing = new BufferRing<ProjectorBuffer>(projectorBufferFactory,
                    trackingSettings.projectorBufferingSize);

            realityAugmentor = new RealityAugmentor(realityAugmentorSettings,
                    objectFinderSettings, markerDetectorSettings, virtualBallSettings,
                    cameraDevice, projectorDevice, initChannels);

            handMouse = new HandMouse(handMouseSettings);

            // get the three projector frames for initialization
            GNImageAligner.Settings s = alignerSettings.clone();
            // prepare settings for maximum accuracy
            s.setAlphaTikhonov(0);
            s.setDeltaMin(0);
            s.setLineSearch(new double[] { 1.0, 1.0/2, 1.0/4, 1.0/8, 1.0/16, 1.0/32, 1.0/64, 1.0/128 });
            s.setThresholdsOutlier(new double[] { 0.0 });
            s.setThresholdsZero(new double[] { 0.0 });
            reflectanceInitializer = new ReflectanceInitializer(cameraDevice, projectorDevice, initChannels, s);
            projectorInitFloatImages = reflectanceInitializer.getProjectorImages();
            projectorInitImages   = new IplImage[projectorInitFloatImages.length];
            cameraInitImages      = new IplImage[projectorInitFloatImages.length];
            cameraInitFloatImages = new IplImage[projectorInitFloatImages.length];
            for (int i = 0; i < projectorInitFloatImages.length; i++) {
                projectorInitImages[i]   = IplImage.createCompatible(distortedProjectorImage);
                cameraInitImages[i]      = IplImage.create(initWidth, initHeight, initDepth, initChannels);
                cameraInitFloatImages[i] = IplImage.create(undistortedCameraImage.width(),
                        undistortedCameraImage.height(), IPL_DEPTH_32F, initChannels);
                cvConvertScale(projectorInitFloatImages[i], projectorInitImages[i], 255, 0);
                projectorDevice.distort(projectorInitImages[i], distortedProjectorImage);
                cvCopy(distortedProjectorImage, projectorInitImages[i]);
            }
            reflectanceImage = IplImage.createCompatible(cameraInitFloatImages[0]);
            if (trackingSettings.useOpenCL) {
                reflectanceImageCL = contextCL.createCLImageFrom(reflectanceImage);
            }

            if (trackingSettings.outputVideoFile != null) {
                frameRecorder = new FFmpegFrameRecorder(trackingSettings.outputVideoFile,
                        undistortedCameraImage.width(), undistortedCameraImage.height());
                frameRecorder.start();
                recorderConverter = new OpenCVFrameConverter.ToIplImage();
            } else {
                frameRecorder = null;
                recorderConverter = null;
            }

            boolean done = false;
            while (!done) {
                done = doTracking();

                // force release of native memory
                System.gc();
                Pointer.deallocateReferences();
            }
        } catch (Throwable t) {
            if (!isCancelled()) {
                while (t.getCause() != null) { t = t.getCause(); }
                logger.log(Level.SEVERE, "Could not perform tracking.", t);
                cancel(false);
            }
        }

        try {
            if (frameGrabber != null) {
                frameGrabber.stop();
                frameGrabber.release();
            }
        } catch (Exception ex) {
            logger.log(Level.SEVERE, "Could not release FrameGrabber.", ex);
        } finally {
            frameGrabber = null;
            grabberConverter = null;
        }

        try {
            if (frameRecorder != null) {
                frameRecorder.stop();
                frameRecorder.release();
            }
        } catch (Exception ex) {
            logger.log(Level.SEVERE, "Could not release FrameRecorder.", ex);
        } finally {
            frameRecorder = null;
            recorderConverter = null;
        }

        if (trackingSettings.useOpenCL) {
            grabbedImageCL.release();
            undistortedCameraImageCL.release();
            contextCL.releaseCLGLImage(distortedProjectorImageCL);
            reflectanceImageCL.release();
            cameraMapxCL.release();
            cameraMapyCL.release();
            projectorMapxCL.release();
            projectorMapyCL.release();
            grabbedImageCL = undistortedCameraImageCL = distortedProjectorImageCL = null;
            reflectanceImageCL = null;
            cameraMapxCL = cameraMapyCL = projectorMapxCL = projectorMapyCL = null;

            contextCL.release();
            contextCL = null;
        }

        roiPts = null;
        transformer = null;
        parameters = lastParameters = tempParameters = null;
        aligner = null;
        reflectanceInitializer = null;
        handMouse = null;
        realityAugmentor = null;

        grabbedImage = undistortedCameraImage = distortedProjectorImage = null;
        projectorInitFloatImages = projectorInitImages = null;
        cameraInitImages = cameraInitFloatImages = monitorImages = null;
        reflectanceImage = null;

        projectorBufferRing.release();
        projectorBufferRing = null;

        // force release of native memory
        System.gc();
        Pointer.deallocateReferences();

        return null;
    }
600921
public boolean notifyProgress(int value, int maximum) {

    boolean result = true;

    for (ProgressMonitor monitor : this.monitors) {
      if (!monitor.notifyProgress(value, maximum)) {
        result = false;
      }
    }

    return result;

  }
1009141
def get_progress(self):
        
        pos = self.reader.reader.tell()
        return min((pos - self.region_start) /
                   float(self.region_end - self.region_start),
                   1.0)
156925
def _initialize_progress_bar(self):
        """"""

        widgets = ['Download: ', Percentage(), ' ', Bar(),
                   ' ', AdaptiveETA(), ' ', FileTransferSpeed()]

        self._downloadProgressBar = ProgressBar(
            widgets=widgets, max_value=self._imageCount).start()
621252
protected JProgressBar getProgressBar() {
        if (progressBar == null) {
            progressBar = createProgressBar();
            Assert.notNull(progressBar, "createProgressBar should not return null");
        }
        return progressBar;
    }
745535
function frame () {
    if (!animationActive) return
    const expectedFrameNumber = (Date.now() - animationStartTime) / 1000 * 60
    const updateCount = Math.min(expectedFrameNumber - lastFrameNumber, 10)
    lastFrameNumber = expectedFrameNumber
    for (let i = 0; i < updateCount; i++) {
      update()
      if (!shouldAnimate()) {
        animationActive = false
        break
      }
    }
    draw()
    if (animationActive) {
      window.requestAnimationFrame(frame)
    }
  }
254478
public float getProgress() throws IOException {
    float ret = 1.0f;
    for (RecordReader<K,? extends Writable> rr : kids) {
      ret = Math.min(ret, rr.getProgress());
    }
    return ret;
  }
208586
public int getZoomLevelProgress(int zoomLevel) {
		Integer zoomProgress = zoomLevelProgress.get(zoomLevel);
		if (zoomProgress == null) {
			zoomProgress = 0;
		}
		return zoomProgress;
	}