volatility

Need to stop UDFs recalculating when unrelated cells deleted

烂漫一生 提交于 2019-12-01 03:10:23
问题 I've noticed that my UDFs recalculate whenever I delete cells. This causes massive delays when deleting entire columns, because the UDF gets called for each and every cell it is used in. So if you're using 1000 UDFS, then deleting a column or cell will call it 1000 times. By way of example, put the following UDF in a module, then call it from the worksheet a bunch of times with =HelloWorld() Function HelloWorld() HelloWorld = "HelloWorld" Debug.Print Now() End Function Then delete a row. If

Simulation of GARCH in R

和自甴很熟 提交于 2019-11-30 09:55:56
I am doing a simulation of a GARCH model. The model itself is not too relevant, what I would like to ask you is about optimizing the simulation in R. More than anything if you see any room for vectorization, I have thought about it but I cannot see it. So far what I have is this: Let: # ht=cond.variance in t # zt= random number # et = error term # ret= return # Horizon= n periods ahead So this is the code: randhelp= function(horizon=horizon){ ret <- zt <- et <- rep(NA,horizon)#initialize ret and zt et for( j in 1:horizon){ zt[j]= rnorm(1,0,1) et[j] = zt[j]*sqrt(ht[j]) ret[j]=mu + et[j] ht[j+1]

How do IMMUTABLE, STABLE and VOLATILE keywords effect behaviour of function?

ぃ、小莉子 提交于 2019-11-26 19:11:35
We wrote a function get_timestamp() defined as CREATE OR REPLACE FUNCTION get_timestamp() RETURNS integer AS $$ SELECT (FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 10) - 13885344000)::int; $$ LANGUAGE SQL; This was used on INSERT and UPDATE to enter or edit a value in a created and modified field in the database record. However, we found when adding or updating records consecutively it was returning the same value. On inspecting the function in pgAdmin III we noted that on running the SQL to build the function the key word IMMUTABLE had been injected after the LANGUAGE SQL statement. The

reference assignment is atomic so why is Interlocked.Exchange(ref Object, Object) needed?

与世无争的帅哥 提交于 2019-11-26 14:16:09
In my multithreaded asmx web service I had a class field _allData of my own type SystemData which consists of few List<T> and Dictionary<T> marked as volatile . The system data ( _allData ) is refreshed once in a while and I do it by creating another object called newData and fill it's data structures with new data. When it's done I just assign private static volatile SystemData _allData public static bool LoadAllSystemData() { SystemData newData = new SystemData(); /* fill newData with up-to-date data*/ ... _allData = newData. } This should work since the assignment is atomic and the threads

How do IMMUTABLE, STABLE and VOLATILE keywords effect behaviour of function?

*爱你&永不变心* 提交于 2019-11-26 06:49:35
问题 We wrote a function get_timestamp() defined as CREATE OR REPLACE FUNCTION get_timestamp() RETURNS integer AS $$ SELECT (FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 10) - 13885344000)::int; $$ LANGUAGE SQL; This was used on INSERT and UPDATE to enter or edit a value in a created and modified field in the database record. However, we found when adding or updating records consecutively it was returning the same value. On inspecting the function in pgAdmin III we noted that on running the SQL

reference assignment is atomic so why is Interlocked.Exchange(ref Object, Object) needed?

筅森魡賤 提交于 2019-11-26 03:49:38
问题 In my multithreaded asmx web service I had a class field _allData of my own type SystemData which consists of few List<T> and Dictionary<T> marked as volatile . The system data ( _allData ) is refreshed once in a while and I do it by creating another object called newData and fill it\'s data structures with new data. When it\'s done I just assign private static volatile SystemData _allData public static bool LoadAllSystemData() { SystemData newData = new SystemData(); /* fill newData with up