progress

WPF not updating textbox while in progress

痞子三分冷 提交于 2019-11-28 00:26:39
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? Just do this. private void button1_Click(object sender, RoutedEventArgs e) { ThreadPool.QueueUserWorkItem((o) => { Dispatcher.Invoke((Action) (() => info.Text = "step 1")); wait(1000);

Maven, displaying unit test currently running

妖精的绣舞 提交于 2019-11-28 00:12:24
问题 My company has recently switched to maven, and the transition was very smooth, but there is one this that annoys me. So earlier, in pre-maven era you could see which test is current class is being run (f.e if you had 40 unit tests in a class, and 2nd test failed you would see it). Now it looks this way: it displays the name of tested class and thats it. You have to wait till all the tests are done in the class to actually see the results (you can stop the test and it will show the progress to

Angular 1.5.4 $http progress event

空扰寡人 提交于 2019-11-27 21:34:36
Now Angular 1.5.4 finally allows you to track progress event on $http provider but for some reason I keep getting the $rootScope as a response instead of an actual progress (I'm using it for uploads) information. Because of lack of examples I found some tests in the Angular repo and followed that but to no success. restClientInstance.post = function (requestParams) { var postParams = { method: "POST", url: API_URL + requestParams.url, headers: requestParams.headers, data: requestParams.data, eventHandlers: { progress: function (c) { console.log(c); } }, uploadEventHandlers: { progress:

Adding a Progress Dialog in a webview

筅森魡賤 提交于 2019-11-27 21:31:27
I have been trying to incorporate a progress dialog into my app when pages are loading in the webview so there isn't just a blank white screen. I know this question is posted everywhere but I can't seem to figure out anything that works for me. I am new to programming and working with android so any information would be helpful. Below is the code that I currently have now. With the onPageStarted I am getting a compile error for Bitmap and I'm not sure what the problem is. Thanks. public class Grades extends Activity{ @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate

Show javascript execution progress

无人久伴 提交于 2019-11-27 20:45:34
I have some javascript functions that take about 1 to 3 seconds. (some loops or mooML templating code.) During this time, the browser is just frozen. I tried showing a "loading" animation (gif image) before starting the operation and hiding it afterwords. but it just doesnt work. The browser freezes before it could render the image and hides it immediately when the function ends. Is there anything I can do to tell the browser to update the screen before going into javascript execution., Something like Application.DoEvents or background worker threads. So any comments/suggestions about how to

Hide progress of Invoke-WebRequest

不打扰是莪最后的温柔 提交于 2019-11-27 20:21:58
How can I hide the progress display of Invoke-WebRequest ? I do a lot of successive requests and have my own Write-Progress display that I use, so I don't need the built-in one popping up underneath it every time. I use the mshtml results (the IE COM object) that are created from the result of Invoke-WebRequest automatically, so I can't switch to a WebClient or something like that, unless someone provides instructions on how to get an mshtml object from a WebClient request. Use the $progressPreference variable. It should have a value of 'Continue' by default unless you've edited it elsewhere,

Backgroundworker won't report progress

拜拜、爱过 提交于 2019-11-27 20:09:39
I have a background worker running a long database task. i want to show the progress bar while the task is running. Somehow the background worker won't report the progress of the task. This is what i have: BackgroundWorker _bgwLoadClients; _bgwLoadClients = new BackgroundWorker(); _bgwLoadClients.WorkerReportsProgress = true; _bgwLoadClients.DoWork += new DoWorkEventHandler(_bgwLoadClients_DoWork); _bgwLoadClients.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bgwLoadClients_RunWorkerCompleted); _bgwLoadClients.ProgressChanged += new ProgressChangedEventHandler(_bgwLoadClients

webpack es6支持配置

允我心安 提交于 2019-11-27 20:07:10
之前看一个美女写的: elememtui(有关权限的那些事) 小颖也想试试怎么根据不同的用户,给不同的访问菜单权限,昨天下午小颖试了好久,都没弄好,用户刚登陆进去菜单栏是好的,但是当页面一刷新,左侧的菜单就不见了,但当 小颖 点击了别的地方后,左侧的菜单栏又能出来了,阿西吧擦,昨天折腾了小颖一下午,在下班前还是没弄好,回去因为才搬了家房子乱的得收拾房间,所以也就没带电脑回去,早上来竟然弄好啦弄好啦弄好啦嘻嘻嘻,下面我们就一起来看看 小颖写的代码吧嘻嘻 。 效果图: 项目是基于小颖之前写的那个demo来写的这里小颖就只把重要的代码给大家粘出来,剩下的大家请移驾到: vue2.0+element+node+webpack搭建的一个简单的后台管理界面 来看其他的代码。 更新后的项目目录: 注意:小颖之前没有用到es6,现在小颖引了es6,具体怎么引请看这里: webpack es6支持配置 如果遇到问题: Vue2.0 新手完全填坑攻略—从环境搭建到发布——DT 新建json文件: permissions.json { "uesername": "admin", "password": "123456", "menu": [{ "name": "导航一", "path": "/", "children": [{ "path": "/menutab", "name": "Tab" }] }

How to show percentage progress of a downloading file in java console(without UI)?

拥有回忆 提交于 2019-11-27 19:36:18
问题 My part of java code is below. while (status == DOWNLOADING) { /* Size buffer according to how much of the file is left to download. */ byte buffer[]; if (size - downloaded > MAX_BUFFER_SIZE) { buffer = new byte[MAX_BUFFER_SIZE]; } else { buffer = new byte[size - downloaded]; } // Read from server into buffer. int read = stream.read(buffer); if (read == -1){ System.out.println("File was downloaded"); break; } // Write buffer to file. file.write(buffer, 0, read); downloaded += read; } /*

HTML文件上传与下载

放肆的年华 提交于 2019-11-27 19:09:35
文件下载 传统的文件下载有两种方法: 使用<a/>标签,href属性直接连接到服务器的文件路径 window.location.href="url" 这两种方法效果一样。但有个很大的问题,如果下载出现异常(连接路径失效、文件不存在、网络问题等),会导致原本的页面被覆盖掉,显示404等错误信息。 大致的优化思路如下: 使用<a/>标签HTML5新的属性download。 使用<iframe><iframe/>元素进行下载。 使用ajax、axios、fetch等方法异步下载。 使用websocket下载。 我们来逐一分析: <a/>标签的download属性,需要和href一起用,download的作用是为下载的文件赋文件名。 如果服务端没有指定文件名,就以此属性规定的名称命名。 如果下载出现异常,该属性的存在能够保证页面不会出问题。 如果服务端返回的不是文件、而是字符,如果download=‘’error.txt”,能够通过打开此文件查看到返回的文本信息。 <iframe>标签可以做到在现有的页面下,内嵌一个子页面。当用户点击文件下载时,将隐藏的iframe元素的src属性指向文件下载路径。 如果没有异常,文件将会直接下载。 如果出现异常,iframe子页面会报错,父页面不会受任何影响。 使用异步请求进行下载。 在网上看了看,大致的流程是