progress

Get Progress of HTTPRequest in Java

心不动则不痛 提交于 2019-12-13 05:24:19
问题 i got a java method which returns the response of the website in a string. Now i want to add the possibility to track the progress of this request. I know i can calculate it via (contenLength/readBytes) *100. But i am not sure how to retrieve this information properly and update the progress everytime it changes. My current method looks like this: public String executePost(URL url) { StringBuffer sb = new StringBuffer(); int readBytes = 0; int contentLength = 0; int progress = 0; try { String

Android Help with adding a progress dialog while image loading?

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:43:47
问题 I have been following a tutorial that remotely downloads an image to an imageview, but i'm not sure how to add a progress dialog (image or something) to show the user that image is downloading, instead of just a blank screen. Hope someone can help ImageView imView; String imageUrl="http://domain.com/images/"; Random r= new Random(); /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); this.requestWindowFeature(Window.FEATURE

Show “In Progress” during http request (long running) execution in javascript/jquery/php

天大地大妈咪最大 提交于 2019-12-13 04:23:13
问题 I would like to have "Loading.." / "In Progress.." message during regular http request. This should be shown only during the http request cycle, and once you get the request is completed and you get the response, it should go off. I am keen about regular HTTP Request, and HTTP Request that take longer time and not AJAX. Code blocks, examples, pointers appreciated. Here is one approach, I would like to have common approach, so that it can be used for any http request. 回答1: You should use

Reading Position Indicator based on DIV instead of the whole page

独自空忆成欢 提交于 2019-12-13 03:16:34
问题 I want to show a Reading Position Indicator on my site. Unfortunately, the site is much longer than the text to read. The content is inside a single DIV called "content-wrapper". At the moment I'm using the HTML5 progress element (https://dev.w3.org/html5/spec-preview/the-progress-element.html) and added it to my site like in this example: https://css-tricks.com/reading-position-indicator/ It's working fine so far. The problem is, that the progress is calculated based on the lenght of the

Displaying a Progress Bar while a calculation is occuring

落爺英雄遲暮 提交于 2019-12-12 21:26:33
问题 I am writing a code in order to calculating the value of Pi, and sometimes could take a long time to calculate. I added a progress bar to show progress, but the code does exactly what I told it to, it opens the progress bar after the calculations and then immediately closes it (It closes when the value reaches 100.) I have attempted to stick the code for the progress bar into the loop, but soon I realized that solves the solution, but creates multiply progress bar windows. If placed before

Ajax progress with PHP session

丶灬走出姿态 提交于 2019-12-12 09:25:32
问题 I have an app that processes images and use jQuery to display progress to the user. I done this with writing to a textfile each time and image is processed and than read this status with a setInterval. Because no images are actually written in the processing (I do it in PHP's memory) I thought a log.txt would be a solution, but I am not sure about all the fopen and fread's. Is this prone to issues? I tried also with PHP sessions, but can't seem to get it to work, I don't get why.. HTML: <a

Swift Progress Indicator Image Mask

吃可爱长大的小学妹 提交于 2019-12-12 08:08:10
问题 To start, this project has been built using Swift. I want to create a custom progress indicator that "fills up" as the script runs. The script will call a JSON feed that is pulled from the remote server. To better visualize what I'm after, I made this: My guess would be to have two PNG images; one white and one red, and then simply do some masking based on the progress amount. Any thoughts on this? 回答1: Masking is probably overkill for this. Just redraw the image each time. When you do, you

Monitor ZIP File Extraction Python

╄→гoц情女王★ 提交于 2019-12-12 07:58:22
问题 I need to unzip a .ZIP archive. I already know how to unzip it, but it is a huge file and takes some time to extract. How would I print the percentage complete for the extraction? I would like something like this: Extracting File 1% Complete 2% Complete etc, etc 回答1: here an example that you can start with, it's not optimized: import zipfile zf = zipfile.ZipFile('test.zip') uncompress_size = sum((file.file_size for file in zf.infolist())) extracted_size = 0 for file in zf.infolist():

Android: Show progress indicator of parse while downloading a XML

ぐ巨炮叔叔 提交于 2019-12-12 05:28:21
问题 I need to show a progress indicator bar while parsing a downloading xml. I did it downloading first, and then parsing, but I wan't to do both action parallels. This is part of my code to do this, but i don't know how to show the pogress indicator. public class WS_Sincronizo extends AsyncTask<Void,Integer,List<Alertas>>{ private Context conte; // Variable para controlar ventana de progreso private Sincronizacion actividad; private Alertas user; private long totalSize; private WaitForCancelTask

Fix progress report event in this method

ⅰ亾dé卋堺 提交于 2019-12-12 04:55:41
问题 I've tried to write a method that splits a file into smaller parts (I call those parts 'chunks'), I use a buffer of 1 MB to read/write the chunks and I'm reporting the operation progress percentage and the current chunk progress percent. The problem is this, I have a big file of 6,74 GB and I will split it into chunks of 1 GB each one, the progress report works as expected but not for the last chunk where the progress up only to 75% 'cause of course the last part is around 750 mb and not 1 GB