task

Bind the progress of a query to a progressProperty of a ProgressBar for informing the user of download and upload time in javaFX?

眉间皱痕 提交于 2019-12-25 07:19:37
问题 I got an app that upload and download images to a mysql database but this take like 5 secs and i want to tell the user the progress of this i do the transactions in a task here is the code // progres bar indefinit progressBar.setProgress(-1); Task<Void> task = new Task<Void>() { @Override protected Void call() throws Exception { try { //i net to put to sleep the javafx thread for making a connection Thread.sleep(10); } catch (InterruptedException ex) { ex.printStackTrace(); } Platform

Whenever gem in rails error :'to_specs': Could not find bundler (>= 0) amongst

☆樱花仙子☆ 提交于 2019-12-25 06:32:04
问题 I am using whenever gem in my application. And i have scheduled a rake task every 5 minutes. But that rake task is not running every 5 minutes. When i saw the log it gave me error like `to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError) this is the content in schedule.rb every 3.minutes do rake "mytask name" end 回答1: I had same issue solved by putting env :PATH, '/bin:/sbin:/usr/bin:/usr

Calling a method every Day, every Week , every month and every year

▼魔方 西西 提交于 2019-12-25 06:14:17
问题 I need to autoSend reports to my clients at perticular timings like every day at 00:01 AM every Week at Sunday 00:01 AM on day 1 of every month on day 1 of every year For every day i am doing this : public void contextInitialized(ServletContextEvent arg0) { System.out.println("context initiallized"); System.out.println("Starting timer"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 1); calendar.set(Calendar.SECOND, 0); Date

Ant tasks for JIRA

心不动则不痛 提交于 2019-12-25 03:59:34
问题 Is it possible to create JIRA issues using Ant tasks? I'd like to automatically create JIRA issues using Ant. 回答1: Please check ant-jira. I never used it, looks like you can find some use and tell us how useful it is. 回答2: Use an Ant task to execute a shell command. Make the shell command the Atlassian CLI from Bob Swift. 来源: https://stackoverflow.com/questions/8531101/ant-tasks-for-jira

Task.Factory.StartNew starts with a great delay despite having available threads in threadpool

本秂侑毒 提交于 2019-12-25 03:26:52
问题 This question is a continuation to a previous question I've asked: It takes more than a few seconds for a task to start running I now know how exactly to reproduce this scenario. Task.Factory.StartNew is scheduled on the thread pool, so I'm logging the following (just before I invoke the Factory.StartNew): int workerThreads = 0; int completionPortThreads = 0; ThreadPool.GetMaxThreads(out workerThreads, out completionPortThreads); ThreadPool.GetAvailableThreads(out workerThreads, out

Paste formatted Excel range into Outlook task

僤鯓⒐⒋嵵緔 提交于 2019-12-25 02:59:46
问题 I've been trying to create a sub that would take some information from an Excel selection and create a new task on Outlook. The body of the task should feature the comment from the first cell (which it already does) but before all that I want to paste the range as it looks in Excel, then the comment, and then again, the range. Here's my code: Sub CreateReminder() Dim olApp As Object Dim olRem As Object Dim myRange As Range Dim contact As String Dim company As String Dim city As String Dim

Strange behavior in Task.Run

限于喜欢 提交于 2019-12-25 01:46:38
问题 I am trying to run a lengthy operation with the results being displayed in the window, without blocking the UI thread. What I have is a View that has a ListView control, which binds to an ObservableCollection in my ViewModel . I also have a few other TextBlock controls that bind to two arrays. Anything that runs before the lengthy operation within the Task gets displayed and anything after does not. Here's my code to help you understand what I mean: Four years: <TextBlock TextWrapping="Wrap"

Variable changes during Task Start

旧城冷巷雨未停 提交于 2019-12-25 01:44:59
问题 I am really confused. I run the following code to execute two task, which work on separate folders, thats why I give them index. Unfortunately, when I run the code below, index passed to ProcessingTask static method is always 2... tasks = new Task[sets.ThreadCount]; for (int i = 0; i < sets.ThreadCount; i++) { tasks[i] = Task.Factory.StartNew ( () => { ProcessingTask.run( i, stack, collector, sets, cts.Token, LOG ); }, cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default ); } Any

Redirect process standard input in Task

别说谁变了你拦得住时间么 提交于 2019-12-25 01:25:21
问题 I'm trying to start a process In C# (Java.exe running a jar file) in a seperate thread, and redirect it's StandardInput, StandardError and StandardOutput. I've successfully redirect StandardError and StandardOutput, but I am having problems with StandardInput. I'm starting the process this way: Action<object> MyAction = (object obj) => { MyProcess.Start(); MyProcess.WaitForExit(); }; Task MyTask = new Task(MyAction); MyTask.Start(); What I need then is to be able to, in my windows forms

How to pause a task in airflow

南笙酒味 提交于 2019-12-24 22:36:21
问题 There is a DAG which contains 4 tasks as shown below. Sometimes I want to run task3 only after checking couple of things. May I know how to pause task3 of next instance. Is there any way to pause future(tomorrow's) task instance ? I know we can use command line interface "airflow pause dagid" but here I want to pause taskid. task1 >> task2 >> task3 >> task4 I know we can use command line interface "airflow pause dagid" but here I want to pause taskid. 来源: https://stackoverflow.com/questions