progress

WebClient AsyncUpload progress percentage always returns 50%

你说的曾经没有我的故事 提交于 2019-12-18 06:54:08
问题 i am using Webclient to upload data using Async call to a server, WebClient webClient = new WebClient(); webClient.UploadDataAsync(uri , "PUT", buffer, userToken); i've attached DatauploadProgress and DatauploadCompleted Events to appropriate callback functions // Upload Date Progress webClient.UploadProgressChanged += new UploadProgressChangedEventHandler(UploadProgressCallback); // Upload Date Progress void UploadProgressCallback(object sender, UploadProgressChangedEventArgs e) { // Magic

Monitoring the progress of an SQL query in SQL SERVER

非 Y 不嫁゛ 提交于 2019-12-18 04:31:29
问题 I saw a similar question which asked how to monitor the progress of a backup/restore operation: Is there a SQL script that I can use to determine the progress of a SQL Server backup or restore process? I would like to know if there's a similar query/way to see how much time the query has left until it will end. For example, one query usually has an elapsed time of 5 minutes. I would like to know how much time is left until it will end DURING the query's execution. 回答1: There is no way to know

How to see progress of query execution during handle?

£可爱£侵袭症+ 提交于 2019-12-17 19:54:48
问题 I used the following code in delphi for handle : procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus); begin Progressbar1.Visible:=true; Progressbar1.Max:=MaxProgress; Progressbar1.Ppsitian:=Progress; Progressbar1.Visible:=false; end; but.... I can't see any effect (this code doesn't execute) I want to show progress of query execution during when the user clicked a button for ٍُSEARCH in database from begining to

WPF not updating textbox while in progress

隐身守侯 提交于 2019-12-17 16:40:49
问题 I have this code: void wait(int ms) { System.Threading.Thread.Sleep(ms); } private void button1_Click(object sender, RoutedEventArgs e) { info.Text = "step 1"; wait(1000); info.Text = "step 2"; wait(1000); info.Text = "step 3"; wait(1000); info.Text = "step 4"; wait(1000); } And problem is that textbox.text is updated after whole void button1_Click finished. It is not updated ON AIR :( Please, How to do that? 回答1: Just do this. private void button1_Click(object sender, RoutedEventArgs e) {

Can't grab progress on http POST file upload (Android)

佐手、 提交于 2019-12-17 08:53:18
问题 I am developing an Android app which enables the user to upload a file to services like Twitpic and others. The POST upload is done without any external libraries and works just fine. My only problem is, that I can't grab any progress because all the uploading is done when I receive the response, not while writing the bytes into the outputstream. Here is what I do: URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn

How to get a progress bar for a file upload with Apache HttpClient 4?

本小妞迷上赌 提交于 2019-12-17 08:30:31
问题 I've got the following code for a file upload with Apache's HTTP-Client (org.apache.http.client): public static void main(String[] args) throws Exception { String fileName = "test.avi"; File file = new File(fileName); String serverResponse = null; HttpParams params = new BasicHttpParams(); params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, true); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpClient client = new DefaultHttpClient(params); HttpPut put = new HttpPut(

web前端入门到实战:HTML5 VideoAPI,打造自己的Web视频播放器

帅比萌擦擦* 提交于 2019-12-17 03:29:31
本文将使用HTML5提供的VideoAPI做一个自定义的视频播放器,需要用到HTML5提供的video标签、以及HTML5提供的对JavascriptAPI的扩展。 一、基础知识 1.用法 <video src="./video/mv.mp4"></video> 注意:audio和video元素必须同时包含开始和结束标签,不能使用 2.重要HTML属性 controls :ontrol:如果出现该属性,则向用户显示控件,比如播放按钮。每个浏览器中的播放控件都不太一样,但用途都一样,都可以控制开始和结束,跳到新位置和调节音量 autoplay :autoplay:如果出现该属性,则视频在就绪后马上播放。如果不设置autoplay属性,必须是用户单击播放按钮才会播放音频文件。 loop :loop:(循环播放)告诉浏览器在音频到达末尾时,再从头开始重新播放 preload :auto、mete、none:告诉浏览器如何下载音频 auto:让浏览器下载整个文件,以便用户单击播放按钮时就能播放。当然,下载过程是后台进行的,网页访客不必等待下载完成,而且仍然可以随意查看网页。 meta:告诉浏览器先获取音频文件开头的数据块,从而足以确定一些基本信息(比如音频的总时长) none:**告诉浏览器不必预先下载。恰当地利用这些值,可以节省带宽。 如果没有设置preload属性

How to create a spinning command line cursor?

夙愿已清 提交于 2019-12-17 03:25:11
问题 Is there a way to print a spinning cursor in a terminal using Python? 回答1: Something like this, assuming your terminal handles \b import sys import time def spinning_cursor(): while True: for cursor in '|/-\\': yield cursor spinner = spinning_cursor() for _ in range(50): sys.stdout.write(next(spinner)) sys.stdout.flush() time.sleep(0.1) sys.stdout.write('\b') 回答2: Easy to use API (this will run the spinner in a separate thread): import sys import time import threading class Spinner: busy =

How to create a spinning command line cursor?

≡放荡痞女 提交于 2019-12-17 03:25:10
问题 Is there a way to print a spinning cursor in a terminal using Python? 回答1: Something like this, assuming your terminal handles \b import sys import time def spinning_cursor(): while True: for cursor in '|/-\\': yield cursor spinner = spinning_cursor() for _ in range(50): sys.stdout.write(next(spinner)) sys.stdout.flush() time.sleep(0.1) sys.stdout.write('\b') 回答2: Easy to use API (this will run the spinner in a separate thread): import sys import time import threading class Spinner: busy =

Animate drawing of a circle

帅比萌擦擦* 提交于 2019-12-17 03:20:56
问题 I'm looking for a way to animate the drawing of a circle. I have been able to create the circle, but it draws it all together. Here is my CircleView class: import UIKit class CircleView: UIView { override init(frame: CGRect) { super.init(frame: frame) self.backgroundColor = UIColor.clearColor() } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func drawRect(rect: CGRect) { // Get the Graphics Context var context =