delayed-execution

Delayed Execution on Edit with Google Apps Script

穿精又带淫゛_ 提交于 2019-12-07 23:23:37
问题 I have a relatively large spreadsheet (300 rows, 30 columns) that I color based on the values in the spreadsheet. I'm doing accessing the API minimally using only two accesses: getValues(...) to access all the values of the data range. setBackgrounds(...) to set all the backgrounds of the data range. This runs in about half a second or less. However, it gets in the way if I make it run on every edit using onEdit() , but I also don't want it to be updated at regular time intervals when I'm not

delaying excel calculations during interop C#

自古美人都是妖i 提交于 2019-12-07 04:20:18
问题 I have to input several hundred cells into an excel sheet from a C# program. Each time I set a cell or a range, excel slowly responds... presumably updating various outputs between each input I add. Is there a way to disable calculations from my C# program, and re-enable it after I am done setting cells and ready to read the outputs? 回答1: Yes, set the Application.Calculation to xlCalculationManual , then back to xlCalculationAutomatic . You can also consider setting Application.ScreenUpdating

Delayed Execution on Edit with Google Apps Script

六眼飞鱼酱① 提交于 2019-12-06 08:04:34
I have a relatively large spreadsheet (300 rows, 30 columns) that I color based on the values in the spreadsheet. I'm doing accessing the API minimally using only two accesses: getValues(...) to access all the values of the data range. setBackgrounds(...) to set all the backgrounds of the data range. This runs in about half a second or less. However, it gets in the way if I make it run on every edit using onEdit() , but I also don't want it to be updated at regular time intervals when I'm not editing it, seems like a waste. Is there a good way to make the script run in a "delayed" way,

Non-standard evaluation of expressions in S4 context

≡放荡痞女 提交于 2019-12-06 03:28:44
This is borrowed from shiny's function exprToFunction which is used in their reactive function. Actual question How can I delay the evaluation of an expression (e.g. specified via arg expr ) in order to "capture" its content when calling a S4 method (as opposed to a standard R function)? Example Note that x_1 does not exist yet, that's why we want to delay the evaluation of expr and just "capture" its content. Function captureExpression : captureExpression <- function( expr, caller_offset = 1, brackets = TRUE ) { out <- eval(substitute(substitute(expr)), parent.frame(caller_offset)) if

Linux Kernel: udelay() returns too early?

那年仲夏 提交于 2019-12-06 01:59:31
问题 I have a driver which requires microsecond delays. To create this delay, my driver is using the kernel's udelay function. Specifically, there is one call to udelay(90): iowrite32(data, addr + DATA_OFFSET); iowrite32(trig, addr + CONTROL_OFFSET); udelay(30); trig |= 1; iowrite32(trig, addr + CONTROL_OFFSET); udelay(90); // This is the problematic call We had reliability issues with the device. After a lot of debugging, we traced the problem to the driver resuming before 90us has passed. (See

c# reliable delayed/scheduled execution best practice

早过忘川 提交于 2019-12-05 18:44:57
The project I am working on requires some executions to be done at a certain time. I am not sure what would be the best way to deal with this situation. The method must be able to survive server restart/maintenance. And method calls must be programmatically. I am considering going down this path: I could have a table in database (or even a message queue) called TaskTable which could have TaskID(PK), TaskName(varchar), TaskStatus(enum success,failed, scheduled) and TimeOfExecution. But I need a windows service that periodically polls the database for any unexecuted tasks. Problem I am facing is

Delayed Function Call

我的梦境 提交于 2019-12-04 22:13:00
What's the most elegant way of performing a delayed (and therefore also asynchronous) functional call using C++11, lambdas and async? Suggested naming: delayed_async . Reason for asking is that I want a GUI alert light to be switched off after given time (in this case one second) without blocking the main (wxWidgets main loop) thread of course. I've use wxWidgets' wxTimer for this and I find wxTimer rather cumbersome to use in this case. So that got my curious about how much more convenient this could be implemented if I instead used C++11's async 1 , 2 . I'm aware of that I need to protect

A variable used in its own definition?

筅森魡賤 提交于 2019-12-04 17:45:51
问题 An infinite stream: val ones: Stream[Int] = Stream.cons(1, ones) How is it possible for a value to be used in its own declaration? It seems this should produce a compiler error, yet it works. 回答1: It's not always a recursive definition. This actually works and produces 1: val a : Int = a + 1 println(a) variable a is created when you type val a: Int , so you can use it in the definition. Int is initialized to 0 by default. A class will be null. As @Chris pointed out, Stream accepts => Stream[A

Force Linq to not delay execution

北城余情 提交于 2019-12-04 16:58:24
问题 In fact, this is the same question as this post: How can I make sure my LINQ queries execute when called in my DAL, not in a delayed fashion? But since he didn't explain why he wanted it, the question seems to have been passed over a bit. Here's my similar-but-better-explained problem: I have a handful of threads in two types (ignoring UI threads for a moment). There's a "data-gathering" thread type, and a "computation" thread type. The data gathering threads are slow. There's a quite a bit

Force an IQueryable to execute?

旧巷老猫 提交于 2019-12-04 16:27:52
问题 I have a method that 'has no translation to SQL' that I want to perform on an IQueryable, is there a way to force the IQueryable to execute without having to store it in some intermediate class? 回答1: Is the problem that you want your method to execute locally rather than in the database? If so, AsEnumerable is your friend. It's a very simple method, something like: public IEnumerable<T> AsEnumerable(IEnumerable<T> source) { return source; } The important thing is that it makes the compile