progress

jQuery Slider - Progress Bar

▼魔方 西西 提交于 2019-12-04 21:23:42
Similar to: Jquery slider with progress bar I have this slider and progress bar, but I want the progress bar synced with with the "previous" and "next" buttons as well. So when you click "next" the progress bar starts from beginning. http://jsfiddle.net/aidenguinnip/8rJws/ $(window).load(function(){ var currentIndex = 0;// store current pane index displayed var ePanes = $('#slider .panel'), // store panes collection time = 3000, bar = $('.progress_bar'); function showPane(index){// generic showPane // hide current pane ePanes.eq(currentIndex).stop(true, true).fadeOut(); // set current index :

iOS - 图形上下文绘图

最后都变了- 提交于 2019-12-04 21:20:18
drawRect调用场景 视图第一次显示的时候会调用。这个是由系统自动调用的,主要是在 UIViewController 中 loadView 和 viewDidLoad 方法调用之后; 如果在 UIView 初始化时没有设置 rect 大小,将直接导致 drawRect 不被自动调用 该方法在调用 sizeThatFits 后被调用,所以可以先调用 sizeToFit 计算出 size ,然后系统自动调用 drawRect: 方法; 通过设置 contentMode 属性值为 UIViewContentModeRedraw ,那么将在每次设置或更改 frame 的时候自动调用 drawRect: ; 直接调用 setNeedsDisplay ,或者 setNeedsDisplayInRect: 触发 drawRect: ,但是有个前提条件是rect不能为0; drawRect使用注意事项 如果子类直接继承自UIView,则在drawRect 方法中不需要调用super方法。若子类继承自其他View类则需要调用super方法以实现重绘 若使用UIView绘图,只能在 drawRect: 方法中获取绘制视图的 contextRef 。在其他方法中获取的 contextRef 都是不生效的; drawRect: 方法不能手动调用,需要调用实例方法 setNeedsDisplay 或者

How can I make a jquery/css progression bar that reflects step by step form progression?

情到浓时终转凉″ 提交于 2019-12-04 20:14:46
I see a lot of example progress bars that show the progression bar being filled up. However, I would just like to know how I could make a progress reflect step by step form progress. A good example of what I would want can be seen Here . Any helpful code or examples/demos from other pages would be good to have. Thanks! If you like the Buffalo one, just have a look at how they do it. First they define a div like this: <div id="progress"> <div id="complete" class="s1"> <div id="marker"></div> </div> </div> Then they use CSS to render the div based on the progress (which is controlled with class=

Using UIActivityIndicatorView with UIWebView in Swift

心已入冬 提交于 2019-12-04 17:37:33
问题 I'm trying to display an Activity Indicator View in my app to users while a url is being loaded into a WebView. I've tried toying with activity.startAnimating/activity.stopAnimating and tried placing them in functions, etc. but have not had any luck. The best I have been able to get is the Activity Indicator to appear and animate, but then not stop animating or hide once my url is loaded, so it continues spinning on top of the web page. In other situations, when trying to move around activity

Is it possible to check progress of URLconnection.getInputStream()?

陌路散爱 提交于 2019-12-04 12:12:07
问题 I want to check progress of downloading file by URLconnection. Is it possible or should I use another library? This is my urlconnection function: public static String sendPostRequest(String httpURL, String data) throws UnsupportedEncodingException, MalformedURLException, IOException { URL url = new URL(httpURL); URLConnection conn = url.openConnection(); //conn.addRequestProperty("Content-Type", "text/html; charset=iso-8859-2"); conn.setDoOutput(true); OutputStreamWriter wr = new

How is Progress<T> different from Action<T> ? (C#)

三世轮回 提交于 2019-12-04 09:46:18
I've been using Progress<T> and wondered if it can be replaced by Action<T> . In the code below, using each of them for reporting progress, i.e. ReportWithProgress() or ReportWithAction() , didn't make any noticeable difference to me. How progressBar1 increased, how the strings were written on the output window, they seemed the same. // WinForm application with progressBar1 private void HeavyIO() { Thread.Sleep(20); // assume heavy IO } private async Task ReportWithProgress() { IProgress<int> p = new Progress<int>(i => progressBar1.Value = i); for (int i = 0; i <= 100; i++) { await Task.Run(()

jQuery AJAX upload progress for large text fields

假装没事ソ 提交于 2019-12-04 09:04:51
Is it possible to get the upload-progress for a form with very large textfields using jQuery ajax? I think the client knows how much bytes have been sent, but when I Google I only find solutions for file-uploads using server-site code. This is my ajax-request: $.ajax({ type: "POST", url: "index.php?action=saveNewPost", data: {textbox1: textbox1,textbox2: textbox2}, contentType: "application/x-www-form-urlencoded;charset=UTF-8", success: function(){ // } }); I was hoping there would be something like "onProgress" with a parameter containing the amount of bytes already sent... Found a solution $

android AsyncTask介绍

南楼画角 提交于 2019-12-04 08:36:33
AsyncTask和Handler对比 1 ) AsyncTask实现的原理,和适用的优缺点 AsyncTask,是android提供的轻量级的异步类,可以直接继承AsyncTask,在类中实现异步操作, 并 提供接口反馈当前 异步执行的程度 (可以通过接口实现UI进度更新),最后反馈执行的结果给UI主线程. 使用的优点: l 简单,快捷 l 过程可控 使用的缺点 : l 在使用多个异步操作和并需要进行Ui变更时,就变得复杂起来. 2 )Handler异步实现的原理和适用的优缺点 在Handler 异步实现时,涉及到 Handler, Looper, Message,Thread四个对象,实现异步的流程是主线程启动Thread(子线程)àthread(子线程)运行并生成Message-àLooper获取Message并传递给HandleràHandler逐个获取Looper中的Message,并进行UI变更。 使用的优点: l 结构清晰,功能定义明确 l 对于多个后台任务时,简单,清晰 使用的缺点: l 在单个后台异步处理时,显得代码过多,结构过于复杂(相对性) AsyncTask介绍 Android的AsyncTask比Handler更轻量级一些,适用于简单的异步处理。 首先明确Android之所以有Handler和AsyncTask,都是为了不阻塞主线程(UI线程)

JS ProgressEvent is only fired when finished

[亡魂溺海] 提交于 2019-12-04 07:41:50
I am having some problems getting my upload progress bar to work properly. According to the XMLHttpRequest Level 2 specs, I attached event listeners for loadstart and progress like this: var xhr = $.ajaxSettings.xhr(); xhr.upload.addEventListener('loadstart', function(e) {progressCallback(0);}); xhr.upload.addEventListener('progress', function (e) { progressCallback(e.loaded / e.total); }); $.ajax({ url: url, type: 'POST', processData: false, contentType: false, data: formData, xhr: function () { return xhr; } }).done(function (data) { // Finish stuff }) The file is correctly uploaded but the

Progress bar in console application

房东的猫 提交于 2019-12-04 07:23:16
问题 I'm writing a simple c# console app that uploads files to sftp server. However, the amount of files are large. I would like to display either percentage of files uploaded or just the number of files upload already from the total number of files to be upload. First, I get all the files and the total number of files. string[] filePath = Directory.GetFiles(path, "*"); totalCount = filePath.Length; Then I loop through the file and upload them one by one in foreach loop. foreach(string file in