progress

Monitoring the progress of an SQL query in SQL SERVER

∥☆過路亽.° 提交于 2019-11-29 05:36:22
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. KM. There is no way to know how much time is left. A query's runtime depends on many things beyond the actual query itself: locking

Android seekbar set custom style using nine-patch images

杀马特。学长 韩版系。学妹 提交于 2019-11-29 04:10:01
I am trying to create a custom-styled seekbar. I have two nine-patch images one is a gray stretching bar search_progress.9.png (background color) and the other is a green stretching bar search_progress_bar.9.png (foreground color). I use this xml as my seekbar's progressDrawable: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/search_progress"></item> <item android:id="@android:id/progress" android:drawable="@drawable/search_progress_bar"></item> </layer-list> My

Showing progress in percentage while uploading and downloading using HttpWebRequest class

∥☆過路亽.° 提交于 2019-11-29 00:24:53
I'm trying to upload and download (in the same request) to a server using HttpWebRequest in C# and since the size of data is considerable (considering network speed) I would like to show the user how far of the job is done and how much is left (not in seconds but in percentage). I've read a couple of examples trying to implement this but none of them show any progress bar. They all just use async not to block the UI while it is uploading/downloading. And they are mostly focused on upload / download and none try including them both in the same request. Since I'm using .Net 4 as my target

Progress bar with PHP & Ajax

北战南征 提交于 2019-11-29 00:16:59
I am working on progress bar which updates progress using ajax requests and session variables. When my program performs time consuming operation such as sending many emails etc. it just set proper session variable (which contains progress value). This operation is started by function post() in code below. In the meantime, the second function ask() is performed in loop every 500ms. It should return current progress in real time. And here is the problem: every request sent by ask() are waiting for request sent by post() function is finished. The funny part is that if I set some URL like google

how to change ProgressBar color?

…衆ロ難τιáo~ 提交于 2019-11-28 21:15:23
i want to change Horizontal ProgressBar color i have tried this How to change the color of an indefinite ProgressBar? its not working still progress run in blue color this is my code <ProgressBar android:id="@+id/mini_progress" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="20dip" android:layout_gravity="center_horizontal" android:indeterminate="false" android:indeterminateBehavior="repeat" android:indeterminateOnly="true" android:visibility="gone"/> how i can

Printing an ASCII spinning “cursor” in the console

巧了我就是萌 提交于 2019-11-28 20:45:04
I have a Ruby script that does some long taking jobs. It is command-line only and I would like to show that the script is still running and not halted. I used to like the so called "spinning cursor" in the old days and I managed to reproduce it in Ruby under Windows. Question: does this work in the other OS's? If not, is there an OS-independent way to accomplish this? No IRB solutions please. 10.times { print "/" sleep(0.1) print "\b" print "-" sleep(0.1) print "\b" print "\\" sleep(0.1) print "\b" print "|" sleep(0.1) print "\b" } Yes, this works on Windows, OS X, and Linux. Improving on

Android Download Progress

旧巷老猫 提交于 2019-11-28 19:56:24
问题 I want to know the progress of some download. When I'm getting some resource from the internet, like this: String myFeed = request.getURI().toString(); URL url = new URL(myFeed); URLConnection connection = url.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection) connection; int responseCode = httpConnection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { InputStream in = httpConnection.getInputStream(); // Process the input stream } When "InputStream in

前端获取图片压缩后上传给后台

≡放荡痞女 提交于 2019-11-28 17:33:19
  此前有同事跟我聊过关于移动端用canvas压缩图片后再上传的功能,最近有了点空闲时间,所以就实践了一下。demo效果链接在文章底部贴出。   在做移动端图片上传的时候,用户传的都是手机本地图片,而本地图片一般都相对比较大,拿iphone6来说,平时拍很多图片都是一两M的,如果直接这样上传,那图片就太大了,如果用户用的是移动流量,完全把图片上传显然不是一个好办法。   目前来说,HTML5的各种新API都在移动端的webkit上得到了较好的 实现。根据查看caniuse,本demo里使用到的FileReader、Blob、Formdata对象均已在大部分移动设备浏览器中得到了实现 (safari6.0+、android 3.0+),所以直接在前端压缩图片,已经成了很多移动端图片上传的必备功能了。   在移动端压缩图片并且上传主要用到filereader、canvas 以及 formdata 这三个h5的api。逻辑并不难。整个过程就是:   (1)用户使用input file上传图片的时候,用filereader读取用户上传的图片数据(base64格式)   (2)把图片数据传入img对象,然后将img绘制到canvas上,再调用canvas.toDataURL对图片进行压缩   (3)获取到压缩后的base64格式图片数据,转成二进制塞入formdata

Haskell Lazy ByteString + read/write progress function

别来无恙 提交于 2019-11-28 17:17:19
I am learing Haskell Lazy IO. I am looking for an elegant way to copy a large file (8Gb) while printing copy progress to console. Consider the following simple program that copies a file silently. module Main where import System import qualified Data.ByteString.Lazy as B main = do [from, to] <- getArgs body <- B.readFile from B.writeFile to body Imgine there is a callback function you want to use for reporting: onReadBytes :: Integer -> IO () onReadBytes count = putStrLn $ "Bytes read: " ++ (show count) QUESTION: how to weave onReadBytes function into Lazy ByteString so it will be called back

Show spinning wheel dialog while loading data on Android

故事扮演 提交于 2019-11-28 16:59:37
I want to show a spinning wheel dialog while my app loads some data: The spinning wheel dialog should show on a button click. I’m using the code below but it does now show the spinning wheel. What could be the problem? public void CheckAccount(String username, String password) { try { final ProgressDialog progDailog = ProgressDialog.show(this, "Progress_bar or give anything you want", "Give message like ....please wait....", true); new Thread() { public void run() { try { // sleep the thread, whatever time you want. sleep(1000); } catch (Exception e) { } progDailog.dismiss(); } }.start(); /